From: Galen Charlton Date: Mon, 21 May 2012 21:29:05 +0000 (-0400) Subject: fix up index/position type for calls of various osrfList* functions X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=72e4f650e64328d153962c9da08305c54741be37;p=working%2FOpenSRF.git fix up index/position type for calls of various osrfList* functions osrfListSet, osrfListRemove, osrfListGetIndex, and osrfListExtract all expect unsigned ints for the index/position parameter. src/jserver is ignored by this commit as its removal is pending. Signed-off-by: Galen Charlton --- diff --git a/src/gateway/osrf_http_translator.c b/src/gateway/osrf_http_translator.c index e945689..83855e9 100644 --- a/src/gateway/osrf_http_translator.c +++ b/src/gateway/osrf_http_translator.c @@ -451,7 +451,7 @@ static int osrfHttpTranslatorProcess(osrfHttpTranslator* trans) { if(trans->complete || trans->connectOnly) { growing_buffer* buf = buffer_init(128); - int i; + unsigned int i; OSRF_BUFFER_ADD(buf, osrfListGetIndex(trans->messages, 0)); for(i = 1; i < trans->messages->size; i++) { buffer_chomp(buf); // chomp off the closing array bracket diff --git a/src/libopensrf/osrf_json_tools.c b/src/libopensrf/osrf_json_tools.c index d88c827..2e6893d 100644 --- a/src/libopensrf/osrf_json_tools.c +++ b/src/libopensrf/osrf_json_tools.c @@ -123,7 +123,7 @@ jsonObject* jsonObjectDecodeClass( const jsonObject* obj ) { jsonObject* newObj = NULL; const jsonObject* classObj = NULL; const jsonObject* payloadObj = NULL; - int i; + unsigned int i; if( obj->type == JSON_HASH ) { @@ -206,7 +206,7 @@ static jsonObject* _jsonObjectEncodeClass( const jsonObject* obj, int ignoreClas } else if( obj->type == JSON_ARRAY ) { newObj = jsonNewObjectType(JSON_ARRAY); - int i; + unsigned int i; for( i = 0; i != obj->size; i++ ) { jsonObjectSetIndex( newObj, i, _jsonObjectEncodeClass(jsonObjectGetIndex( obj, i ), 0 )); diff --git a/src/libopensrf/osrf_list.c b/src/libopensrf/osrf_list.c index 4d4bb11..77cda67 100644 --- a/src/libopensrf/osrf_list.c +++ b/src/libopensrf/osrf_list.c @@ -77,7 +77,7 @@ int osrfListPush( osrfList* list, void* item ) { */ int osrfListPushFirst( osrfList* list, void* item ) { if(!(list && item)) return -1; - int i; + unsigned int i; for( i = 0; i < list->size; i++ ) if(!list->arrlist[i]) break; osrfListSet( list, item, i ); diff --git a/src/libopensrf/string_array.c b/src/libopensrf/string_array.c index be0b7d4..b473331 100644 --- a/src/libopensrf/string_array.c +++ b/src/libopensrf/string_array.c @@ -160,7 +160,7 @@ int osrfStringArrayContains( */ void osrfStringArrayRemove( osrfStringArray* arr, const char* tstr ) { if(!(arr && tstr)) return; - int i; + unsigned int i; char* str; int removed = 0; // boolean diff --git a/src/router/osrf_router.c b/src/router/osrf_router.c index c1f4134..359d98a 100644 --- a/src/router/osrf_router.c +++ b/src/router/osrf_router.c @@ -797,7 +797,7 @@ static void osrfRouterHandleAppRequest( osrfRouter* router, const transport_mess const osrfMessage* omsg = NULL; // Process each osrfMessage - int i; + unsigned int i; for( i = 0; i < router->message_list->size; ++i ) { omsg = osrfListGetIndex( router->message_list, i );