From e62c6f4bb31d06156c78208fcc0052345c1fd72d Mon Sep 17 00:00:00 2001 From: Garux Date: Sun, 3 Jan 2021 06:24:58 +0300 Subject: [PATCH] fix warnings --- contrib/ufoaiplug/ufoai_filters.cpp | 6 ++---- contrib/ufoaiplug/ufoai_gtk.cpp | 7 ------- libs/picomodel/pm_fm.c | 2 +- libs/xml/xmltextags.h | 1 - radiant/csg.cpp | 3 --- radiant/preferences.cpp | 2 +- radiant/scenegraph.h | 2 +- radiant/watchbsp.cpp | 1 - radiant/xywindow.h | 2 -- tools/mbspc/mbspc/l_cmd.c | 6 +++--- tools/mbspc/mbspc/l_cmd.h | 4 ++-- tools/mbspc/qcommon/unzip.c | 2 +- tools/quake2/common/path_init.c | 3 +-- tools/quake2/qdata_heretic2/common/path_init.c | 3 +-- tools/quake3/common/unzip.c | 2 +- 15 files changed, 14 insertions(+), 32 deletions(-) diff --git a/contrib/ufoaiplug/ufoai_filters.cpp b/contrib/ufoaiplug/ufoai_filters.cpp index 25274d72..aa8dd91b 100644 --- a/contrib/ufoaiplug/ufoai_filters.cpp +++ b/contrib/ufoaiplug/ufoai_filters.cpp @@ -88,13 +88,11 @@ bool pre( const scene::Path& path, scene::Instance& instance ) const { class ForEachFace : public BrushVisitor { -Brush &m_brush; public: mutable int m_contentFlagsVis; mutable int m_surfaceFlagsVis; -ForEachFace( Brush& brush ) - : m_brush( brush ){ +ForEachFace() { m_contentFlagsVis = -1; m_surfaceFlagsVis = -1; } @@ -136,7 +134,7 @@ BrushGetLevel( brushlist_t& brushlist, int flag, bool content, bool notset, bool bool pre( const scene::Path& path, scene::Instance& instance ) const { Brush* brush = Node_getBrush( path.top() ); if ( brush != 0 ) { - ForEachFace faces( *brush ); + ForEachFace faces; brush->forEachFace( faces ); // contentflags? if ( m_content ) { diff --git a/contrib/ufoaiplug/ufoai_gtk.cpp b/contrib/ufoaiplug/ufoai_gtk.cpp index e459561b..f934e579 100644 --- a/contrib/ufoaiplug/ufoai_gtk.cpp +++ b/contrib/ufoaiplug/ufoai_gtk.cpp @@ -28,13 +28,6 @@ * GTK callback functions */ -class UFOAIGtk -{ -GtkWindow* m_gtk_window; -public: -UFOAIGtk( void* gtk_window ) : m_gtk_window( ( GtkWindow* )gtk_window ){ -} -}; #if 0 /** diff --git a/libs/picomodel/pm_fm.c b/libs/picomodel/pm_fm.c index 389b970d..d92fc786 100644 --- a/libs/picomodel/pm_fm.c +++ b/libs/picomodel/pm_fm.c @@ -447,7 +447,7 @@ static picoModel_t *_fm_load( PM_PARAMS_LOAD ){ #endif continue; } - else if ( ( p_index_LUT[triangle->index_xyz[j]].next == NULL ) ) { // Not equal to Main entry, and no LL entry + else if ( p_index_LUT[triangle->index_xyz[j]].next == NULL ) { // Not equal to Main entry, and no LL entry // Add first entry of LL from Main p_index_LUT2 = (index_LUT_t *)_pico_alloc( sizeof( index_LUT_t ) ); if ( p_index_LUT2 == NULL ) { diff --git a/libs/xml/xmltextags.h b/libs/xml/xmltextags.h index dbad5f56..5b19a761 100644 --- a/libs/xml/xmltextags.h +++ b/libs/xml/xmltextags.h @@ -55,7 +55,6 @@ private: CopiedString m_savefilename; xmlDocPtr doc; xmlXPathContextPtr context; -xmlNodeSetPtr nodePtr; xmlXPathObjectPtr XpathEval( const char* queryString ){ const xmlChar* expression = (const xmlChar*)queryString; diff --git a/radiant/csg.cpp b/radiant/csg.cpp index b397b3eb..cd7be79c 100644 --- a/radiant/csg.cpp +++ b/radiant/csg.cpp @@ -317,9 +317,6 @@ public: class BrushHollowSelectedWalker : public scene::Graph::Walker { HollowSettings& m_settings; - - float offset; - EHollowType HollowType; public: BrushHollowSelectedWalker( HollowSettings& settings ) : m_settings( settings ) { diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 3a7738be..8e361795 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -241,7 +241,7 @@ void CGameDialog::DoGameDialog(){ } CGameDescription* CGameDialog::GameDescriptionForComboItem(){ - return ( m_nComboSelect >= 0 && m_nComboSelect < mGames.size() )? + return ( m_nComboSelect >= 0 && m_nComboSelect < static_cast( mGames.size() ) )? *std::next( mGames.begin(), m_nComboSelect ) : 0; // not found } diff --git a/radiant/scenegraph.h b/radiant/scenegraph.h index 48fb08b3..759c34c0 100644 --- a/radiant/scenegraph.h +++ b/radiant/scenegraph.h @@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined( INCLUDEDE_SCENEGRAPH_H ) +#if !defined( INCLUDED_SCENEGRAPH_H ) #define INCLUDED_SCENEGRAPH_H #endif diff --git a/radiant/watchbsp.cpp b/radiant/watchbsp.cpp index c6b7295c..d85a1905 100644 --- a/radiant/watchbsp.cpp +++ b/radiant/watchbsp.cpp @@ -105,7 +105,6 @@ std::size_t m_iCurrentStep; char *m_sBSPName; // buffer we use in push mode to receive data directly from the network xmlParserInputBufferPtr m_xmlInputBuffer; -xmlParserInputPtr m_xmlInput; xmlParserCtxtPtr m_xmlParserCtxt; // call this to switch the set listening mode bool SetupListening(); diff --git a/radiant/xywindow.h b/radiant/xywindow.h index 2b2c3abb..ecd443ba 100644 --- a/radiant/xywindow.h +++ b/radiant/xywindow.h @@ -201,8 +201,6 @@ Vector3 m_vOrigin; View m_view; static Shader* m_state_selected; -int m_ptCursorX, m_ptCursorY; - unsigned int m_buttonstate; int m_nNewBrushPressx; diff --git a/tools/mbspc/mbspc/l_cmd.c b/tools/mbspc/mbspc/l_cmd.c index ea9f61e2..6cc967b9 100644 --- a/tools/mbspc/mbspc/l_cmd.c +++ b/tools/mbspc/mbspc/l_cmd.c @@ -607,7 +607,7 @@ FILE *SafeOpenWrite (char *filename) return f; } -FILE *SafeOpenRead (char *filename) +FILE *SafeOpenRead (const char *filename) { FILE *f; @@ -655,7 +655,7 @@ qboolean FileExists (char *filename) LoadFile ============== */ -int LoadFile (char *filename, void **bufferptr, int offset, int length) +int LoadFile (const char *filename, void **bufferptr, int offset, int length) { FILE *f; void *buffer; @@ -1189,7 +1189,7 @@ void FS_FreeFile(void *buf) int FS_ReadFileAndCache(const char *qpath, void **buffer) { - return LoadFile((char *) qpath, buffer, 0, 0); + return LoadFile(qpath, buffer, 0, 0); } //end of the function FS_ReadFileAndCache int FS_FOpenFileRead( const char *filename, FILE **file, qboolean uniqueFILE ) diff --git a/tools/mbspc/mbspc/l_cmd.h b/tools/mbspc/mbspc/l_cmd.h index 2b738c2b..cabf4133 100644 --- a/tools/mbspc/mbspc/l_cmd.h +++ b/tools/mbspc/mbspc/l_cmd.h @@ -69,11 +69,11 @@ void Warning(char *warning, ...); int CheckParm (char *check); FILE *SafeOpenWrite (char *filename); -FILE *SafeOpenRead (char *filename); +FILE *SafeOpenRead (const char *filename); void SafeRead (FILE *f, void *buffer, int count); void SafeWrite (FILE *f, void *buffer, int count); -int LoadFile (char *filename, void **bufferptr, int offset, int length); +int LoadFile (const char *filename, void **bufferptr, int offset, int length); int TryLoadFile (char *filename, void **bufferptr); void SaveFile (char *filename, void *buffer, int count); qboolean FileExists (char *filename); diff --git a/tools/mbspc/qcommon/unzip.c b/tools/mbspc/qcommon/unzip.c index e3b60f40..99f6d673 100644 --- a/tools/mbspc/qcommon/unzip.c +++ b/tools/mbspc/qcommon/unzip.c @@ -1932,7 +1932,7 @@ extern int unzReadCurrentFile (unzFile file, void *buf, unsigned len) return UNZ_PARAMERROR; - if ((pfile_in_zip_read_info->read_buffer == NULL)) + if (pfile_in_zip_read_info->read_buffer == NULL) return UNZ_END_OF_LIST_OF_FILE; if (len==0) return 0; diff --git a/tools/quake2/common/path_init.c b/tools/quake2/common/path_init.c index a549b563..0198f443 100644 --- a/tools/quake2/common/path_init.c +++ b/tools/quake2/common/path_init.c @@ -134,8 +134,7 @@ void LokiInitPaths( char *argv0 ){ path = getenv( "PATH" ); /* minor setup */ - last[ 0 ] = path[ 0 ]; - last[ 1 ] = '\0'; + last = path; found = false; /* go through each : segment of path */ diff --git a/tools/quake2/qdata_heretic2/common/path_init.c b/tools/quake2/qdata_heretic2/common/path_init.c index ffc85ae8..e62303f4 100644 --- a/tools/quake2/qdata_heretic2/common/path_init.c +++ b/tools/quake2/qdata_heretic2/common/path_init.c @@ -135,8 +135,7 @@ void LokiInitPaths( char *argv0 ){ path = getenv( "PATH" ); /* minor setup */ - last[ 0 ] = path[ 0 ]; - last[ 1 ] = '\0'; + last = path; found = false; /* go through each : segment of path */ diff --git a/tools/quake3/common/unzip.c b/tools/quake3/common/unzip.c index ce31dbac..2fa0dda2 100644 --- a/tools/quake3/common/unzip.c +++ b/tools/quake3/common/unzip.c @@ -2102,7 +2102,7 @@ extern int unzReadCurrentFile (unzFile file, void *buf, unsigned len) return UNZ_PARAMERROR; - if ((pfile_in_zip_read_info->read_buffer == NULL)) + if (pfile_in_zip_read_info->read_buffer == NULL) return UNZ_END_OF_LIST_OF_FILE; if (len==0) return 0;