From 6e8079cc93ac51b049fcd85e3976a676e2d86f75 Mon Sep 17 00:00:00 2001 From: Garux Date: Sun, 14 Sep 2025 03:55:34 +0500 Subject: [PATCH] minor tweaks --- libs/render.h | 2 +- plugins/mapq3/parse.cpp | 2 +- radiant/eclass_def.cpp | 2 +- radiant/stacktrace.cpp | 2 +- tools/quake3/common/threads.cpp | 4 ++-- tools/quake3/q3map2/bspfile_abstract.cpp | 2 +- tools/quake3/q3map2/light_trace.cpp | 2 +- tools/quake3/q3map2/map.cpp | 2 +- tools/quake3/q3map2/portals.cpp | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libs/render.h b/libs/render.h index b287e7e5..c826acc5 100644 --- a/libs/render.h +++ b/libs/render.h @@ -173,7 +173,7 @@ class UniqueVertexBuffer RenderIndex find_or_insert( const Vertex& vertex ){ RenderIndex index = 0; - while ( 1 ) + while ( true ) { if ( vertex < m_data[index] ) { bnode& node = m_btree[index]; diff --git a/plugins/mapq3/parse.cpp b/plugins/mapq3/parse.cpp index 0113a4d4..dec7fcae 100644 --- a/plugins/mapq3/parse.cpp +++ b/plugins/mapq3/parse.cpp @@ -150,7 +150,7 @@ NodeSmartReference Entity_parseTokens( Tokeniser& tokeniser, EntityCreator& enti const char* classname = ""; int count_primitives = 0; - while ( 1 ) + while ( true ) { tokeniser.nextLine(); const char* token; diff --git a/radiant/eclass_def.cpp b/radiant/eclass_def.cpp index 919ee504..363cbe58 100644 --- a/radiant/eclass_def.cpp +++ b/radiant/eclass_def.cpp @@ -117,7 +117,7 @@ skipwhite: } com_token[len] = c; len++; - } while ( 1 ); + } while ( true ); } // parse single characters diff --git a/radiant/stacktrace.cpp b/radiant/stacktrace.cpp index 062d3721..f3ff2913 100644 --- a/radiant/stacktrace.cpp +++ b/radiant/stacktrace.cpp @@ -210,7 +210,7 @@ void write_stack_trace( PCONTEXT pContext, TextOutputStream& outputStream ){ const unsigned int max_sym_name = 1024; // should be enough - while ( 1 ) + while ( true ) { // Get the next stack frame if ( !StackWalk64( dwMachineType, diff --git a/tools/quake3/common/threads.cpp b/tools/quake3/common/threads.cpp index a263adce..c292ee8f 100644 --- a/tools/quake3/common/threads.cpp +++ b/tools/quake3/common/threads.cpp @@ -76,7 +76,7 @@ int GetThreadWork(){ void ( *workfunction )( int ); void ThreadWorkerFunction( int threadnum ){ - while ( 1 ) + while ( true ) { const int work = GetThreadWork(); if ( work == -1 ) { @@ -512,7 +512,7 @@ void ThreadLock(){ } else { - while ( 1 ) + while ( true ) { pthread_cond_wait( &pt_mutex->cond, &pt_mutex->a_mutex ); if ( ( !pt_mutex->owner ) && ( pt_mutex->lock == 0 ) ) { diff --git a/tools/quake3/q3map2/bspfile_abstract.cpp b/tools/quake3/q3map2/bspfile_abstract.cpp index 120a88c6..eae757ef 100644 --- a/tools/quake3/q3map2/bspfile_abstract.cpp +++ b/tools/quake3/q3map2/bspfile_abstract.cpp @@ -389,7 +389,7 @@ static bool ParseEntity(){ entity_t& e = entities.emplace_back(); /* parse */ - while ( 1 ) + while ( true ) { if ( !GetToken( true ) ) { Error( "ParseEntity: EOF without closing brace" ); diff --git a/tools/quake3/q3map2/light_trace.cpp b/tools/quake3/q3map2/light_trace.cpp index 15a7d127..439c2e28 100644 --- a/tools/quake3/q3map2/light_trace.cpp +++ b/tools/quake3/q3map2/light_trace.cpp @@ -1474,7 +1474,7 @@ static bool TraceLine_r( int nodeNum, const Vector3& origin, const Vector3& end, #if TRACELINE_R_HALF_ITERATIVE Vector3 origin( start ); - while ( 1 ) + while ( true ) #endif { /* bogus node number means solid, end tracing unless testing all */ diff --git a/tools/quake3/q3map2/map.cpp b/tools/quake3/q3map2/map.cpp index 1e34c4f0..fed3530a 100644 --- a/tools/quake3/q3map2/map.cpp +++ b/tools/quake3/q3map2/map.cpp @@ -1486,7 +1486,7 @@ static bool ParseMapEntity( bool onlyLights, bool noCollapseGroups, int mapEntit mapEnt.mapEntityNum = mapEntityNum; /* loop */ - while ( 1 ) + while ( true ) { /* get initial token */ if ( !GetToken( true ) ) { diff --git a/tools/quake3/q3map2/portals.cpp b/tools/quake3/q3map2/portals.cpp index 48c4fe5a..12fc970a 100644 --- a/tools/quake3/q3map2/portals.cpp +++ b/tools/quake3/q3map2/portals.cpp @@ -99,7 +99,7 @@ void RemovePortalFromNode( portal_t *portal, node_t *l ){ // remove reference to the current portal pp = &l->portals; - while ( 1 ) + while ( true ) { t = *pp; if ( !t ) {