From 888700905a4b40984a422904d46419ff7ee9ee78 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Mon, 12 Sep 2016 19:43:46 +0200 Subject: [PATCH] Code cleanup --- src/appinterface.c | 4 ++-- tools/appbroker.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/appinterface.c b/src/appinterface.c index 17e2f48..b3fcedf 100644 --- a/src/appinterface.c +++ b/src/appinterface.c @@ -364,7 +364,7 @@ static int _new_interface_foreach(char const * key, Hash * value, { String const * prefix = (appinterface->mode == ATM_SERVER) ? APPINTERFACE_CALL_PREFIX : APPINTERFACE_CALLBACK_PREFIX; - int i; + unsigned int i; char buf[8]; int type = VT_NULL; char const * p; @@ -388,7 +388,7 @@ static int _new_interface_foreach(char const * key, Hash * value, } for(i = 0; i < APPSERVER_MAX_ARGUMENTS; i++) { - snprintf(buf, sizeof(buf), "arg%d", i + 1); + snprintf(buf, sizeof(buf), "arg%u", i + 1); if((p = hash_get(value, buf)) == NULL) break; if(_new_interface_append_arg(appinterface, p) != 0) diff --git a/tools/appbroker.c b/tools/appbroker.c index a4ddb64..8ad4867 100644 --- a/tools/appbroker.c +++ b/tools/appbroker.c @@ -117,7 +117,7 @@ static void _appbroker_constants(AppBroker * appbroker) static int _appbroker_foreach_call(char const * key, Hash * value, void * data) { AppBroker * appbroker = data; - int i; + unsigned int i; char buf[8]; char const * p; const char sep[] = ", "; @@ -133,7 +133,7 @@ static int _appbroker_foreach_call(char const * key, Hash * value, void * data) key, "(App * app, AppServerClient * client"); for(i = 0; i < APPSERVER_MAX_ARGUMENTS; i++) { - snprintf(buf, sizeof(buf), "arg%d", i + 1); + snprintf(buf, sizeof(buf), "arg%u", i + 1); if((p = hash_get(value, buf)) == NULL) break; if(_appbroker_foreach_call_arg(appbroker, sep, p) != 0) @@ -168,7 +168,7 @@ static int _appbroker_foreach_callback(char const * key, Hash * value, { /* XXX some code duplication with _appbroker_foreach_call() */ AppBroker * appbroker = data; - int i; + unsigned int i; char buf[8]; char const * p; const char sep[] = ", "; @@ -184,7 +184,7 @@ static int _appbroker_foreach_callback(char const * key, Hash * value, key, "(AppClient * client"); for(i = 0; i < APPSERVER_MAX_ARGUMENTS; i++) { - snprintf(buf, sizeof(buf), "arg%d", i + 1); + snprintf(buf, sizeof(buf), "arg%u", i + 1); if((p = hash_get(value, buf)) == NULL) break; if(_appbroker_foreach_call_arg(appbroker, sep, p) != 0)