Silence compiler warning about discarding const user/dbs/silence_const_discard
authorDan Scott <dscott@laurentian.ca>
Sat, 20 Apr 2013 02:41:21 +0000 (22:41 -0400)
committerDan Scott <dscott@laurentian.ca>
Sat, 20 Apr 2013 02:41:21 +0000 (22:41 -0400)
By declaring str as "char *" rather than "const char *", then casting
the result of osrfArrayGetString to (char *), we make the compiler
happier.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
src/gateway/osrf_http_translator.c

index f829fa0..166d111 100644 (file)
@@ -276,9 +276,9 @@ static char* osrfHttpTranslatorParseRequest(osrfHttpTranslator* trans) {
 
                 const jsonObject* obj = NULL;
                 int i = 0;
-                const char* str;
+                char* str;
                 int redactParams = 0;
-                while( (str = osrfStringArrayGetString(log_protect_arr, i++)) ) {
+                while( (str = (char *) osrfStringArrayGetString(log_protect_arr, i++)) ) {
                     //osrfLogInternal(OSRF_LOG_MARK, "Checking for log protection [%s]", str);
                     if(!strncmp(method, str, strlen(str))) {
                         redactParams = 1;