add format checks and correct for them

parent 28877239
......@@ -12,7 +12,7 @@ C_SRC := $(wildcard *.c)
OBJECTS := $(C_SRC:.c=.o)
#OBJECTS := rinterpolate.o rinterpolate-debug.o
LIBRINTERPOLATE_ARCHFLAGS ?= -march=native -mtune=native
CFLAGS := -fPIC -O2 -std=gnu99 -g $(LIBRINTERPOLATE_ARCHFLAGS) -Wall -Wstrict-prototypes -ffast-math -D__RINTERPOLATE__ -D__RINTERPOLATE_BUILD_BUILD_FLAGS__ $(COPTFLAGS)
CFLAGS := -fPIC -O2 -std=gnu99 -g $(LIBRINTERPOLATE_ARCHFLAGS) -Wformat-signedness -Wformat -Wall -Wstrict-prototypes -ffast-math -D__RINTERPOLATE__ -D__RINTERPOLATE_BUILD_BUILD_FLAGS__ $(COPTFLAGS)
ifeq ($(PREFIX),)
PREFIX := /usr/local
endif
......
......@@ -8,7 +8,7 @@ void rinterpolate_alloc_varcount(struct rinterpolate_table_t * RESTRICT const ta
if(unlikely(table->varcount==NULL))
{
rinterpolate_error(RINTERPOLATE_CALLOC_FAILED,
"Error allocating varcount %d in interpolate\n",
"Error allocating varcount %u in interpolate\n",
table->parent,
table->table_number);
}
......
......@@ -13,7 +13,7 @@ void No_return Gnu_format_args(2,4) rinterpolate_error(rinterpolate_counter_t er
va_list ap;
va_start(ap,rinterpolate_data);
fprintf(stderr,
"librinterpolate error %d: ",
"librinterpolate error %u: ",
errnum);
fprintf(stderr,format,ap);
va_end(ap);
......
......@@ -133,7 +133,7 @@ int main (int argc,
for(i=0;i<L;i++)
{
rinterpolate_counter_t offset = i * ND;
printf("% 4d -> % 4d : ",i,offset);
printf("%4u -> %4u : ",i,offset);
for(j=0;j<ND;j++)
{
printf("%g ",table[offset+j]);
......@@ -159,7 +159,7 @@ int main (int argc,
if(status != 0)
{
printf("alloc data status != 0 = %d\n",status);
printf("alloc data status != 0 = %u\n",status);
fflush(NULL);
exit(status);
}
......@@ -306,7 +306,7 @@ int main (int argc,
if(SPIN_TESTS)
{
const rinterpolate_counter_t n = 5;
printf("Spun input (n=%d) tests \n",n);
printf("Spun input (n=%u) tests \n",n);
double ** xx = malloc(n*sizeof(rinterpolate_float_t*));
for(i=0;i<n;i++)
{
......@@ -346,12 +346,12 @@ int main (int argc,
t_nocache = t_cache;
}
printf("%7s cache_length %2d : %8.3f, maxdiff = %6.4f %%\n","With",ncache,t_cache,100.0*diffmax);
printf("%7s cache_length %2u : %8.3f, maxdiff = %6.4f %%\n","With",ncache,t_cache,100.0*diffmax);
printf(" Cache speed up : %5.3f %%\n",
100.0*((rinterpolate_float_t)t_nocache - (rinterpolate_float_t)t_cache)/
Min((rinterpolate_float_t)t_cache,(rinterpolate_float_t)t_nocache));
char c[100];
sprintf(c,"Spun %d",ncache);
sprintf(c,"Spun %u",ncache);
Report(c,t_cache);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment