Commit 53443fbd authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

SWZ: modification for Octave, whose 'mexPrintf' has 'void' return type

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