From d8449157fd4facc0b2da329b630b159677565464 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sat, 15 Oct 2016 20:00:27 +0200 Subject: [PATCH] More: Using Sys_FPrintf with SYS_WRN and SYS_ERR MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This commit do the same as “Using Sys_FPrintf with SYS_WRN and SYS_ERR” commit by @Pan7 (a288b9c) for occurrences that were left untouched (tools/ subtree only). --- tools/quake2/q2map/brushbsp.c | 2 +- tools/quake2/q2map/faces.c | 2 +- tools/quake2/q2map/lightmap.c | 2 +- tools/quake2/q2map/main.c | 2 +- tools/quake2/q2map/portals.c | 8 ++++---- tools/quake2/q2map/qvis.c | 2 +- tools/quake3/common/aselib.c | 2 +- tools/quake3/q3map2/convert_ase.c | 2 +- tools/quake3/q3map2/convert_bsp.c | 2 +- tools/quake3/q3map2/convert_obj.c | 6 +++--- tools/quake3/q3map2/image.c | 2 +- tools/quake3/q3map2/light.c | 2 +- tools/quake3/q3map2/light_ydnar.c | 2 +- tools/quake3/q3map2/shaders.c | 2 +- tools/quake3/q3map2/surface.c | 2 +- 15 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tools/quake2/q2map/brushbsp.c b/tools/quake2/q2map/brushbsp.c index 022db653..1be89836 100644 --- a/tools/quake2/q2map/brushbsp.c +++ b/tools/quake2/q2map/brushbsp.c @@ -1293,7 +1293,7 @@ tree_t *BrushBSP( bspbrush_t *brushlist, vec3_t mins, vec3_t maxs ){ volume = BrushVolume( b ); if ( volume < microvolume ) { - Sys_Printf( "WARNING: entity %i, brush %i: microbrush\n", + Sys_FPrintf( SYS_WRN, "WARNING: entity %i, brush %i: microbrush\n", b->original->entitynum, b->original->brushnum ); } diff --git a/tools/quake2/q2map/faces.c b/tools/quake2/q2map/faces.c index 7607dbc2..1675a61b 100644 --- a/tools/quake2/q2map/faces.c +++ b/tools/quake2/q2map/faces.c @@ -653,7 +653,7 @@ int GetEdge2( int v1, int v2, face_t *f ){ } #if 0 if ( v1 == edge->v[0] && v2 == edge->v[1] ) { - Sys_Printf( "WARNING: multiple forward edge\n" ); + Sys_FPrintf( SYS_WRN, "WARNING: multiple forward edge\n" ); return i; } #endif diff --git a/tools/quake2/q2map/lightmap.c b/tools/quake2/q2map/lightmap.c index 70c04585..0e763603 100644 --- a/tools/quake2/q2map/lightmap.c +++ b/tools/quake2/q2map/lightmap.c @@ -874,7 +874,7 @@ void CreateDirectLights( void ){ if ( target[0] ) { // point towards target e2 = FindTargetEntity( target ); if ( !e2 ) { - Sys_Printf( "WARNING: light at (%i %i %i) has missing target\n", + Sys_FPrintf( SYS_WRN, "WARNING: light at (%i %i %i) has missing target\n", (int)dl->origin[0], (int)dl->origin[1], (int)dl->origin[2] ); } else diff --git a/tools/quake2/q2map/main.c b/tools/quake2/q2map/main.c index 4eb3f393..c335dd34 100644 --- a/tools/quake2/q2map/main.c +++ b/tools/quake2/q2map/main.c @@ -649,7 +649,7 @@ int main( int argc, char **argv ){ Sys_Printf( "Game: %s\n", game ); if ( !do_info && !do_bsp && !do_vis && !do_rad ) { - Sys_Printf( "ERROR: -bsp, -vis, -light, nor -info specified.\nWhat to you want me to do?\n\n" ); + Sys_FPrintf( SYS_ERR, "ERROR: -bsp, -vis, -light, nor -info specified.\nWhat to you want me to do?\n\n" ); } else { diff --git a/tools/quake2/q2map/portals.c b/tools/quake2/q2map/portals.c index 1c83d75d..b26c75f9 100644 --- a/tools/quake2/q2map/portals.c +++ b/tools/quake2/q2map/portals.c @@ -554,13 +554,13 @@ void MakeTreePortals_r( node_t *node ){ CalcNodeBounds( node ); if ( node->mins[0] >= node->maxs[0] ) { - Sys_Printf( "WARNING: node without a volume\n" ); + Sys_FPrintf( SYS_WRN, "WARNING: node without a volume\n" ); } for ( i = 0 ; i < 3 ; i++ ) { if ( node->mins[i] < -8000 || node->maxs[i] > 8000 ) { - Sys_Printf( "WARNING: node with unbounded volume\n" ); + Sys_FPrintf( SYS_WRN, "WARNING: node with unbounded volume\n" ); break; } } @@ -756,7 +756,7 @@ void FloodAreas_r( node_t *node ){ // note the current area as bounding the portal if ( e->portalareas[1] ) { - Sys_Printf( "WARNING: areaportal entity %i touches > 2 areas\n", b->original->entitynum ); + Sys_FPrintf( SYS_WRN, "WARNING: areaportal entity %i touches > 2 areas\n", b->original->entitynum ); return; } if ( e->portalareas[0] ) { @@ -854,7 +854,7 @@ void SetAreaPortalAreas_r( node_t *node ){ e = &entities[b->original->entitynum]; node->area = e->portalareas[0]; if ( !e->portalareas[1] ) { - Sys_Printf( "WARNING: areaportal entity %i doesn't touch two areas\n", b->original->entitynum ); + Sys_FPrintf( SYS_WRN, "WARNING: areaportal entity %i doesn't touch two areas\n", b->original->entitynum ); return; } } diff --git a/tools/quake2/q2map/qvis.c b/tools/quake2/q2map/qvis.c index 72e7a46e..f942d1c4 100644 --- a/tools/quake2/q2map/qvis.c +++ b/tools/quake2/q2map/qvis.c @@ -209,7 +209,7 @@ void ClusterMerge( int leafnum ){ 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 ) ); diff --git a/tools/quake3/common/aselib.c b/tools/quake3/common/aselib.c index 6b92d035..7b0085d2 100644 --- a/tools/quake3/common/aselib.c +++ b/tools/quake3/common/aselib.c @@ -472,7 +472,7 @@ static void ASE_KeyMAP_DIFFUSE( const char *token ){ else { sprintf( ase.materials[ase.numMaterials].name, "(not converted: '%s')", bitmap ); - Sys_Printf( "WARNING: illegal material name '%s'\n", bitmap ); + Sys_FPrintf( SYS_WRN, "WARNING: illegal material name '%s'\n", bitmap ); } } else diff --git a/tools/quake3/q3map2/convert_ase.c b/tools/quake3/q3map2/convert_ase.c index 8712c16f..1b0be1ec 100644 --- a/tools/quake3/q3map2/convert_ase.c +++ b/tools/quake3/q3map2/convert_ase.c @@ -169,7 +169,7 @@ static void ConvertSurface( FILE *f, bspModel_t *model, int modelNum, bspDrawSur fprintf( f, "\t*MATERIAL_REF\t%d\r\n", ds->lightmapNum[0] + deluxemap ); } else{ - Sys_Printf( "WARNING: lightmap %d out of range, not exporting\n", ds->lightmapNum[0] + deluxemap ); + Sys_FPrintf( SYS_WRN, "WARNING: lightmap %d out of range, not exporting\n", ds->lightmapNum[0] + deluxemap ); } } else{ diff --git a/tools/quake3/q3map2/convert_bsp.c b/tools/quake3/q3map2/convert_bsp.c index ac627031..b7dfeffd 100644 --- a/tools/quake3/q3map2/convert_bsp.c +++ b/tools/quake3/q3map2/convert_bsp.c @@ -234,7 +234,7 @@ int ConvertBSPMain( int argc, char **argv ){ if ( force_map || ( !force_bsp && !Q_stricmp( ext, "map" ) && map_allowed ) ) { if ( !map_allowed ) { - Sys_Printf( "WARNING: the requested conversion should not be done from .map files. Compile a .bsp first.\n" ); + Sys_FPrintf( SYS_WRN, "WARNING: the requested conversion should not be done from .map files. Compile a .bsp first.\n" ); } StripExtension( source ); DefaultExtension( source, ".map" ); diff --git a/tools/quake3/q3map2/convert_obj.c b/tools/quake3/q3map2/convert_obj.c index 64b6dcef..7415eebf 100644 --- a/tools/quake3/q3map2/convert_obj.c +++ b/tools/quake3/q3map2/convert_obj.c @@ -76,11 +76,11 @@ static void ConvertSurfaceToOBJ( FILE *f, bspModel_t *model, int modelNum, bspDr objLastShaderNum = ds->lightmapNum[0] + deluxemap; } if ( ds->lightmapNum[0] + (int)deluxemap < firstLightmap ) { - Sys_Printf( "WARNING: lightmap %d out of range (exporting anyway)\n", ds->lightmapNum[0] + deluxemap ); + Sys_FPrintf( SYS_WRN, "WARNING: lightmap %d out of range (exporting anyway)\n", ds->lightmapNum[0] + deluxemap ); firstLightmap = ds->lightmapNum[0] + deluxemap; } if ( ds->lightmapNum[0] > lastLightmap ) { - Sys_Printf( "WARNING: lightmap %d out of range (exporting anyway)\n", ds->lightmapNum[0] + deluxemap ); + Sys_FPrintf( SYS_WRN, "WARNING: lightmap %d out of range (exporting anyway)\n", ds->lightmapNum[0] + deluxemap ); lastLightmap = ds->lightmapNum[0] + deluxemap; } } @@ -160,7 +160,7 @@ static void ConvertShaderToMTL( FILE *f, bspShader_t *shader, int shaderNum ){ /* get shader */ si = ShaderInfoForShader( shader->shader ); if ( si == NULL ) { - Sys_Printf( "WARNING: NULL shader in BSP\n" ); + Sys_FPrintf( SYS_WRN, "WARNING: NULL shader in BSP\n" ); return; } diff --git a/tools/quake3/q3map2/image.c b/tools/quake3/q3map2/image.c index 2f1ef5f1..16c3304a 100644 --- a/tools/quake3/q3map2/image.c +++ b/tools/quake3/q3map2/image.c @@ -474,7 +474,7 @@ image_t *ImageLoad( const char *filename ){ if ( LoadJPGBuff( buffer, size, &pixels, &width, &height ) == -1 ) { if (pixels) { // On error, LoadJPGBuff might store a pointer to the error message in pixels - Sys_Printf( "WARNING: LoadJPGBuff %s %s\n", name, (unsigned char*) pixels ); + Sys_FPrintf( SYS_WRN, "WARNING: LoadJPGBuff %s %s\n", name, (unsigned char*) pixels ); } } else { if ( width == image->width && height == image->height ) { diff --git a/tools/quake3/q3map2/light.c b/tools/quake3/q3map2/light.c index 6e018159..14a69ae8 100644 --- a/tools/quake3/q3map2/light.c +++ b/tools/quake3/q3map2/light.c @@ -2883,7 +2883,7 @@ int LightMain( int argc, char **argv ){ /* unhandled args */ else { - Sys_Printf( "WARNING: Unknown argument \"%s\"\n", argv[ i ] ); + Sys_FPrintf( SYS_WRN, "WARNING: Unknown argument \"%s\"\n", argv[ i ] ); } } diff --git a/tools/quake3/q3map2/light_ydnar.c b/tools/quake3/q3map2/light_ydnar.c index 653607b5..1edff9e3 100644 --- a/tools/quake3/q3map2/light_ydnar.c +++ b/tools/quake3/q3map2/light_ydnar.c @@ -3794,7 +3794,7 @@ void SetupEnvelopes( qboolean forGrid, qboolean fastFlag ){ for ( i = 0; i < 3; i++ ) { if ( mins[ i ] > light->origin[ i ] || maxs[ i ] < light->origin[ i ] ) { - //% Sys_Printf( "WARNING: Light PVS bounds (%.0f, %.0f, %.0f) -> (%.0f, %.0f, %.0f)\ndo not encompass light %d (%f, %f, %f)\n", + //% Sys_FPrintf( SYS_WRN, "WARNING: Light PVS bounds (%.0f, %.0f, %.0f) -> (%.0f, %.0f, %.0f)\ndo not encompass light %d (%f, %f, %f)\n", //% mins[ 0 ], mins[ 1 ], mins[ 2 ], //% maxs[ 0 ], maxs[ 1 ], maxs[ 2 ], //% numLights, light->origin[ 0 ], light->origin[ 1 ], light->origin[ 2 ] ); diff --git a/tools/quake3/q3map2/shaders.c b/tools/quake3/q3map2/shaders.c index 18d3db2e..923fe8a4 100644 --- a/tools/quake3/q3map2/shaders.c +++ b/tools/quake3/q3map2/shaders.c @@ -861,7 +861,7 @@ shaderInfo_t *ShaderInfoForShader( const char *shaderName ){ /* increase deprecation depth */ deprecationDepth++; if ( deprecationDepth == MAX_SHADER_DEPRECATION_DEPTH ) { - Sys_Printf( "WARNING: Max deprecation depth of %i is reached on shader '%s'\n", MAX_SHADER_DEPRECATION_DEPTH, shader ); + Sys_FPrintf( SYS_WRN, "WARNING: Max deprecation depth of %i is reached on shader '%s'\n", MAX_SHADER_DEPRECATION_DEPTH, shader ); } /* search again from beginning */ i = -1; diff --git a/tools/quake3/q3map2/surface.c b/tools/quake3/q3map2/surface.c index 04088711..3dcf5f55 100644 --- a/tools/quake3/q3map2/surface.c +++ b/tools/quake3/q3map2/surface.c @@ -2124,7 +2124,7 @@ int FilterWindingIntoTree_r( winding_t *w, mapDrawSurface_t *ds, node_t *node ){ si->mins[ 2 ] != 0.0f || si->maxs[ 2 ] != 0.0f ) ) { static qboolean warned = qfalse; if ( !warned ) { - Sys_Printf( "WARNING: this map uses the deformVertexes move hack\n" ); + Sys_FPrintf( SYS_WRN, "WARNING: this map uses the deformVertexes move hack\n" ); warned = qtrue; } -- 2.39.2