Fixed potential warnings when compiled in debugging mode

This commit is contained in:
Pierre Pronchery 2010-09-10 00:31:23 +00:00
parent 6717a0fc3b
commit 301820317e

View File

@ -304,8 +304,9 @@ static int _new_append_arg(AppInterface * ai, char const * arg)
r->direction = type & AICD_MASK; r->direction = type & AICD_MASK;
r->size = _aict_size[r->type]; r->size = _aict_size[r->type];
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "DEBUG: type %s, direction: %d, size: %zu\n", fprintf(stderr, "DEBUG: type %s, direction: %d, size: %lu\n",
AICTString[r->type], r->direction, r->size); AICTString[r->type], r->direction,
(unsigned long)r->size);
#endif #endif
return 0; return 0;
} }
@ -416,7 +417,8 @@ int appinterface_call(AppInterface * appinterface, char buf[], size_t buflen,
for(i = 0; i < aic->args_cnt; i++) for(i = 0; i < aic->args_cnt; i++)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s%zu%s", "DEBUG: argument ", i, "\n"); fprintf(stderr, "%s%lu%s", "DEBUG: argument ",
(unsigned long)i, "\n");
#endif #endif
size = 0; size = 0;
if(aic->args[i].direction == AICD_IN) if(aic->args[i].direction == AICD_IN)
@ -559,7 +561,7 @@ int appinterface_call(AppInterface * appinterface, char buf[], size_t buflen,
if(size == 0) if(size == 0)
continue; continue;
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "DEBUG: => size %zu\n", size); fprintf(stderr, "DEBUG: => size %lu\n", (unsigned long)size);
#endif #endif
if(_send_bytes(p, size, buf, buflen, &pos) != 0) if(_send_bytes(p, size, buf, buflen, &pos) != 0)
return -1; return -1;
@ -631,7 +633,8 @@ int appinterface_call_receive(AppInterface * appinterface, int32_t * ret,
for(i = 0; i < aic->args_cnt; i++) for(i = 0; i < aic->args_cnt; i++)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s%zu%s", "DEBUG: argument ", i + 1, "\n"); fprintf(stderr, "%s%lu%s", "DEBUG: argument ",
(unsigned long)i + 1, "\n");
#endif #endif
if(aic->args[i].direction == AICD_IN) if(aic->args[i].direction == AICD_IN)
continue; continue;
@ -670,7 +673,8 @@ int appinterface_call_receive(AppInterface * appinterface, int32_t * ret,
if(pos + size > buflen) if(pos + size > buflen)
return 0; return 0;
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s%zu%s", "DEBUG: <= size ", size, "\n"); fprintf(stderr, "%s%lu%s", "DEBUG: <= size ",
(unsigned long)size, "\n");
#endif #endif
memcpy(v, &buf[pos], size); memcpy(v, &buf[pos], size);
pos += size; pos += size;
@ -731,8 +735,9 @@ int appinterface_call_receive(AppInterface * appinterface, int32_t * ret,
size = bsize; size = bsize;
v = buffer_get_data(b); v = buffer_get_data(b);
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s%zu%s", "DEBUG: <= Buffer" fprintf(stderr, "%s%lu%s", "DEBUG: <= Buffer"
" size ", size, "\n"); " size ", (unsigned long)size,
"\n");
#endif #endif
break; break;
} }
@ -1068,8 +1073,9 @@ static int _args_exec(AppInterfaceCall * call, int * ret, void ** args)
*ret = func4(args[0], args[1], args[2], args[3]); *ret = func4(args[0], args[1], args[2], args[3]);
break; break;
default: default:
return error_set_code(1, "%s%zu%s", "AppInterface: " return error_set_code(1, "%s%lu%s", "AppInterface: "
"functions with ", call->args_cnt, "functions with ",
(unsigned long)call->args_cnt,
"arguments are not supported"); "arguments are not supported");
} }
if(call->type.type == AICT_VOID) /* avoid information leak */ if(call->type.type == AICT_VOID) /* avoid information leak */