Commit 72ea2cc0 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

when printing to stdout, use printf and return val

parent 358640ba
......@@ -159,7 +159,7 @@ int dw_PrintArray(FILE *f, void *a, char *format)
static int dw_PrintInt(FILE* f, void* element, char *format)
{
if(f==stdout)
return (printf(format ? format : "%d ",*((int*)element)) < 0) ? 0 : 1;
return (swz_fprintf_stdout(format ? format : "%d ",*((int*)element)) < 0) ? 0 : 1;
else
return (fprintf(f,format ? format : "%d ",*((int*)element)) < 0) ? 0 : 1;
}
......@@ -167,7 +167,7 @@ static int dw_PrintInt(FILE* f, void* element, char *format)
static int dw_PrintDouble(FILE* f, void* element, char *format)
{
if(f==stdout)
return (printf(format ? format : "%lf ",*((double*)element)) < 0) ? 0 : 1;
return (swz_fprintf_stdout(format ? format : "%lf ",*((double*)element)) < 0) ? 0 : 1;
else
return (fprintf(f,format ? format : "%lf ",*((double*)element)) < 0) ? 0 : 1;
}
......@@ -175,7 +175,7 @@ static int dw_PrintDouble(FILE* f, void* element, char *format)
static int dw_PrintFloat(FILE* f, void* element, char *format)
{
if(f==stdout)
return (printf(format ? format : "%f ",*((float*)element)) < 0) ? 0 : 1;
return (swz_fprintf_stdout(format ? format : "%f ",*((float*)element)) < 0) ? 0 : 1;
else
return (fprintf(f,format ? format : "%f ",*((float*)element)) < 0) ? 0 : 1;
}
......@@ -183,7 +183,7 @@ static int dw_PrintFloat(FILE* f, void* element, char *format)
static int dw_PrintChar(FILE* f, void* element, char *format)
{
if(f==stdout)
return (printf(format ? format : "%c ",*((char*)element)) < 0) ? 0 : 1;
return (swz_fprintf_stdout(format ? format : "%c ",*((char*)element)) < 0) ? 0 : 1;
else
return (fprintf(f,format ? format : "%c ",*((char*)element)) < 0) ? 0 : 1;
}
......@@ -191,7 +191,7 @@ static int dw_PrintChar(FILE* f, void* element, char *format)
static int dw_PrintString(FILE* f, void* element, char *format)
{
if(f==stdout)
return (printf(format ? format : "%s\t",(char*)element) < 0) ? 0 : 1;
return (swz_fprintf_stdout(format ? format : "%s\t",(char*)element) < 0) ? 0 : 1;
else
return (fprintf(f,format ? format : "%s\t",(char*)element) < 0) ? 0 : 1;
}
......
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