From c5ced679f45d37d34d4aab2e7fe80f3f3ad62bd8 Mon Sep 17 00:00:00 2001 From: Garux Date: Mon, 6 Oct 2025 23:31:01 +0500 Subject: [PATCH] more Quoted use --- contrib/prtview/prtview.cpp | 2 +- plugins/mapxml/xmlparse.cpp | 2 +- plugins/shaders/shaders.cpp | 2 +- radiant/referencecache.cpp | 14 +++++++------- radiant/textures.cpp | 8 ++++---- tools/quake3/q3map2/bspfile_abstract.cpp | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/contrib/prtview/prtview.cpp b/contrib/prtview/prtview.cpp index 2d8e5c9f..0e588937 100644 --- a/contrib/prtview/prtview.cpp +++ b/contrib/prtview/prtview.cpp @@ -195,7 +195,7 @@ const char* QERPlug_GetCommandTitleList(){ void QERPlug_Dispatch( const char* p, float* vMin, float* vMax, bool bSingleBrush ){ - globalOutputStream() << MSG_PREFIX "Command \"" << p << "\"\n"; + globalOutputStream() << MSG_PREFIX "Command " << Quoted( p ) << '\n'; if ( !strcmp( p, Q3R_CMD_ABOUT ) ) { DoAboutDlg(); diff --git a/plugins/mapxml/xmlparse.cpp b/plugins/mapxml/xmlparse.cpp index 7e4367b8..f73a52d0 100644 --- a/plugins/mapxml/xmlparse.cpp +++ b/plugins/mapxml/xmlparse.cpp @@ -55,7 +55,7 @@ scene::Node& createPrimitive( const char* name ){ return GlobalPatchCreator().createPatch(); } - ASSERT_MESSAGE( 0, PARSE_ERROR << ": primitive type not supported: \"" << name << "\"\n" ); + ASSERT_MESSAGE( 0, PARSE_ERROR << ": primitive type not supported: " << Quoted( name ) << '\n' ); scene::Node* node = 0; return *node; } diff --git a/plugins/shaders/shaders.cpp b/plugins/shaders/shaders.cpp index b016543e..80af4a40 100644 --- a/plugins/shaders/shaders.cpp +++ b/plugins/shaders/shaders.cpp @@ -1566,7 +1566,7 @@ void ShaderList_addShaderFile( const char* dirstring ){ { if ( string_equal_nocase( dirstring, sh.c_str() ) ) { found = true; - globalOutputStream() << "duplicate entry \"" << sh << "\" in shaderlist.txt\n"; + globalOutputStream() << "duplicate entry " << Quoted( sh ) << " in shaderlist.txt\n"; break; } } diff --git a/radiant/referencecache.cpp b/radiant/referencecache.cpp index 29bb3148..aff5d734 100644 --- a/radiant/referencecache.cpp +++ b/radiant/referencecache.cpp @@ -172,7 +172,7 @@ ModelLoader* ModelLoader_forType( const char* type ){ } else { - globalErrorStream() << "ERROR: Model type incorrectly registered: \"" << moduleName << "\"\n"; + globalErrorStream() << "ERROR: Model type incorrectly registered: " << Quoted( moduleName ) << '\n'; return &g_NullModelLoader; } } @@ -188,13 +188,13 @@ NodeSmartReference ModelResource_load( ModelLoader* loader, const char* name ){ ArchiveFile* file = GlobalFileSystem().openFile( name ); if ( file != 0 ) { - globalOutputStream() << "Loaded Model: \"" << name << "\"\n"; + globalOutputStream() << "Loaded Model: " << Quoted( name ) << '\n'; model = loader->loadModel( *file ); file->release(); } else { - globalErrorStream() << "Model load failed: \"" << name << "\"\n"; + globalErrorStream() << "Model load failed: " << Quoted( name ) << '\n'; } } @@ -290,14 +290,14 @@ NodeSmartReference Model_load( ModelLoader* loader, const char* path, const char } else { - globalErrorStream() << "ERROR: Map type incorrectly registered: \"" << moduleName << "\"\n"; + globalErrorStream() << "ERROR: Map type incorrectly registered: " << Quoted( moduleName ) << '\n'; return g_nullModel; } } else { if ( string_not_empty( type ) ) { - globalErrorStream() << "Model type not supported: \"" << name << "\"\n"; + globalErrorStream() << "Model type not supported: " << Quoted( name ) << '\n'; } return g_nullModel; } @@ -556,12 +556,12 @@ public: } Resource* capture( const char* path ) override { - //globalOutputStream() << "capture: \"" << path << "\"\n"; + //globalOutputStream() << "capture: " << Quoted( path ) << '\n'; return m_references.capture( CopiedString( path ) ).get(); } void release( const char* path ) override { m_references.release( CopiedString( path ) ); - //globalOutputStream() << "release: \"" << path << "\"\n"; + //globalOutputStream() << "release: " << Quoted( path ) << '\n'; } void setEntityCreator( EntityCreator& entityCreator ) override { diff --git a/radiant/textures.cpp b/radiant/textures.cpp index 1b4db8eb..3ea8f1ad 100644 --- a/radiant/textures.cpp +++ b/radiant/textures.cpp @@ -342,12 +342,12 @@ void qtexture_realise( qtexture_t& texture, const TextureKey& key ){ texture.contentFlags = image->getContentFlags(); texture.value = image->getValue(); image->release(); - globalOutputStream() << "Loaded Texture: \"" << key.second << "\"\n"; + globalOutputStream() << "Loaded Texture: " << Quoted( key.second ) << '\n'; GlobalOpenGL_debugAssertNoErrors(); } else { - globalErrorStream() << "Texture load failed: \"" << key.second << "\"\n"; + globalErrorStream() << "Texture load failed: " << Quoted( key.second ) << '\n'; } } else { @@ -386,12 +386,12 @@ void qtexture_realise( qtexture_t& texture, const TextureKey& key ){ } gl().glBindTexture( GL_TEXTURE_CUBE_MAP, 0 ); - globalOutputStream() << "Loaded Skybox: \"" << key.second << "\"\n"; + globalOutputStream() << "Loaded Skybox: " << Quoted( key.second ) << '\n'; GlobalOpenGL_debugAssertNoErrors(); } else { - globalErrorStream() << "Skybox load failed: \"" << key.second << "\"\n"; + globalErrorStream() << "Skybox load failed: " << Quoted( key.second ) << '\n'; } std::for_each_n( images, std::size( images ), []( Image *img ){ if( img != nullptr ) img->release(); } ); diff --git a/tools/quake3/q3map2/bspfile_abstract.cpp b/tools/quake3/q3map2/bspfile_abstract.cpp index 423ddc57..7c0ccc10 100644 --- a/tools/quake3/q3map2/bspfile_abstract.cpp +++ b/tools/quake3/q3map2/bspfile_abstract.cpp @@ -481,7 +481,7 @@ void UnparseEntities(){ for ( const auto& ep : e.epairs ) { /* copy and clean */ - data << '\"' << StripTrailing( ep.key.c_str() ) << "\" \"" << StripTrailing( ep.value.c_str() ) << "\"\n"; + data << Quoted( StripTrailing( ep.key.c_str() ) ) << ' ' << Quoted( StripTrailing( ep.value.c_str() ) ) << '\n'; } /* add trailing brace */