From 15790e226ac62ed0813c89ba29fcd9b3d564fe19 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 8 Sep 2009 14:06:59 +0200 Subject: [PATCH] Annocate static vars left --- src/client.c | 2 +- src/database.c | 2 +- src/http.c | 4 ++-- src/http_command.c | 5 +++-- src/logic.c | 3 ++- src/reclists.c | 7 +++---- src/zeerex.c | 2 +- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/client.c b/src/client.c index d17e640..2cf8eb5 100644 --- a/src/client.c +++ b/src/client.c @@ -102,7 +102,7 @@ static const char *client_states[] = { "Client_Disconnected" }; -static struct client *client_freelist = 0; +static struct client *client_freelist = 0; /* thread pr */ const char *client_get_state_str(struct client *cl) { diff --git a/src/database.c b/src/database.c index d5b9e75..d7c3356 100644 --- a/src/database.c +++ b/src/database.c @@ -45,7 +45,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #endif -static struct host *hosts = 0; // The hosts we know about +static struct host *hosts = 0; /* thread pr */ static xmlDoc *get_explain_xml(struct conf_targetprofiles *targetprofiles, const char *id) diff --git a/src/http.c b/src/http.c index ee427fb..87cb644 100644 --- a/src/http.c +++ b/src/http.c @@ -75,8 +75,8 @@ static struct http_channel *http_create(const char *addr, struct conf_server *server); static void http_destroy(IOCHAN i); -static struct http_buf *http_buf_freelist = 0; -static struct http_channel *http_channel_freelist = 0; +static struct http_buf *http_buf_freelist = 0; /* thread pr */ +static struct http_channel *http_channel_freelist = 0; /* thread pr */ struct http_channel_observer_s { void *data; diff --git a/src/http_command.c b/src/http_command.c index 73a8b1f..13f421d 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -53,7 +53,8 @@ struct http_session { struct http_session *next; }; -static struct http_session *session_list = 0; +static struct http_session *session_list = 0; /* thread pr */ + void http_session_destroy(struct http_session *s); static void session_timeout(IOCHAN i, int event) @@ -155,7 +156,7 @@ static void error(struct http_response *rs, unsigned int make_sessionid(void) { - static int seq = 0; + static int seq = 0; /* thread pr */ unsigned int res; seq++; diff --git a/src/logic.c b/src/logic.c index ee30f50..0e77804 100644 --- a/src/logic.c +++ b/src/logic.c @@ -870,7 +870,8 @@ void statistics(struct session *se, struct statistics *stat) // Master list of connections we're handling events to -static IOCHAN channel_list = 0; +static IOCHAN channel_list = 0; /* thread pr */ + void pazpar2_add_channel(IOCHAN chan) { chan->next = channel_list; diff --git a/src/reclists.c b/src/reclists.c index a6e63ee..85021c6 100644 --- a/src/reclists.c +++ b/src/reclists.c @@ -30,8 +30,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA extern struct parameters global_parameters; -// Not threadsafe -static struct reclist_sortparms *sortparms = 0; +static struct reclist_sortparms *qsort_sortparms = 0; /* thread pr */ struct reclist_bucket { @@ -168,7 +167,7 @@ static int reclist_cmp(const void *p1, const void *p2) struct reclist_sortparms *s; int res = 0; - for (s = sortparms; s && res == 0; s = s->next) + for (s = qsort_sortparms; s && res == 0; s = s->next) { union data_types *ut1 = r1->sortkeys[s->offset]; union data_types *ut2 = r2->sortkeys[s->offset]; @@ -214,7 +213,7 @@ static int reclist_cmp(const void *p1, const void *p2) void reclist_sort(struct reclist *l, struct reclist_sortparms *parms) { - sortparms = parms; + qsort_sortparms = parms; qsort(l->flatlist, l->num_records, sizeof(struct record_cluster*), reclist_cmp); reclist_rewind(l); diff --git a/src/zeerex.c b/src/zeerex.c index e72fe53..dcfc4b7 100644 --- a/src/zeerex.c +++ b/src/zeerex.c @@ -385,7 +385,7 @@ static struct zr_map *map(NMEM m, xmlNode *node) static Zr_setting *findsetting(NMEM m, xmlNode *node, char *name) { - static Zr_setting *r = 0; + static Zr_setting *r = 0; /* thread pr */ xmlNode *n; for (n = node->children; n; n = n->next) { -- 1.7.10.4