From d7c9a5ea709a5e2e6d17638ef4104440f9949be7 Mon Sep 17 00:00:00 2001 From: Garux Date: Mon, 8 Sep 2025 01:54:40 +0500 Subject: [PATCH] minor cleanup --- contrib/bobtoolz/DBobView.h | 2 +- contrib/bobtoolz/DBrush.h | 4 ++-- contrib/bobtoolz/DEntity.cpp | 2 +- contrib/bobtoolz/DEntity.h | 4 ++-- contrib/bobtoolz/DMap.h | 2 +- contrib/bobtoolz/DPatch.h | 2 +- contrib/bobtoolz/DPlane.h | 2 +- contrib/bobtoolz/DPoint.h | 2 +- contrib/bobtoolz/DShape.h | 2 +- contrib/bobtoolz/DTrainDrawer.cpp | 2 +- contrib/bobtoolz/DTrainDrawer.h | 2 +- contrib/bobtoolz/DTreePlanter.h | 2 +- contrib/bobtoolz/DVisDrawer.h | 2 +- contrib/bobtoolz/DWinding.h | 2 +- contrib/bobtoolz/ScriptParser.cpp | 18 +++++++++--------- contrib/bobtoolz/ScriptParser.h | 18 +++++++++--------- contrib/bobtoolz/bobToolz-GTK.cpp | 2 +- contrib/bobtoolz/bsploader.cpp | 2 +- contrib/brushexport/export.cpp | 12 ++++-------- contrib/brushexport/plugin.cpp | 4 ++-- contrib/ufoaiplug/ufoai.cpp | 2 +- contrib/ufoaiplug/ufoai_filters.cpp | 8 ++++---- contrib/ufoaiplug/ufoai_filters.h | 8 ++++---- contrib/ufoaiplug/ufoai_gtk.cpp | 4 ++-- contrib/ufoaiplug/ufoai_gtk.h | 4 ++-- 25 files changed, 55 insertions(+), 59 deletions(-) diff --git a/contrib/bobtoolz/DBobView.h b/contrib/bobtoolz/DBobView.h index 3b684298..c927f990 100644 --- a/contrib/bobtoolz/DBobView.h +++ b/contrib/bobtoolz/DBobView.h @@ -36,7 +36,7 @@ class DBobView : public Renderable, public OpenGLRenderable, public Entity::Obse Shader* m_shader_box; public: DBobView(); - virtual ~DBobView(); + ~DBobView(); protected: std::unique_ptr path; diff --git a/contrib/bobtoolz/DBrush.h b/contrib/bobtoolz/DBrush.h index 06e17505..543e6ec6 100644 --- a/contrib/bobtoolz/DBrush.h +++ b/contrib/bobtoolz/DBrush.h @@ -79,7 +79,7 @@ public: void ClearFaces(); void ClearPoints(); - int RemoveRedundantPlanes( void ); + int RemoveRedundantPlanes(); void RemovePlane( DPlane* plane ); int PointPosition( vec3_t pnt ); @@ -94,7 +94,7 @@ public: DBrush(); DBrush( DBrush&& ) noexcept = delete; - virtual ~DBrush(); + ~DBrush(); bool operator==( const DBrush* other ) const; diff --git a/contrib/bobtoolz/DEntity.cpp b/contrib/bobtoolz/DEntity.cpp index 5125140c..a6cfd042 100644 --- a/contrib/bobtoolz/DEntity.cpp +++ b/contrib/bobtoolz/DEntity.cpp @@ -550,7 +550,7 @@ void DEntity::SpawnVector( const char* key, const char* defaultstring, vec_t* ou } } -int DEntity::GetBrushCount( void ) { +int DEntity::GetBrushCount() { return static_cast( brushList.size() ); } diff --git a/contrib/bobtoolz/DEntity.h b/contrib/bobtoolz/DEntity.h index e7934fc9..7d41491c 100644 --- a/contrib/bobtoolz/DEntity.h +++ b/contrib/bobtoolz/DEntity.h @@ -49,7 +49,7 @@ public: // Constrcution/Destruction DEntity( const char* classname = "worldspawn", int ID = -1 ); // sets classname - virtual ~DEntity(); + ~DEntity(); // --------------------------------------------- // epair functions........ @@ -68,7 +68,7 @@ public: void ResetChecks( const std::vector& exclusionList ); void RemoveNonCheckBrushes( const std::vector& exclusionList ); - int GetBrushCount( void ); + int GetBrushCount(); DBrush* FindBrushByPointer( scene::Node& brush ); // --------------------------------------------- diff --git a/contrib/bobtoolz/DMap.h b/contrib/bobtoolz/DMap.h index 5852636c..b6085f8e 100644 --- a/contrib/bobtoolz/DMap.h +++ b/contrib/bobtoolz/DMap.h @@ -53,7 +53,7 @@ public: std::list entityList; DMap(); - virtual ~DMap(); + ~DMap(); int FixBrushes(); }; diff --git a/contrib/bobtoolz/DPatch.h b/contrib/bobtoolz/DPatch.h index 3791f9d5..28b5fb9c 100644 --- a/contrib/bobtoolz/DPatch.h +++ b/contrib/bobtoolz/DPatch.h @@ -73,6 +73,6 @@ public: int width, height; drawVert_t points[MAX_PATCH_WIDTH][MAX_PATCH_HEIGHT]; DPatch(); - virtual ~DPatch(); + ~DPatch(); }; diff --git a/contrib/bobtoolz/DPlane.h b/contrib/bobtoolz/DPlane.h index 5a7da8f5..c6a57806 100644 --- a/contrib/bobtoolz/DPlane.h +++ b/contrib/bobtoolz/DPlane.h @@ -51,7 +51,7 @@ public: DPlane( const vec3_t va, const vec3_t vb, const vec3_t vc, const _QERFaceData* texData ); DPlane() = default; - virtual ~DPlane(); + ~DPlane(); bool m_bChkOk; _QERFaceData texInfo; diff --git a/contrib/bobtoolz/DPoint.h b/contrib/bobtoolz/DPoint.h index b6f61497..91fdb0b1 100644 --- a/contrib/bobtoolz/DPoint.h +++ b/contrib/bobtoolz/DPoint.h @@ -29,7 +29,7 @@ class DPoint { public: DPoint(); - virtual ~DPoint(); + ~DPoint(); bool operator ==( vec3_t other ); diff --git a/contrib/bobtoolz/DShape.h b/contrib/bobtoolz/DShape.h index e0858351..4dcac1bf 100644 --- a/contrib/bobtoolz/DShape.h +++ b/contrib/bobtoolz/DShape.h @@ -46,7 +46,7 @@ public: static DBrush* GetBoundingCube_Ext( vec3_t min, vec3_t max, const char* textureName, bool* bUseFaces = bFacesAll, bool detail = false ); DShape(); - virtual ~DShape(); + ~DShape(); void Commit(); private: diff --git a/contrib/bobtoolz/DTrainDrawer.cpp b/contrib/bobtoolz/DTrainDrawer.cpp index 18d5f687..045cd780 100644 --- a/contrib/bobtoolz/DTrainDrawer.cpp +++ b/contrib/bobtoolz/DTrainDrawer.cpp @@ -46,7 +46,7 @@ DTrainDrawer::DTrainDrawer() { GlobalShaderCache().attachRenderable( *this ); } -DTrainDrawer::~DTrainDrawer( void ) { +DTrainDrawer::~DTrainDrawer() { GlobalShaderCache().detachRenderable( *this ); destroyShaders(); diff --git a/contrib/bobtoolz/DTrainDrawer.h b/contrib/bobtoolz/DTrainDrawer.h index e530ec93..54e295fe 100644 --- a/contrib/bobtoolz/DTrainDrawer.h +++ b/contrib/bobtoolz/DTrainDrawer.h @@ -62,7 +62,7 @@ private: public: DTrainDrawer(); - virtual ~DTrainDrawer( void ); + ~DTrainDrawer(); void render( RenderStateFlags state ) const override; void renderSolid( Renderer& renderer, const VolumeTest& volume ) const override; diff --git a/contrib/bobtoolz/DTreePlanter.h b/contrib/bobtoolz/DTreePlanter.h index 12dcc8df..8ffef4e3 100644 --- a/contrib/bobtoolz/DTreePlanter.h +++ b/contrib/bobtoolz/DTreePlanter.h @@ -85,7 +85,7 @@ public: m_destroyed = GlobalRadiant().XYWindowDestroyed_connect( makeSignalHandler( DestroyedCaller(), *this ) ); } - virtual ~DTreePlanter(){ + ~DTreePlanter(){ if ( !m_mouseDown.isNull() ) { GlobalRadiant().XYWindowMouseDown_disconnect( m_mouseDown ); } diff --git a/contrib/bobtoolz/DVisDrawer.h b/contrib/bobtoolz/DVisDrawer.h index 688e4791..5434acd4 100644 --- a/contrib/bobtoolz/DVisDrawer.h +++ b/contrib/bobtoolz/DVisDrawer.h @@ -66,7 +66,7 @@ class DVisDrawer : public Renderable, public OpenGLRenderable bool m_colorPerSurf; public: DVisDrawer(); - virtual ~DVisDrawer(); + ~DVisDrawer(); void ClearPoints(); private: diff --git a/contrib/bobtoolz/DWinding.h b/contrib/bobtoolz/DWinding.h index cd22695d..935d3df6 100644 --- a/contrib/bobtoolz/DWinding.h +++ b/contrib/bobtoolz/DWinding.h @@ -33,7 +33,7 @@ public: DWinding(); DWinding( DWinding&& other ) noexcept; DWinding& operator=( DWinding&& other ) noexcept; - virtual ~DWinding(); + ~DWinding(); void AllocWinding( int points ); diff --git a/contrib/bobtoolz/ScriptParser.cpp b/contrib/bobtoolz/ScriptParser.cpp index c48c64cc..effa6459 100644 --- a/contrib/bobtoolz/ScriptParser.cpp +++ b/contrib/bobtoolz/ScriptParser.cpp @@ -20,7 +20,7 @@ #include "ScriptParser.h" #include -CScriptParser::CScriptParser( void ) : +CScriptParser::CScriptParser() : m_pScript( NULL ), m_pScriptSection( NULL ), m_pLastScriptSection( NULL ), @@ -28,11 +28,11 @@ CScriptParser::CScriptParser( void ) : ClearBuffer(); } -CScriptParser::~CScriptParser( void ) { +CScriptParser::~CScriptParser() { ClearBuffer(); } -void CScriptParser::ClearBuffer( void ) { +void CScriptParser::ClearBuffer() { if ( m_pScript ) { delete[] m_pScript; m_pScript = NULL; @@ -171,7 +171,7 @@ void CScriptParser::SkipWhitespace( bool* pbNewLines ) { } } -void CScriptParser::SkipBracedSection( void ) { +void CScriptParser::SkipBracedSection() { const char *token; int depth; @@ -189,7 +189,7 @@ void CScriptParser::SkipBracedSection( void ) { } while ( depth && *m_pScriptSection ); } -void CScriptParser::SkipRestOfLine( void ) { +void CScriptParser::SkipRestOfLine() { char *p; int c; @@ -202,7 +202,7 @@ void CScriptParser::SkipRestOfLine( void ) { m_pScriptSection = p; } -void CScriptParser::UndoGetToken( void ) { +void CScriptParser::UndoGetToken() { if ( !m_pLastScriptSection ) { return; } @@ -210,7 +210,7 @@ void CScriptParser::UndoGetToken( void ) { m_pLastScriptSection = NULL; } -void CScriptParser::ResetParseSession( void ) { +void CScriptParser::ResetParseSession() { if ( !m_pScript ) { return; } @@ -219,7 +219,7 @@ void CScriptParser::ResetParseSession( void ) { m_pLastScriptSection = NULL; } -char* CScriptParser::GetBufferCopy( void ) { +char* CScriptParser::GetBufferCopy() { if ( !m_pScript ) { return NULL; } @@ -230,7 +230,7 @@ char* CScriptParser::GetBufferCopy( void ) { return pBuffer; } -int CScriptParser::GetTokenOffset( void ) { +int CScriptParser::GetTokenOffset() { if ( !m_pScript || !m_pScriptSection ) { return 0; } diff --git a/contrib/bobtoolz/ScriptParser.h b/contrib/bobtoolz/ScriptParser.h index 687887b4..75eb0191 100644 --- a/contrib/bobtoolz/ScriptParser.h +++ b/contrib/bobtoolz/ScriptParser.h @@ -27,8 +27,8 @@ class CScriptParser //: public IScriptParser { public: - CScriptParser( void ); - ~CScriptParser( void ); + CScriptParser(); + ~CScriptParser(); private: char m_breakChars[SP_MAX_BREAKCHARS]; char* m_pScript; @@ -37,18 +37,18 @@ private: char* m_pToken; void SkipWhitespace( bool* pbNewLines ); - void ClearBuffer( void ); + void ClearBuffer(); const char* MakeToken( const char* pToken ); bool IsBreakChar( char c ); public: const char* GetToken( bool bAllowLinebreaks ); - void SkipBracedSection( void ); - void SkipRestOfLine( void ); - void UndoGetToken( void ); - void ResetParseSession( void ); + void SkipBracedSection(); + void SkipRestOfLine(); + void UndoGetToken(); + void ResetParseSession(); - char* GetBufferCopy( void ); - int GetTokenOffset( void ); + char* GetBufferCopy(); + int GetTokenOffset(); void LoadScript( const char* pScript ); void SetScript( char* pScript ); diff --git a/contrib/bobtoolz/bobToolz-GTK.cpp b/contrib/bobtoolz/bobToolz-GTK.cpp index 77307568..6e5a3e67 100644 --- a/contrib/bobtoolz/bobToolz-GTK.cpp +++ b/contrib/bobtoolz/bobToolz-GTK.cpp @@ -183,7 +183,7 @@ const char* QERPlug_GetCommandTitleList(){ #define NUM_TOOLBARBUTTONS 13 -std::size_t ToolbarButtonCount( void ) { +std::size_t ToolbarButtonCount() { return NUM_TOOLBARBUTTONS; } diff --git a/contrib/bobtoolz/bsploader.cpp b/contrib/bobtoolz/bsploader.cpp index 1a0e8e0d..2afba32f 100644 --- a/contrib/bobtoolz/bsploader.cpp +++ b/contrib/bobtoolz/bsploader.cpp @@ -115,7 +115,7 @@ void SwapBlock( int *block, int sizeOfBlock ) { Byte swaps all data in a bsp file. ============= */ -void SwapBSPFile( void ) { +void SwapBSPFile() { int i; // models diff --git a/contrib/brushexport/export.cpp b/contrib/brushexport/export.cpp index 17a19de9..22fad4d7 100644 --- a/contrib/brushexport/export.cpp +++ b/contrib/brushexport/export.cpp @@ -23,11 +23,11 @@ class ExportData { public: ExportData( const StringSetWithLambda& ignorelist, collapsemode mode ); - virtual ~ExportData( void ); + virtual ~ExportData() = default; virtual void BeginBrush( Brush& b ); virtual void AddBrushFace( Face& f ); - virtual void EndBrush( void ); + virtual void EndBrush(); virtual bool WriteToFile( const std::string& path, collapsemode mode ) const = 0; @@ -66,10 +66,6 @@ ExportData::ExportData( const StringSetWithLambda& _ignorelist, collapsemode _mo } } -ExportData::~ExportData( void ){ - -} - void ExportData::BeginBrush( Brush& b ){ // create a new group for each brush if ( mode == COLLAPSE_NONE ) { @@ -80,7 +76,7 @@ void ExportData::BeginBrush( Brush& b ){ } } -void ExportData::EndBrush( void ){ +void ExportData::EndBrush(){ // all faces of this brush were on the ignorelist, discard the emptygroup if ( mode == COLLAPSE_NONE ) { ASSERT_NOTNULL( current ); @@ -131,7 +127,7 @@ void ExportData::AddBrushFace( Face& f ){ void ExportData::GetShaderNameFromShaderPath( const char* path, std::string& name ){ std::string tmp( path ); - size_t last_slash = tmp.find_last_of( "/" ); + size_t last_slash = tmp.find_last_of( '/' ); if ( last_slash == std::string::npos || last_slash == ( tmp.length() - 1 ) ) { name = path; diff --git a/contrib/brushexport/plugin.cpp b/contrib/brushexport/plugin.cpp index eff18555..6b7b3760 100644 --- a/contrib/brushexport/plugin.cpp +++ b/contrib/brushexport/plugin.cpp @@ -37,7 +37,7 @@ #include "typesystem.h" -void CreateWindow( void ); +void CreateWindow(); QWidget *g_pRadiantWnd = nullptr; @@ -83,7 +83,7 @@ class BrushExportDependencies : public GlobalSelectionModuleRef { public: - BrushExportDependencies( void ) + BrushExportDependencies() : GlobalBrushModuleRef( GlobalRadiant().getRequiredGameDescriptionKeyValue( "brushtypes" ) ) {} }; diff --git a/contrib/ufoaiplug/ufoai.cpp b/contrib/ufoaiplug/ufoai.cpp index ec5fa1b7..c70f22b1 100644 --- a/contrib/ufoaiplug/ufoai.cpp +++ b/contrib/ufoaiplug/ufoai.cpp @@ -49,7 +49,7 @@ class UFOAIPluginDependencies : public GlobalEntityClassManagerModuleRef { public: - UFOAIPluginDependencies( void ) : + UFOAIPluginDependencies() : GlobalEntityModuleRef( GlobalRadiant().getRequiredGameDescriptionKeyValue( "entities" ) ), GlobalEntityClassManagerModuleRef( GlobalRadiant().getRequiredGameDescriptionKeyValue( "entityclass" ) ){ } diff --git a/contrib/ufoaiplug/ufoai_filters.cpp b/contrib/ufoaiplug/ufoai_filters.cpp index b4e59e1d..7d2de18b 100644 --- a/contrib/ufoaiplug/ufoai_filters.cpp +++ b/contrib/ufoaiplug/ufoai_filters.cpp @@ -233,7 +233,7 @@ void filter_level( int flag ){ #endif } -void filter_stepon( void ){ +void filter_stepon(){ if ( stepon_active ) { stepon_active = false; } @@ -252,7 +252,7 @@ void filter_stepon( void ){ } } -void filter_nodraw( void ){ +void filter_nodraw(){ if ( nodraw_active ) { nodraw_active = false; } @@ -273,7 +273,7 @@ void filter_nodraw( void ){ #endif } -void filter_actorclip( void ){ +void filter_actorclip(){ if ( actorclip_active ) { actorclip_active = false; } @@ -294,7 +294,7 @@ void filter_actorclip( void ){ #endif } -void filter_weaponclip( void ){ +void filter_weaponclip(){ if ( weaponclip_active ) { weaponclip_active = false; } diff --git a/contrib/ufoaiplug/ufoai_filters.h b/contrib/ufoaiplug/ufoai_filters.h index 72bba69a..439fc623 100644 --- a/contrib/ufoaiplug/ufoai_filters.h +++ b/contrib/ufoaiplug/ufoai_filters.h @@ -19,10 +19,10 @@ #pragma once void filter_level( int flag ); -void filter_stepon( void ); -void filter_actorclip( void ); -void filter_weaponclip( void ); -void filter_nodraw( void ); +void filter_stepon(); +void filter_actorclip(); +void filter_weaponclip(); +void filter_nodraw(); #define SURF_NODRAW 0x80 diff --git a/contrib/ufoaiplug/ufoai_gtk.cpp b/contrib/ufoaiplug/ufoai_gtk.cpp index 079f466c..3fa4fcf7 100644 --- a/contrib/ufoaiplug/ufoai_gtk.cpp +++ b/contrib/ufoaiplug/ufoai_gtk.cpp @@ -27,14 +27,14 @@ /** * @brief */ -std::size_t ToolbarButtonCount( void ){ +std::size_t ToolbarButtonCount(){ return NUM_TOOLBARBUTTONS; } /** * @brief Used if the ufo plugin should not be visible (at least the toolbar stuff) */ -std::size_t ToolbarNoButtons( void ){ +std::size_t ToolbarNoButtons(){ return 0; } diff --git a/contrib/ufoaiplug/ufoai_gtk.h b/contrib/ufoaiplug/ufoai_gtk.h index f74d7425..f3e60eaf 100644 --- a/contrib/ufoaiplug/ufoai_gtk.h +++ b/contrib/ufoaiplug/ufoai_gtk.h @@ -22,5 +22,5 @@ const IToolbarButton* GetToolbarButton( std::size_t index ); const IToolbarButton* GetToolbarNoButton( std::size_t index ); -std::size_t ToolbarButtonCount( void ); -std::size_t ToolbarNoButtons( void ); +std::size_t ToolbarButtonCount(); +std::size_t ToolbarNoButtons();