diff options
author | Yorhel <git@yorhel.nl> | 2013-04-14 08:51:57 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2013-04-14 09:04:22 +0200 |
commit | d55f73562739b2a0b0bb79d939a82a826bbe1dfc (patch) | |
tree | 7d113fdc77cce14b60e8f73bdc08f593329c6763 | |
parent | 470e29e4d54b939a4d04ce65095acf5869628f13 (diff) |
Added const flag to some more static structs
m--------- | deps | 0 | ||||
-rw-r--r-- | src/db.c | 2 | ||||
-rw-r--r-- | src/hub/adc.c | 6 | ||||
-rw-r--r-- | src/hub/adc.h | 2 | ||||
-rw-r--r-- | src/hub/local.h | 2 | ||||
-rw-r--r-- | src/hub/nmdc.c | 6 | ||||
-rw-r--r-- | src/hub/nmdc.h | 2 | ||||
-rw-r--r-- | src/main.c | 2 |
8 files changed, 11 insertions, 11 deletions
diff --git a/deps b/deps -Subproject 79d43d183d03d1ad8ef546e291f13b40d54047b +Subproject 181e1eaa6c08732ca7c713702496873b8ab60ea @@ -36,7 +36,7 @@ static ev_async db_async; /* Queries to execute to convert from one version to another. */ -static struct { int fromver, tover; const char *sql; } schema[] = { +static const struct { int fromver, tover; const char *sql; } schema[] = { { 0, 0, "CREATE TABLE vars (" "name TEXT NOT NULL PRIMARY KEY," diff --git a/src/hub/adc.c b/src/hub/adc.c index d9902fd..21e7dcf 100644 --- a/src/hub/adc.c +++ b/src/hub/adc.c @@ -519,7 +519,7 @@ static void hub_adc_zof(hub_t *h, const char *cmd, int len) { static void hub_adc_handle(hub_t *h, const char *cmd, int len) { - static struct { + static const struct { adc_cmd_t cmd; adc_state_t states; /* 0 = all */ const char types[8]; /* empty = all */ @@ -644,7 +644,7 @@ static void hub_adc_disconnected(hub_t *h) { } -static hub_proto_t hub__adc = { +static const hub_proto_t hub__adc = { hub_adc_connected, hub_adc_disconnected, hub_adc_sendinf, @@ -653,6 +653,6 @@ static hub_proto_t hub__adc = { hub_adc_read }; -hub_proto_t *hub_adc = &hub__adc; +const hub_proto_t *hub_adc = &hub__adc; /* vim: set noet sw=4 ts=4: */ diff --git a/src/hub/adc.h b/src/hub/adc.h index 03dcd6d..1c26c1c 100644 --- a/src/hub/adc.h +++ b/src/hub/adc.h @@ -42,7 +42,7 @@ typedef struct { bool zlibenable : 1; } hub_adc_t; -extern hub_proto_t *hub_adc; +extern const hub_proto_t *hub_adc; #endif /* vim: set noet sw=4 ts=4: */ diff --git a/src/hub/local.h b/src/hub/local.h index 609831b..e691c5f 100644 --- a/src/hub/local.h +++ b/src/hub/local.h @@ -66,7 +66,7 @@ struct hub_t { dbo_t dbo; int id; hub_manager_type_t type; - hub_proto_t *proto; + const hub_proto_t *proto; hub_hub_t h; hub_conn_t c; union { diff --git a/src/hub/nmdc.c b/src/hub/nmdc.c index de3ec9e..73fa3f9 100644 --- a/src/hub/nmdc.c +++ b/src/hub/nmdc.c @@ -535,7 +535,7 @@ static void hub_nmdc_lock(hub_t *h, const char *cmd, int len) { static void hub_nmdc_handle(hub_t *h, const char *cmd, int len) { - static struct { + static const struct { const char *prefix; int states; void (*func)(hub_t *, const char *, int); @@ -655,7 +655,7 @@ static void hub_nmdc_disconnected(hub_t *h) { } -static hub_proto_t hub__nmdc = { +static const hub_proto_t hub__nmdc = { hub_nmdc_connected, hub_nmdc_disconnected, hub_nmdc_sendinf, @@ -664,6 +664,6 @@ static hub_proto_t hub__nmdc = { hub_nmdc_read }; -hub_proto_t *hub_nmdc = &hub__nmdc; +const hub_proto_t *hub_nmdc = &hub__nmdc; /* vim: set noet sw=4 ts=4: */ diff --git a/src/hub/nmdc.h b/src/hub/nmdc.h index bd5b70c..bc437de 100644 --- a/src/hub/nmdc.h +++ b/src/hub/nmdc.h @@ -43,7 +43,7 @@ typedef struct { } hub_nmdc_t; -extern hub_proto_t *hub_nmdc; +extern const hub_proto_t *hub_nmdc; #endif /* vim: set noet sw=4 ts=4: */ @@ -129,7 +129,7 @@ static void argv_parse(int argc, char **argv) { int v; char *val; - static yopt_opt_t opts[] = { + static const yopt_opt_t opts[] = { { 'V', 0, "-V,--version" }, { 'Y', 0, "--system" }, { 'S', 0, "--session" }, |