}
}
else if ( s_token[0] ) {
- Sys_Printf( "Unknown token '%s'\n", s_token );
+ Error( "Unknown token '%s'\n", s_token );
}
}
netmessage_t msg;
qboolean verbose = qfalse;
+qboolean werror = qfalse;
// our main document
// is streamed through the network to Radiant
vsprintf( out_buffer, format, argptr );
va_end( argptr );
+ if ( ( flag == SYS_WRN ) && ( werror == qtrue ) ) {
+ Error( out_buffer );
+ return;
+ }
+
FPrintf( flag, out_buffer );
}
#define SYS_NOXML 4 // don't send that down the XML stream
extern qboolean verbose;
+extern qboolean werror;
void Sys_Printf( const char *text, ... );
void Sys_FPrintf( int flag, const char *text, ... );
f = 40 * dispatch / workcount;
if ( f < oldf ) {
- Sys_Printf( "warning: progress went backwards (should never happen)\n" );
+ Sys_FPrintf( SYS_WRN, "WARNING: progress went backwards (should never happen)\n" );
oldf = f;
}
while ( f > oldf )
convertGame = GetGame( argv[ i ] );
map_allowed = qfalse;
if ( convertGame == NULL ) {
- Sys_Printf( "Unknown conversion format \"%s\". Defaulting to ASE.\n", argv[ i ] );
+ Sys_FPrintf( SYS_WRN, "Unknown conversion format \"%s\". Defaulting to ASE.\n", argv[ i ] );
}
}
}
{"-game <gamename>", "Load settings for the given game (default: quake3)"},
{"-subdivisions <F>", "multiplier for patch subdivisions quality"},
{"-threads <N>", "number of threads to use"},
- {"-v", "Verbose mode"}
+ {"-v", "Verbose mode"},
+ {"-werror", "Make all warnings into errors"}
};
HelpOptions("Common Options", 0, 80, common, sizeof(common)/sizeof(struct HelpOption));
if ( !WebPGetInfo( buffer, ( size_t) size, &image_width, &image_height ) )
{
- Sys_Printf( "WARNING: An error occurred reading WEBP image info\n" );
+ Sys_FPrintf( SYS_WRN, "WARNING: An error occurred reading WEBP image info\n" );
return;
}
int main( int argc, char **argv ){
int i, r;
double start, end;
+ extern qboolean werror;
/* we want consistent 'randomness' */
argv[ i ] = NULL;
}
+ /* make all warnings into errors */
+ else if ( !strcmp( argv[ i ], "-werror" ) ) {
+ werror = qtrue;
+ argv[ i ] = NULL;
+ }
+
/* patch subdivisions */
else if ( !strcmp( argv[ i ], "-subdivisions" ) ) {
argv[ i ] = NULL;
numvis = LeafVectorFromPortalVector( portalvector, uncompressed );
// if (uncompressed[leafnum>>3] & (1<<(leafnum&7)))
-// Sys_Printf ("WARNING: Leaf portals saw into leaf\n");
+// Sys_FPrintf (SYS_WRN, "WARNING: Leaf portals saw into leaf\n");
// uncompressed[leafnum>>3] |= (1<<(leafnum&7));