From 6afc2e432b9a18da29ad710f2d26e0c4073fa5a5 Mon Sep 17 00:00:00 2001 From: Mark Riddoch Date: Mon, 17 Jun 2013 14:25:32 +0200 Subject: [PATCH] Addition of -Wall to CFLAGS Cleanup warnings produced by above with the exception of those files requiring reorganisation --- core/Makefile | 2 +- core/dcb.c | 2 +- core/load_utils.c | 2 -- modules/protocol/Makefile | 2 +- modules/routing/Makefile | 2 +- modules/routing/readconnroute.c | 5 +++-- modules/routing/testroute.c | 3 +++ 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/core/Makefile b/core/Makefile index 8b3064797..afaf6b63e 100644 --- a/core/Makefile +++ b/core/Makefile @@ -21,7 +21,7 @@ # 17/06/13 Mark Riddoch Addition of dependency generation CC=cc -CFLAGS=-c -I/usr/include -I../include +CFLAGS=-c -I/usr/include -I../include -Wall LDFLAGS=-rdynamic SRCS= atomic.c buffer.c spinlock.c gateway.c gateway_mysql_protocol.c gw_utils.c \ utils.c dcb.c load_utils.c diff --git a/core/dcb.c b/core/dcb.c index fa87861da..9b75d2a53 100644 --- a/core/dcb.c +++ b/core/dcb.c @@ -164,7 +164,7 @@ int epollfd = -1; // Need to work out how to get this void printDCB(DCB *dcb) { - (void)printf("DCB: 0x%x\n", (void *)dcb); + (void)printf("DCB: 0x%p\n", (void *)dcb); (void)printf("\tDCB state: %s\n", gw_dcb_state2string(dcb->state)); (void)printf("\tQueued write data: %d\n", gwbuf_length(dcb->writeq)); (void)printf("\tStatistics:\n"); diff --git a/core/load_utils.c b/core/load_utils.c index 5eba8ed91..0eead68c9 100644 --- a/core/load_utils.c +++ b/core/load_utils.c @@ -163,8 +163,6 @@ void *handle; static MODULES * find_module(const char *module) { -MODULES *ptr = registered; - while (registered) if (strcmp(registered->module, module)) return registered; diff --git a/modules/protocol/Makefile b/modules/protocol/Makefile index 2c75bf02d..3a7d6da51 100644 --- a/modules/protocol/Makefile +++ b/modules/protocol/Makefile @@ -19,7 +19,7 @@ # 13/06/13 Mark Riddoch Initial protocol module development CC=cc -CFLAGS=-c -fPIC -I/usr/include -I../include -I../../include +CFLAGS=-c -fPIC -I/usr/include -I../include -I../../include -Wall LDFLAGS=-shared MYSQLCLIENTSRCS=mysql_client.c MYSQLCLIENTOBJ=$(MYSQLCLIENTSRCS:.c=.o) diff --git a/modules/routing/Makefile b/modules/routing/Makefile index 0846a0346..80dbf6134 100644 --- a/modules/routing/Makefile +++ b/modules/routing/Makefile @@ -19,7 +19,7 @@ # 13/06/13 Mark Riddoch Initial routing module development CC=cc -CFLAGS=-c -fPIC -I/usr/include -I../include -I../../include +CFLAGS=-c -fPIC -I/usr/include -I../include -I../../include -Wall LDFLAGS=-shared TESTSRCS=testroute.c TESTOBJ=$(TESTSRCS:.c=.o) diff --git a/modules/routing/readconnroute.c b/modules/routing/readconnroute.c index 183fa823a..eb4d9e034 100644 --- a/modules/routing/readconnroute.c +++ b/modules/routing/readconnroute.c @@ -46,6 +46,7 @@ #include #include #include +#include static char *version_str = "V1.0.0"; @@ -144,7 +145,7 @@ int i, n; free(inst->servers[i]); free(inst->servers); free(inst); - return; + return NULL; } inst->servers[n]->hostname = strdup(server->name); inst->servers[n]->protocol = strdup(server->protocol); @@ -158,7 +159,7 @@ int i, n; * insert this router instance into the linked list of routers * that have been created with this module. */ - spinlock_aquire(&instlock); + spinlock_acquire(&instlock); inst->next = instances; instances = inst; spinlock_release(&instlock); diff --git a/modules/routing/testroute.c b/modules/routing/testroute.c index fa162a839..6fbd0e06b 100644 --- a/modules/routing/testroute.c +++ b/modules/routing/testroute.c @@ -74,6 +74,7 @@ GetModuleObject() static ROUTER * createInstance(SERVICE *service) { + return NULL; } /** @@ -86,6 +87,7 @@ createInstance(SERVICE *service) static void * newSession(ROUTER *instance, SESSION *session) { + return NULL; } /** @@ -104,4 +106,5 @@ closeSession(ROUTER *instance, void *session) static int routeQuery(ROUTER *instance, void *session, GWBUF *queue) { + return 0; }