From: TimePath Date: Sun, 6 Aug 2017 04:19:41 +0000 (+1000) Subject: Suppress warnings X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=98aa841d3aef7e85f45e6710b4df0dbefe459c43;p=xonotic%2Fnetradiant.git Suppress warnings --- diff --git a/libs/profile/file.cpp b/libs/profile/file.cpp index ec230964..9f83393d 100644 --- a/libs/profile/file.cpp +++ b/libs/profile/file.cpp @@ -271,7 +271,7 @@ int MemStream::Seek( offset_type lOff, int nFrom ){ lNewPos = m_nFileSize + lOff; } else{ - return ( position_type ) - 1; + return -1; } m_nPosition = lNewPos; diff --git a/libs/splines/math_matrix.h b/libs/splines/math_matrix.h index 597f1d02..306b9bc9 100644 --- a/libs/splines/math_matrix.h +++ b/libs/splines/math_matrix.h @@ -83,8 +83,8 @@ friend mat3_t SkewSymmetric( idVec3 const &src ); ID_INLINE mat3_t::mat3_t() { } -ID_INLINE mat3_t::mat3_t( float src[ 3 ][ 3 ] ) { - memcpy( mat, src, sizeof( src ) ); +ID_INLINE mat3_t::mat3_t(float src[3][3]) { + memcpy(mat, src, sizeof(float) * 3 * 3); } ID_INLINE mat3_t::mat3_t( idVec3 const &x, idVec3 const &y, idVec3 const &z ) { diff --git a/libs/stream/stringstream.h b/libs/stream/stringstream.h index 386093fe..8511bd4f 100644 --- a/libs/stream/stringstream.h +++ b/libs/stream/stringstream.h @@ -105,7 +105,7 @@ typedef StringBuffer::const_iterator const_iterator; StringOutputStream(){ } -StringOutputStream( std::size_t capacity ) : m_string( capacity ){ +explicit StringOutputStream( std::size_t capacity ) : m_string( capacity ){ } std::size_t write( const char* buffer, std::size_t length ){ m_string.push_range( buffer, buffer + length ); diff --git a/libs/xml/xmltextags.cpp b/libs/xml/xmltextags.cpp index c9d2b06b..00f57a05 100644 --- a/libs/xml/xmltextags.cpp +++ b/libs/xml/xmltextags.cpp @@ -476,7 +476,7 @@ void XmlTagBuilder::GetShaderTags( const char* shader, std::vector returns a vector containing the tags */ - char* expression; + char const *expression; if ( shader == NULL ) { // get all tags from all shaders expression = "/root/*/*/tag"; @@ -510,7 +510,7 @@ void XmlTagBuilder::GetUntagged( std::set& shaders ){ returns a set containing the shaders (with path) */ - char* expression = "/root/*/*[not(child::tag)]"; + char const *expression = "/root/*/*[not(child::tag)]"; xmlXPathObjectPtr xpathPtr = XpathEval( expression ); xmlNodeSetPtr nodePtr; @@ -540,7 +540,7 @@ void XmlTagBuilder::GetAllTags( std::set& tags ){ returns a set containing all used tags */ - char* expression = "/root/*/*/tag"; + char const *expression = "/root/*/*/tag"; xmlXPathObjectPtr xpathPtr = XpathEval( expression ); xmlNodeSetPtr nodePtr; diff --git a/radiant/environment.cpp b/radiant/environment.cpp index 4e15c815..a28524e6 100644 --- a/radiant/environment.cpp +++ b/radiant/environment.cpp @@ -30,9 +30,9 @@ #include "cmdlib.h" int g_argc; -char** g_argv; +char const** g_argv; -void args_init( int argc, char* argv[] ){ +void args_init( int argc, char const* argv[] ){ int i, j, k; for ( i = 1; i < argc; i++ ) @@ -54,8 +54,8 @@ void args_init( int argc, char* argv[] ){ g_argv = argv; } -char *gamedetect_argv_buffer[1024]; -void gamedetect_found_game( char *game, char *path ){ +char const *gamedetect_argv_buffer[1024]; +void gamedetect_found_game( char const *game, char *path ){ int argc; static char buf[128]; @@ -79,7 +79,7 @@ void gamedetect_found_game( char *game, char *path ){ g_argv = gamedetect_argv_buffer; } -bool gamedetect_check_game( char *gamefile, const char *checkfile1, const char *checkfile2, char *buf /* must have 64 bytes free after bufpos */, int bufpos ){ +bool gamedetect_check_game( char const *gamefile, const char *checkfile1, const char *checkfile2, char *buf /* must have 64 bytes free after bufpos */, int bufpos ){ buf[bufpos] = '/'; strcpy( buf + bufpos + 1, checkfile1 ); @@ -196,7 +196,7 @@ const char* LINK_NAME = ; /// brief Returns the filename of the executable belonging to the current process, or 0 if not found. -char* getexename( char *buf ){ +char const* getexename( char *buf ){ /* Now read the symbolic link */ int ret = readlink( LINK_NAME, buf, PATH_MAX ); @@ -224,7 +224,7 @@ char* getexename( char *buf ){ return buf; } -void environment_init( int argc, char* argv[] ){ +void environment_init( int argc, char const* argv[] ){ // Give away unnecessary root privileges. // Important: must be done before calling gtk_init(). char *loginname; diff --git a/radiant/environment.h b/radiant/environment.h index 7ee16c6f..b2828f86 100644 --- a/radiant/environment.h +++ b/radiant/environment.h @@ -22,11 +22,11 @@ #if !defined( INCLUDED_ENVIRONMENT_H ) #define INCLUDED_ENVIRONMENT_H -void environment_init( int argc, char* argv[] ); +void environment_init( int argc, char const* argv[] ); const char* environment_get_home_path(); const char* environment_get_app_path(); extern int g_argc; -extern char** g_argv; +extern char const** g_argv; #endif diff --git a/radiant/main.cpp b/radiant/main.cpp index 93de25c9..d80fd0b4 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -593,7 +593,7 @@ int main( int argc, char* argv[] ){ GlobalDebugMessageHandler::instance().setHandler( GlobalPopupDebugMessageHandler::instance() ); - environment_init( argc, argv ); + environment_init(argc, (char const **) argv); paths_init(); diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index 7d1782ec..8ee515ff 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -1989,7 +1989,7 @@ void TextureBrowser_SetNotex(){ name << GlobalRadiant().getAppPath() << "bitmaps/" NOTEX_BASENAME ".png"; g_notex = name.c_str(); - name = NULL; + name = StringOutputStream(256); name << GlobalRadiant().getAppPath() << "bitmaps/" SHADERNOTEX_BASENAME " .png"; g_shadernotex = name.c_str(); }