1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

role structs to const

Indicate these are immutable (they're already treated as
such) and can go in .rodata
This commit is contained in:
Andy Green 2020-01-15 06:31:19 +00:00
parent 5055096e47
commit 6f2230a993
17 changed files with 18 additions and 18 deletions

View file

@ -114,7 +114,7 @@ rops_pt_init_destroy_cgi(struct lws_context *context,
}
struct lws_role_ops role_ops_cgi = {
const struct lws_role_ops role_ops_cgi = {
/* role name */ "cgi",
/* alpn id */ NULL,
/* check_upgrades */ NULL,

View file

@ -32,7 +32,7 @@
#endif
#endif
extern struct lws_role_ops role_ops_cgi;
extern const struct lws_role_ops role_ops_cgi;
#define lwsi_role_cgi(wsi) (wsi->role_ops == &role_ops_cgi)

View file

@ -512,7 +512,7 @@ rops_pt_init_destroy_dbus(struct lws_context *context,
return 0;
}
struct lws_role_ops role_ops_dbus = {
const struct lws_role_ops role_ops_dbus = {
/* role name */ "dbus",
/* alpn id */ NULL,
/* check_upgrades */ NULL,

View file

@ -26,7 +26,7 @@
#include <dbus/dbus.h>
extern struct lws_role_ops role_ops_dbus;
extern const struct lws_role_ops role_ops_dbus;
#define lwsi_role_dbus(wsi) (wsi->role_ops == &role_ops_dbus)

View file

@ -1131,7 +1131,7 @@ rops_pt_init_destroy_h1(struct lws_context *context,
return 0;
}
struct lws_role_ops role_ops_h1 = {
const struct lws_role_ops role_ops_h1 = {
/* role name */ "h1",
/* alpn id */ "http/1.1",
/* check_upgrades */ NULL,

View file

@ -26,5 +26,5 @@
* Most of the h1 business is defined in the h1 / h2 common roles/http dir
*/
extern struct lws_role_ops role_ops_h1;
extern const struct lws_role_ops role_ops_h1;
#define lwsi_role_h1(wsi) (wsi->role_ops == &role_ops_h1)

View file

@ -1221,7 +1221,7 @@ rops_issue_keepalive_h2(struct lws *wsi, int isvalid)
return 0;
}
struct lws_role_ops role_ops_h2 = {
const struct lws_role_ops role_ops_h2 = {
/* role name */ "h2",
/* alpn id */ "h2",
/* check_upgrades */ rops_check_upgrades_h2,

View file

@ -22,7 +22,7 @@
* IN THE SOFTWARE.
*/
extern struct lws_role_ops role_ops_h2;
extern const struct lws_role_ops role_ops_h2;
#define lwsi_role_h2(wsi) (wsi->role_ops == &role_ops_h2)
struct http2_settings {

View file

@ -176,7 +176,7 @@ int rops_handle_POLLOUT_listen(struct lws *wsi)
return LWS_HP_RET_USER_SERVICE;
}
struct lws_role_ops role_ops_listen = {
const struct lws_role_ops role_ops_listen = {
/* role name */ "listen",
/* alpn id */ NULL,
/* check_upgrades */ NULL,

View file

@ -68,7 +68,7 @@ rops_handle_POLLIN_pipe(struct lws_context_per_thread *pt, struct lws *wsi,
return LWS_HPI_RET_HANDLED;
}
struct lws_role_ops role_ops_pipe = {
const struct lws_role_ops role_ops_pipe = {
/* role name */ "pipe",
/* alpn id */ NULL,
/* check_upgrades */ NULL,

View file

@ -270,8 +270,8 @@ struct lws_role_ops {
};
/* core roles */
extern struct lws_role_ops role_ops_raw_skt, role_ops_raw_file, role_ops_listen,
role_ops_pipe;
extern const struct lws_role_ops role_ops_raw_skt, role_ops_raw_file,
role_ops_listen, role_ops_pipe;
/* bring in role private declarations */

View file

@ -77,7 +77,7 @@ rops_adoption_bind_raw_file(struct lws *wsi, int type, const char *vh_prot_name)
return 1; /* bound */
}
struct lws_role_ops role_ops_raw_file = {
const struct lws_role_ops role_ops_raw_file = {
/* role name */ "raw-file",
/* alpn id */ NULL,
/* check_upgrades */ NULL,

View file

@ -186,7 +186,7 @@ rops_handle_POLLOUT_raw_proxy(struct lws *wsi)
return LWS_HP_RET_BAIL_OK;
}
struct lws_role_ops role_ops_raw_proxy = {
const struct lws_role_ops role_ops_raw_proxy = {
/* role name */ "raw-proxy",
/* alpn id */ NULL,
/* check_upgrades */ NULL,

View file

@ -24,7 +24,7 @@
* This is included from private-lib-core.h if LWS_ROLE_RAW_PROXY
*/
extern struct lws_role_ops role_ops_raw_proxy;
extern const struct lws_role_ops role_ops_raw_proxy;
#define lwsi_role_raw_proxy(wsi) (wsi->role_ops == &role_ops_raw_proxy)

View file

@ -240,7 +240,7 @@ rops_client_bind_raw_skt(struct lws *wsi,
}
#endif
struct lws_role_ops role_ops_raw_skt = {
const struct lws_role_ops role_ops_raw_skt = {
/* role name */ "raw-skt",
/* alpn id */ NULL,
/* check_upgrades */ NULL,

View file

@ -2045,7 +2045,7 @@ rops_issue_keepalive_ws(struct lws *wsi, int isvalid)
return 0;
}
struct lws_role_ops role_ops_ws = {
const struct lws_role_ops role_ops_ws = {
/* role name */ "ws",
/* alpn id */ NULL,
/* check_upgrades */ NULL,

View file

@ -24,7 +24,7 @@
* This is included from private-lib-core.h if LWS_ROLE_WS
*/
extern struct lws_role_ops role_ops_ws;
extern const struct lws_role_ops role_ops_ws;
#define lwsi_role_ws(wsi) (wsi->role_ops == &role_ops_ws)