From 043398589de098759058a270ac86bf16fc937deb Mon Sep 17 00:00:00 2001 From: jdolan Date: Fri, 3 May 2013 02:56:48 -0400 Subject: [PATCH 1/4] Eclipse project files. --- .cproject | 944 +++++++++++++++++++++++++++++++++++++++++++++++++++++ .gitignore | 1 + .project | 83 +++++ 3 files changed, 1028 insertions(+) create mode 100644 .cproject create mode 100644 .project diff --git a/.cproject b/.cproject new file mode 100644 index 00000000..2d63c2af --- /dev/null +++ b/.cproject @@ -0,0 +1,944 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore index c1704fc5..5d7e074c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /build *.pyc *.so +.settings diff --git a/.project b/.project new file mode 100644 index 00000000..73e7fc82 --- /dev/null +++ b/.project @@ -0,0 +1,83 @@ + + + GtkRadiant + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.autoBuildTarget + + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.buildCommand + /opt/local/bin/scons + + + org.eclipse.cdt.make.core.buildLocation + ${workspace_loc:/GtkRadiant} + + + org.eclipse.cdt.make.core.cleanBuildTarget + -c + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.fullBuildTarget + + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + false + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + From a269593afe5fe37b3522a27bfe8eba1717f6db7b Mon Sep 17 00:00:00 2001 From: jdolan Date: Fri, 3 May 2013 02:57:29 -0400 Subject: [PATCH 2/4] Low hanging fruit: bring the number of compiler warnings down from 264 to 33. --- contrib/bobtoolz/DEntity.cpp | 4 ++-- contrib/bobtoolz/DEntity.h | 4 ++-- contrib/bobtoolz/DMap.cpp | 2 +- contrib/bobtoolz/DMap.h | 4 ++-- contrib/bobtoolz/dialogs/dialogs-gtk.cpp | 8 ++++---- contrib/bobtoolz/shapes.cpp | 2 +- contrib/gtkgensurf/dec.cpp | 2 +- contrib/gtkgensurf/genmap.cpp | 2 +- contrib/gtkgensurf/gensurf.cpp | 2 +- contrib/gtkgensurf/heretic.cpp | 4 ++-- include/iscriplib.h | 2 +- libs/l_net/l_net.c | 4 ++-- libs/l_net/l_net_berkeley.c | 6 +++--- libs/picomodel/lwo/clip.c | 8 ++++---- libs/picomodel/lwo/envelope.c | 6 +++--- libs/picomodel/lwo/list.c | 6 +++--- libs/picomodel/lwo/lwio.c | 2 +- libs/picomodel/lwo/lwo2.c | 20 +++++++++--------- libs/picomodel/lwo/lwo2.h | 7 ++++--- libs/picomodel/lwo/lwob.c | 22 ++++++++++---------- libs/picomodel/lwo/pntspols.c | 2 +- libs/picomodel/lwo/surface.c | 26 ++++++++++++------------ libs/picomodel/pm_fm.c | 2 +- libs/picomodel/pm_md2.c | 2 +- libs/splines/math_vector.cpp | 2 ++ libs/splines/q_shared.cpp | 13 +++++++----- libs/splines/q_shared.h | 2 +- libs/splines/splines.cpp | 2 ++ plugins/eclassfgd/plugin.cpp | 6 +++--- plugins/image/lbmlib.cpp | 8 ++++---- plugins/imagehl/lbmlib.cpp | 6 +++--- plugins/imagem8/m8.cpp | 2 +- plugins/model/cpicomodel.h | 2 +- plugins/shaders/shaders.cpp | 2 +- plugins/textool/TexTool.cpp | 2 +- plugins/vfspak/vfs.cpp | 16 +++++++-------- plugins/vfspk3/vfs.cpp | 14 ++++++------- plugins/vfsqlpk3/vfs.cpp | 14 ++++++------- plugins/vfswad/vfs.cpp | 14 ++++++------- radiant/feedback.cpp | 2 +- radiant/groupdialog.cpp | 6 +++--- radiant/gtkdlgs.cpp | 20 +++++++++--------- radiant/gtkmisc.cpp | 15 +++++++++----- radiant/main.cpp | 7 ++++--- radiant/mainframe.cpp | 1 + radiant/mainframe.h | 4 ++-- radiant/parse.cpp | 6 +++--- radiant/parse.h | 2 +- radiant/points.cpp | 2 +- radiant/preferences.cpp | 2 +- radiant/qe3.cpp | 4 ++-- radiant/qgl.c | 4 ++-- radiant/texwindow.cpp | 2 +- radiant/xywindow.cpp | 4 ++-- 54 files changed, 175 insertions(+), 160 deletions(-) diff --git a/contrib/bobtoolz/DEntity.cpp b/contrib/bobtoolz/DEntity.cpp index 20a5b262..3320da80 100644 --- a/contrib/bobtoolz/DEntity.cpp +++ b/contrib/bobtoolz/DEntity.cpp @@ -57,7 +57,7 @@ const char* brushEntityList[] = { // Construction/Destruction ////////////////////////////////////////////////////////////////////// -DEntity::DEntity( char *classname, int ID ){ +DEntity::DEntity( const char *classname, int ID ){ SetClassname( classname ); m_nID = ID; QER_Entity = NULL; @@ -469,7 +469,7 @@ int DEntity::GetIDMax( void ) { return max + 1; } -void DEntity::SetClassname( char *classname ) { +void DEntity::SetClassname( const char *classname ) { m_Classname = classname; } diff --git a/contrib/bobtoolz/DEntity.h b/contrib/bobtoolz/DEntity.h index bc436458..74a2733b 100644 --- a/contrib/bobtoolz/DEntity.h +++ b/contrib/bobtoolz/DEntity.h @@ -41,7 +41,7 @@ entity_t* QER_Entity; int m_nID; // Constrcution/Destruction -DEntity( char* classname = "worldspawn", int ID = -1 ); // sets classname +DEntity( const char* classname = "worldspawn", int ID = -1 ); // sets classname virtual ~DEntity(); // --------------------------------------------- @@ -55,7 +55,7 @@ DEPair* FindEPairByKey( const char* keyname ); // random functions........ bool ResetTextures( const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName, int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation, bool rebuild ); void SaveToFile( FILE* pFile ); -void SetClassname( char* classname ); +void SetClassname( const char* classname ); int GetIDMax(); void BuildInRadiant( bool allowDestruction ); diff --git a/contrib/bobtoolz/DMap.cpp b/contrib/bobtoolz/DMap.cpp index 3f70d5ee..04c2400c 100644 --- a/contrib/bobtoolz/DMap.cpp +++ b/contrib/bobtoolz/DMap.cpp @@ -38,7 +38,7 @@ DMap::~DMap(){ ClearEntities(); } -DEntity* DMap::AddEntity( char *classname, int ID ){ +DEntity* DMap::AddEntity( const char *classname, int ID ){ DEntity* newEntity; if ( ID == -1 ) { newEntity = new DEntity( classname, m_nNextEntity++ ); diff --git a/contrib/bobtoolz/DMap.h b/contrib/bobtoolz/DMap.h index f04f2c85..dd9dc4e5 100644 --- a/contrib/bobtoolz/DMap.h +++ b/contrib/bobtoolz/DMap.h @@ -42,8 +42,8 @@ int m_nNextEntity; DEntity* GetWorldSpawn(); void ClearEntities(); -DEntity* DMap::GetEntityForID( int ID ); -DEntity* AddEntity( char* classname = "worldspawn", int ID = -1 ); +DEntity* GetEntityForID( int ID ); +DEntity* AddEntity( const char* classname = "worldspawn", int ID = -1 ); list entityList; diff --git a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp index 1a2edca3..7e4ac81a 100644 --- a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp +++ b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp @@ -109,7 +109,7 @@ static void dialog_button_callback_settex( GtkWidget *widget, gpointer data ){ Data validation Routines ---------------------------------*/ -bool ValidateTextFloat( const char* pData, char* error_title, float* value ){ +bool ValidateTextFloat( const char* pData, const char* error_title, float* value ){ if ( pData ) { float testNum = (float)atof( pData ); @@ -128,7 +128,7 @@ bool ValidateTextFloat( const char* pData, char* error_title, float* value ){ return FALSE; } -bool ValidateTextFloatRange( const char* pData, float min, float max, char* error_title, float* value ){ +bool ValidateTextFloatRange( const char* pData, float min, float max, const char* error_title, float* value ){ char error_buffer[256]; sprintf( error_buffer, "Please Enter A Floating Point Number Between %.3f and %.3f", min, max ); @@ -172,7 +172,7 @@ bool ValidateTextIntRange( const char* pData, int min, int max, const char* erro return FALSE; } -bool ValidateTextInt( const char* pData, char* error_title, int* value ){ +bool ValidateTextInt( const char* pData, const char* error_title, int* value ){ if ( pData ) { int testNum = atoi( pData ); @@ -588,7 +588,7 @@ int DoBuildStairsBox( BuildStairsRS* rs ){ loop = 1; - char *text = "Please set a value in the boxes below and press 'OK' to build the stairs"; + const char *text = "Please set a value in the boxes below and press 'OK' to build the stairs"; window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); diff --git a/contrib/bobtoolz/shapes.cpp b/contrib/bobtoolz/shapes.cpp index 490c1138..e7e2de32 100644 --- a/contrib/bobtoolz/shapes.cpp +++ b/contrib/bobtoolz/shapes.cpp @@ -319,7 +319,7 @@ void Build_StairStep_Wedge( int dir, vec3_t min, vec3_t max, const char* mainTex //----------------------------------------------------------------------------------- // internal use only, to get a box without finishing construction -brush_t* Build_Get_BoundingCube_Selective( vec3_t min, vec3_t max, char* texture, bool* useFaces ){ +brush_t* Build_Get_BoundingCube_Selective( vec3_t min, vec3_t max, const char* texture, bool* useFaces ){ brush_t* newBrush = (brush_t*)g_FuncTable.m_pfnCreateBrushHandle(); //----- Build Outer Bounds --------- diff --git a/contrib/gtkgensurf/dec.cpp b/contrib/gtkgensurf/dec.cpp index 3a96410e..09a16993 100644 --- a/contrib/gtkgensurf/dec.cpp +++ b/contrib/gtkgensurf/dec.cpp @@ -768,7 +768,7 @@ void MakeBrushes( int NumTris, NODE *Node, TRI *Tri,bool surf, // if texture2 is identical to texture0, there's no need to // check surface angle - if ( !g_strcasecmp( texture0,texture2 ) || !strlen( texture2 ) ) { + if ( !g_ascii_strcasecmp( texture0,texture2 ) || !strlen( texture2 ) ) { CheckAngle = FALSE; } else diff --git a/contrib/gtkgensurf/genmap.cpp b/contrib/gtkgensurf/genmap.cpp index 8ed89353..f4336982 100644 --- a/contrib/gtkgensurf/genmap.cpp +++ b/contrib/gtkgensurf/genmap.cpp @@ -293,7 +293,7 @@ void MapBrushes(){ // if surftext2 is identical to surftext, there's no need to // check surface angle - if ( !g_strcasecmp( surftext,surftext2 ) ) { + if ( !g_ascii_strcasecmp( surftext,surftext2 ) ) { CheckAngle = FALSE; } else diff --git a/contrib/gtkgensurf/gensurf.cpp b/contrib/gtkgensurf/gensurf.cpp index f06d060f..bc31f858 100644 --- a/contrib/gtkgensurf/gensurf.cpp +++ b/contrib/gtkgensurf/gensurf.cpp @@ -117,7 +117,7 @@ bool GenSurfInit(){ basepath = g_FuncTable.m_pfnReadProjectKey("basepath"); if (basepath) { - g_strdown (basepath); + Q_strlwr (basepath); if (strstr(basepath,"baseq3")) Game = QUAKE3; else if (strstr (basepath,"baseq2")) diff --git a/contrib/gtkgensurf/heretic.cpp b/contrib/gtkgensurf/heretic.cpp index e07a378b..00765538 100644 --- a/contrib/gtkgensurf/heretic.cpp +++ b/contrib/gtkgensurf/heretic.cpp @@ -75,7 +75,7 @@ int GetDefSurfaceProps( char *Tex ){ if (NULL != (fpak = fopen(pakfile[Game], "rb"))) { sprintf(path,"textures/%s.m8",Tex); - g_strdown(path); + Q_strlwr(path); num=fread(&pakheader,1,sizeof(pak_header_t),fpak); if((size_t)num < sizeof(pak_header_t)) { @@ -116,7 +116,7 @@ int GetDefSurfaceProps( char *Tex ){ // Assume .map will be output to gamedir/maps, then back up // to the gamedir and append /textures. Ugly but it should work strcpy(path,gszMapFile); - g_strdown(path); + Q_strlwr(path); p = strstr(path,"maps"); if(!p) return 0; p[0] = '\0'; diff --git a/include/iscriplib.h b/include/iscriplib.h index c958a42a..ffa624fc 100644 --- a/include/iscriplib.h +++ b/include/iscriplib.h @@ -51,7 +51,7 @@ typedef qboolean ( *PFN_TOKENAVAILABLE )(); typedef char* ( *PFN_COM_PARSE )( char *data ); typedef char* ( *PFN_GET_COM_TOKEN )(); // Hydra: added support for GetTokenExtra() -typedef qboolean ( *PFN_GETTOKENEXTRA )( qboolean crossline,char *delimiters,qboolean keepdelimiter ); +typedef qboolean ( *PFN_GETTOKENEXTRA )( qboolean crossline,const char *delimiters,qboolean keepdelimiter ); struct _QERScripLibTable { diff --git a/libs/l_net/l_net.c b/libs/l_net/l_net.c index 8d475080..385751b2 100644 --- a/libs/l_net/l_net.c +++ b/libs/l_net/l_net.c @@ -51,7 +51,7 @@ void WinPrint( char *str, ... ){ vsprintf( text, str, argptr ); va_end( argptr ); - printf( text ); + printf("%s", text ); } #else void WinPrint( char *str, ... ){ @@ -81,7 +81,7 @@ int Net_AddressCompare( address_t *addr1, address_t *addr2 ){ #ifdef _WIN32 return stricmp( addr1->ip, addr2->ip ); #endif -#ifdef __linux__ +#if __linux__ || __APPLE__ return strcasecmp( addr1->ip, addr2->ip ); #endif } //end of the function Net_AddressCompare diff --git a/libs/l_net/l_net_berkeley.c b/libs/l_net/l_net_berkeley.c index 45ed3c9c..589be004 100644 --- a/libs/l_net/l_net_berkeley.c +++ b/libs/l_net/l_net_berkeley.c @@ -365,7 +365,7 @@ int WINS_Listen( int socket ){ // Changes Globals: - //=========================================================================== int WINS_Accept( int socket, struct sockaddr_s *addr ){ - int addrlen = sizeof( struct sockaddr_s ); + socklen_t addrlen = sizeof( struct sockaddr_s ); int newsocket; qboolean _true = 1; @@ -494,7 +494,7 @@ int WINS_CheckNewConnections( void ){ // Changes Globals: - //=========================================================================== int WINS_Read( int socket, byte *buf, int len, struct sockaddr_s *addr ){ - int addrlen = sizeof( struct sockaddr_s ); + socklen_t addrlen = sizeof( struct sockaddr_s ); int ret; if ( addr ) { @@ -659,7 +659,7 @@ int WINS_StringToAddr( char *string, struct sockaddr_s *addr ){ // Changes Globals: - //=========================================================================== int WINS_GetSocketAddr( int socket, struct sockaddr_s *addr ){ - int addrlen = sizeof( struct sockaddr_s ); + socklen_t addrlen = sizeof( struct sockaddr_s ); unsigned int a; memset( addr, 0, sizeof( struct sockaddr_s ) ); diff --git a/libs/picomodel/lwo/clip.c b/libs/picomodel/lwo/clip.c index 97f2973d..8a9d2a62 100644 --- a/libs/picomodel/lwo/clip.c +++ b/libs/picomodel/lwo/clip.c @@ -20,8 +20,8 @@ void lwFreeClip( lwClip *clip ){ if ( clip ) { - lwListFree( (void*) clip->ifilter, lwFreePlugin ); - lwListFree( (void*) clip->pfilter, lwFreePlugin ); + lwListFree( (void*) clip->ifilter, (ListFreeFunc) lwFreePlugin ); + lwListFree( (void*) clip->pfilter, (ListFreeFunc) lwFreePlugin ); _pico_free( clip ); } } @@ -196,11 +196,11 @@ lwClip *lwGetClip( picoMemStream_t *fp, int cksize ){ filt->data = getbytes( fp, sz - rlen ); if ( id == ID_IFLT ) { - lwListAdd( &clip->ifilter, filt ); + lwListAdd( (void **) &clip->ifilter, filt ); clip->nifilters++; } else { - lwListAdd( &clip->pfilter, filt ); + lwListAdd( (void **) &clip->pfilter, filt ); clip->npfilters++; } break; diff --git a/libs/picomodel/lwo/envelope.c b/libs/picomodel/lwo/envelope.c index 7ad200c2..db7000ad 100644 --- a/libs/picomodel/lwo/envelope.c +++ b/libs/picomodel/lwo/envelope.c @@ -23,7 +23,7 @@ void lwFreeEnvelope( lwEnvelope *env ){ _pico_free( env->name ); } lwListFree( env->key, _pico_free ); - lwListFree( env->cfilter, lwFreePlugin ); + lwListFree( env->cfilter, (ListFreeFunc) lwFreePlugin ); _pico_free( env ); } } @@ -105,7 +105,7 @@ lwEnvelope *lwGetEnvelope( picoMemStream_t *fp, int cksize ){ } key->time = getF4( fp ); key->value = getF4( fp ); - lwListInsert( &env->key, key, compare_keys ); + lwListInsert( (void **) &env->key, key, (ListCompareFunc) compare_keys ); env->nkeys++; break; @@ -148,7 +148,7 @@ lwEnvelope *lwGetEnvelope( picoMemStream_t *fp, int cksize ){ plug->flags = getU2( fp ); plug->data = getbytes( fp, sz - get_flen() ); - lwListAdd( &env->cfilter, plug ); + lwListAdd( (void **) &env->cfilter, plug ); env->ncfilters++; break; diff --git a/libs/picomodel/lwo/list.c b/libs/picomodel/lwo/list.c index d57547db..a0e8686e 100644 --- a/libs/picomodel/lwo/list.c +++ b/libs/picomodel/lwo/list.c @@ -18,13 +18,13 @@ Free the items in a list. ====================================================================== */ -void lwListFree( void *list, void ( *freeNode )( void * ) ){ +void lwListFree( void *list, ListFreeFunc freefunc ){ lwNode *node, *next; node = ( lwNode * ) list; while ( node ) { next = node->next; - freeNode( node ); + freefunc( node ); node = next; } } @@ -61,7 +61,7 @@ void lwListAdd( void **list, void *node ){ Insert a node into a list in sorted order. ====================================================================== */ -void lwListInsert( void **vlist, void *vitem, int ( *compare )( void *, void * ) ){ +void lwListInsert( void **vlist, void *vitem, ListCompareFunc compare ){ lwNode **list, *item, *node, *prev; if ( !*vlist ) { diff --git a/libs/picomodel/lwo/lwio.c b/libs/picomodel/lwo/lwio.c index 52052483..0e78f28f 100644 --- a/libs/picomodel/lwo/lwio.c +++ b/libs/picomodel/lwo/lwio.c @@ -451,7 +451,7 @@ char *sgetS0( unsigned char **bp ){ return NULL; } - len = strlen( buf ) + 1; + len = strlen( (char *) buf ) + 1; if ( len == 1 ) { flen += 2; *bp += 2; diff --git a/libs/picomodel/lwo/lwo2.c b/libs/picomodel/lwo/lwo2.c index 1a1d7601..d26a5c24 100644 --- a/libs/picomodel/lwo/lwo2.c +++ b/libs/picomodel/lwo/lwo2.c @@ -30,7 +30,7 @@ void lwFreeLayer( lwLayer *layer ){ } lwFreePoints( &layer->point ); lwFreePolygons( &layer->polygon ); - lwListFree( layer->vmap, lwFreeVMap ); + lwListFree( layer->vmap, (ListFreeFunc) lwFreeVMap ); _pico_free( layer ); } } @@ -45,10 +45,10 @@ void lwFreeLayer( lwLayer *layer ){ void lwFreeObject( lwObject *object ){ if ( object ) { - lwListFree( object->layer, lwFreeLayer ); - lwListFree( object->env, lwFreeEnvelope ); - lwListFree( object->clip, lwFreeClip ); - lwListFree( object->surf, lwFreeSurface ); + lwListFree( object->layer, (ListFreeFunc) lwFreeLayer ); + lwListFree( object->env, (ListFreeFunc) lwFreeEnvelope ); + lwListFree( object->clip, (ListFreeFunc) lwFreeClip ); + lwListFree( object->surf, (ListFreeFunc) lwFreeSurface ); lwFreeTags( &object->taglist ); _pico_free( object ); } @@ -154,7 +154,7 @@ lwObject *lwGetObject( char *filename, picoMemStream_t *fp, unsigned int *failID if ( !layer ) { goto Fail; } - lwListAdd( &object->layer, layer ); + lwListAdd( (void **) &object->layer, layer ); } object->nlayers++; @@ -199,7 +199,7 @@ lwObject *lwGetObject( char *filename, picoMemStream_t *fp, unsigned int *failID if ( !node ) { goto Fail; } - lwListAdd( &layer->vmap, node ); + lwListAdd( (void **) &layer->vmap, node ); layer->nvmaps++; break; @@ -234,7 +234,7 @@ lwObject *lwGetObject( char *filename, picoMemStream_t *fp, unsigned int *failID if ( !node ) { goto Fail; } - lwListAdd( &object->env, node ); + lwListAdd( (void **) &object->env, node ); object->nenvs++; break; @@ -243,7 +243,7 @@ lwObject *lwGetObject( char *filename, picoMemStream_t *fp, unsigned int *failID if ( !node ) { goto Fail; } - lwListAdd( &object->clip, node ); + lwListAdd( (void **) &object->clip, node ); object->nclips++; break; @@ -252,7 +252,7 @@ lwObject *lwGetObject( char *filename, picoMemStream_t *fp, unsigned int *failID if ( !node ) { goto Fail; } - lwListAdd( &object->surf, node ); + lwListAdd( (void **) &object->surf, node ); object->nsurfs++; break; diff --git a/libs/picomodel/lwo/lwo2.h b/libs/picomodel/lwo/lwo2.h index 22098c98..9d66412e 100644 --- a/libs/picomodel/lwo/lwo2.h +++ b/libs/picomodel/lwo/lwo2.h @@ -605,10 +605,11 @@ int lwValidateObject5( char *filename, picoMemStream_t *fp, unsigned int *failID /* list.c */ -void lwListFree( void *list, void ( *freeNode )( void * ) ); +typedef void (*ListFreeFunc)(void *); +void lwListFree( void *list, ListFreeFunc freefunc ); void lwListAdd( void **list, void *node ); -void lwListInsert( void **vlist, void *vitem, - int ( *compare )( void *, void * ) ); +typedef int (*ListCompareFunc)(void *, void *); +void lwListInsert( void **vlist, void *vitem, ListCompareFunc comparefunc ); /* vecmath.c */ diff --git a/libs/picomodel/lwo/lwob.c b/libs/picomodel/lwo/lwob.c index 3ae40b43..57cc0c52 100644 --- a/libs/picomodel/lwo/lwob.c +++ b/libs/picomodel/lwo/lwob.c @@ -85,7 +85,7 @@ static int add_clip( char *s, lwClip **clist, int *nclips ){ ( *nclips )++; clip->index = *nclips; - lwListAdd( clist, clip ); + lwListAdd( (void **) clist, clip ); return clip->index; } @@ -132,7 +132,7 @@ static int add_tvel( float pos[], float vel[], lwEnvelope **elist, int *nenvs ){ env->behavior[ 0 ] = BEH_LINEAR; env->behavior[ 1 ] = BEH_LINEAR; - lwListAdd( elist, env ); + lwListAdd( (void **) elist, env ); } *nenvs += 3; @@ -340,43 +340,43 @@ lwSurface *lwGetSurface5( picoMemStream_t *fp, int cksize, lwObject *obj ){ case ID_BTEX: s = getbytes( fp, sz ); tex = get_texture( s ); - lwListAdd( &surf->bump.tex, tex ); + lwListAdd( (void **) &surf->bump.tex, tex ); break; case ID_CTEX: s = getbytes( fp, sz ); tex = get_texture( s ); - lwListAdd( &surf->color.tex, tex ); + lwListAdd( (void **) &surf->color.tex, tex ); break; case ID_DTEX: s = getbytes( fp, sz ); tex = get_texture( s ); - lwListAdd( &surf->diffuse.tex, tex ); + lwListAdd( (void **) &surf->diffuse.tex, tex ); break; case ID_LTEX: s = getbytes( fp, sz ); tex = get_texture( s ); - lwListAdd( &surf->luminosity.tex, tex ); + lwListAdd( (void **) &surf->luminosity.tex, tex ); break; case ID_RTEX: s = getbytes( fp, sz ); tex = get_texture( s ); - lwListAdd( &surf->reflection.val.tex, tex ); + lwListAdd( (void **) &surf->reflection.val.tex, tex ); break; case ID_STEX: s = getbytes( fp, sz ); tex = get_texture( s ); - lwListAdd( &surf->specularity.tex, tex ); + lwListAdd( (void **) &surf->specularity.tex, tex ); break; case ID_TTEX: s = getbytes( fp, sz ); tex = get_texture( s ); - lwListAdd( &surf->transparency.val.tex, tex ); + lwListAdd( (void **) &surf->transparency.val.tex, tex ); break; case ID_TFLG: @@ -489,7 +489,7 @@ lwSurface *lwGetSurface5( picoMemStream_t *fp, int cksize, lwObject *obj ){ goto Fail; } shdr->name = getbytes( fp, sz ); - lwListAdd( &surf->shader, shdr ); + lwListAdd( (void **) &surf->shader, shdr ); surf->nshaders++; break; @@ -734,7 +734,7 @@ lwObject *lwGetObject5( char *filename, picoMemStream_t *fp, unsigned int *failI if ( !node ) { goto Fail; } - lwListAdd( &object->surf, node ); + lwListAdd( (void **) &object->surf, node ); object->nsurfs++; break; diff --git a/libs/picomodel/lwo/pntspols.c b/libs/picomodel/lwo/pntspols.c index b54a6fab..965ebda8 100644 --- a/libs/picomodel/lwo/pntspols.c +++ b/libs/picomodel/lwo/pntspols.c @@ -396,7 +396,7 @@ int lwResolvePolySurfaces( lwPolygonList *polygon, lwTagList *tlist, return 0; } strcpy( s[ index ]->name, tlist->tag[ index ] ); - lwListAdd( surf, s[ index ] ); + lwListAdd( (void **) surf, s[ index ] ); *nsurfs = *nsurfs + 1; } polygon->pol[ i ].surf = s[ index ]; diff --git a/libs/picomodel/lwo/surface.c b/libs/picomodel/lwo/surface.c index 07ce4d62..4965ae42 100644 --- a/libs/picomodel/lwo/surface.c +++ b/libs/picomodel/lwo/surface.c @@ -90,18 +90,18 @@ void lwFreeSurface( lwSurface *surf ){ _pico_free( surf->srcname ); } - lwListFree( surf->shader, lwFreePlugin ); + lwListFree( surf->shader, (ListFreeFunc) lwFreePlugin ); - lwListFree( surf->color.tex, lwFreeTexture ); - lwListFree( surf->luminosity.tex, lwFreeTexture ); - lwListFree( surf->diffuse.tex, lwFreeTexture ); - lwListFree( surf->specularity.tex, lwFreeTexture ); - lwListFree( surf->glossiness.tex, lwFreeTexture ); - lwListFree( surf->reflection.val.tex, lwFreeTexture ); - lwListFree( surf->transparency.val.tex, lwFreeTexture ); - lwListFree( surf->eta.tex, lwFreeTexture ); - lwListFree( surf->translucency.tex, lwFreeTexture ); - lwListFree( surf->bump.tex, lwFreeTexture ); + lwListFree( surf->color.tex, (ListFreeFunc) lwFreeTexture ); + lwListFree( surf->luminosity.tex, (ListFreeFunc) lwFreeTexture ); + lwListFree( surf->diffuse.tex, (ListFreeFunc) lwFreeTexture ); + lwListFree( surf->specularity.tex, (ListFreeFunc) lwFreeTexture ); + lwListFree( surf->glossiness.tex, (ListFreeFunc) lwFreeTexture ); + lwListFree( surf->reflection.val.tex, (ListFreeFunc) lwFreeTexture ); + lwListFree( surf->transparency.val.tex, (ListFreeFunc) lwFreeTexture ); + lwListFree( surf->eta.tex, (ListFreeFunc) lwFreeTexture ); + lwListFree( surf->translucency.tex, (ListFreeFunc) lwFreeTexture ); + lwListFree( surf->bump.tex, (ListFreeFunc) lwFreeTexture ); _pico_free( surf ); } @@ -814,7 +814,7 @@ static int add_texture( lwSurface *surf, lwTexture *tex ){ default: return 0; } - lwListInsert( list, tex, compare_textures ); + lwListInsert( (void **) list, tex, (ListCompareFunc) compare_textures ); return 1; } @@ -1054,7 +1054,7 @@ lwSurface *lwGetSurface( picoMemStream_t *fp, int cksize ){ if ( !shdr ) { goto Fail; } - lwListInsert( &surf->shader, shdr, compare_shaders ); + lwListInsert( (void **) &surf->shader, shdr, (ListCompareFunc) compare_shaders ); ++surf->nshaders; set_flen( 4 + get_flen() ); break; diff --git a/libs/picomodel/pm_fm.c b/libs/picomodel/pm_fm.c index 9201e27e..a4251337 100644 --- a/libs/picomodel/pm_fm.c +++ b/libs/picomodel/pm_fm.c @@ -350,7 +350,7 @@ static picoModel_t *_fm_load( PM_PARAMS_LOAD ){ texCoord->t = _pico_little_short( texCoord[i].t ); } // set Skin Name - strncpy( skinname, (unsigned char *) fm.fm_skin, FM_SKINPATHSIZE ); + strncpy( skinname, (char *) fm.fm_skin, FM_SKINPATHSIZE ); #ifdef FM_VERBOSE_DBG // Print out md2 values diff --git a/libs/picomodel/pm_md2.c b/libs/picomodel/pm_md2.c index bb3f6f11..c1011cfb 100644 --- a/libs/picomodel/pm_md2.c +++ b/libs/picomodel/pm_md2.c @@ -431,7 +431,7 @@ static picoModel_t *_md2_load( PM_PARAMS_LOAD ){ } // set Skin Name - strncpy( skinname, ( bb + md2->ofsSkins ), MD2_MAX_SKINNAME ); + strncpy( skinname, (char *) ( bb + md2->ofsSkins ), MD2_MAX_SKINNAME ); // Print out md2 values _pico_printf( PICO_VERBOSE,"Skins: %d Verts: %d STs: %d Triangles: %d Frames: %d\nSkin Name \"%s\"\n", md2->numSkins, md2->numXYZ, md2->numST, md2->numTris, md2->numFrames, skinname ); diff --git a/libs/splines/math_vector.cpp b/libs/splines/math_vector.cpp index a7d43673..009c116e 100644 --- a/libs/splines/math_vector.cpp +++ b/libs/splines/math_vector.cpp @@ -29,7 +29,9 @@ #include #include +#ifndef M_PI #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h +#endif #define LERP_DELTA 1e-6 diff --git a/libs/splines/q_shared.cpp b/libs/splines/q_shared.cpp index 8a93df1e..fba03871 100644 --- a/libs/splines/q_shared.cpp +++ b/libs/splines/q_shared.cpp @@ -697,7 +697,10 @@ void QDECL Com_sprintf( char *dest, int size, const char *fmt, ... ) { va_start( argptr,fmt ); len = vsprintf( bigbuffer,fmt,argptr ); va_end( argptr ); - if ( len >= sizeof( bigbuffer ) ) { + if ( len < 0 ) { + Com_Error( ERR_FATAL, "Com_sprintf: failed to write bigbuffer" ); + } + if ( (unsigned) len >= sizeof( bigbuffer ) ) { Com_Error( ERR_FATAL, "Com_sprintf: overflowed bigbuffer" ); } if ( len >= size ) { @@ -716,7 +719,7 @@ void QDECL Com_sprintf( char *dest, int size, const char *fmt, ... ) { FIXME: make this buffer size safe someday ============ */ -char * QDECL va( char *format, ... ) { +char * QDECL va( const char *format, ... ) { va_list argptr; static char string[2][32000]; // in case va is called by nested functions static int index = 0; @@ -758,7 +761,7 @@ char *Info_ValueForKey( const char *s, const char *key ) { char *o; if ( !s || !key ) { - return ""; + return const_cast(""); } if ( strlen( s ) >= MAX_INFO_STRING ) { @@ -775,7 +778,7 @@ char *Info_ValueForKey( const char *s, const char *key ) { while ( *s != '\\' ) { if ( !*s ) { - return ""; + return const_cast(""); } *o++ = *s++; } @@ -800,7 +803,7 @@ char *Info_ValueForKey( const char *s, const char *key ) { s++; } - return ""; + return const_cast(""); } diff --git a/libs/splines/q_shared.h b/libs/splines/q_shared.h index 16397b35..d194615d 100644 --- a/libs/splines/q_shared.h +++ b/libs/splines/q_shared.h @@ -642,7 +642,7 @@ float BigFloat( float l ); float LittleFloat( float l ); void Swap_Init( void ); -char * QDECL va( char *format, ... ); +char * QDECL va( const char *format, ... ); #ifdef __cplusplus } diff --git a/libs/splines/splines.cpp b/libs/splines/splines.cpp index b9b7c0c9..2d176550 100644 --- a/libs/splines/splines.cpp +++ b/libs/splines/splines.cpp @@ -750,6 +750,8 @@ void idCameraDef::buildCamera() { break; */ } + default: + break; } } diff --git a/plugins/eclassfgd/plugin.cpp b/plugins/eclassfgd/plugin.cpp index 8c39bff5..baff99ce 100644 --- a/plugins/eclassfgd/plugin.cpp +++ b/plugins/eclassfgd/plugin.cpp @@ -187,7 +187,7 @@ const char* CSynapseClientFGD::GetInfo(){ #define CLASS_POINTCLASS 2 #define CLASS_SOLIDCLASS 3 -char *classnames[] = {"NOT DEFINED","BaseClass","PointClass","SolidClass"}; +const char *classnames[] = {"NOT DEFINED","BaseClass","PointClass","SolidClass"}; #define OPTION_NOOPTION 0 #define OPTION_STRING 1 @@ -195,7 +195,7 @@ char *classnames[] = {"NOT DEFINED","BaseClass","PointClass","SolidClass"}; #define OPTION_INTEGER 3 #define OPTION_FLAGS 4 -char *optionnames[] = {"NOT DEFINED","String","Choices","Integer","Flags"}; +const char *optionnames[] = {"NOT DEFINED","String","Choices","Integer","Flags"}; typedef struct choice_s { int value; @@ -244,7 +244,7 @@ char *strlower( char *start ){ return start; } -char *addstr( char *dest,char *source ){ +char *addstr( char *dest,const char *source ){ if ( dest ) { char *ptr; int len = strlen( dest ); diff --git a/plugins/image/lbmlib.cpp b/plugins/image/lbmlib.cpp index 8d136cec..e4d54e11 100644 --- a/plugins/image/lbmlib.cpp +++ b/plugins/image/lbmlib.cpp @@ -743,17 +743,17 @@ void LoadImage( const char *name, byte ** pic, int *width, int *height ){ return; } - if ( !g_strcasecmp( name + len - 4, ".tga" ) ) { + if ( !g_ascii_strcasecmp( name + len - 4, ".tga" ) ) { LoadTGA( name, pic, width, height ); } - else if ( !g_strcasecmp( name + len - 4, ".pcx" ) ) { + else if ( !g_ascii_strcasecmp( name + len - 4, ".pcx" ) ) { LoadPCX32( name, pic, width, height ); } - else if ( !g_strcasecmp( name + len - 4, ".bmp" ) ) { + else if ( !g_ascii_strcasecmp( name + len - 4, ".bmp" ) ) { LoadBMP( name, pic, width, height ); } /* - else if (!g_strcasecmp (name + len - 4, ".jpg")) + else if (!g_ascii_strcasecmp (name + len - 4, ".jpg")) { LoadJPG (name, pic, width, height); } diff --git a/plugins/imagehl/lbmlib.cpp b/plugins/imagehl/lbmlib.cpp index beb83b6d..c34c22df 100644 --- a/plugins/imagehl/lbmlib.cpp +++ b/plugins/imagehl/lbmlib.cpp @@ -586,19 +586,19 @@ void LoadImage( const char *name, byte ** pic, int *width, int *height ){ } #ifdef USE_HLW - if ( *pic == NULL && !g_strcasecmp( name + len - 4, ".hlw" ) ) { + if ( *pic == NULL && !g_ascii_strcasecmp( name + len - 4, ".hlw" ) ) { LoadHLW( name, pic, width, height ); } #endif #ifdef USE_MIP - if ( *pic == NULL && !g_strcasecmp( name + len - 4, ".mip" ) ) { + if ( *pic == NULL && !g_ascii_strcasecmp( name + len - 4, ".mip" ) ) { LoadMIP( name, pic, width, height ); } #endif #ifdef USE_IDSP - if ( *pic == NULL && !g_strcasecmp( name + len - 4, ".spr" ) ) { + if ( *pic == NULL && !g_ascii_strcasecmp( name + len - 4, ".spr" ) ) { LoadIDSP( name, pic, width, height ); } #endif diff --git a/plugins/imagem8/m8.cpp b/plugins/imagem8/m8.cpp index 6735ffc8..4bf1f118 100644 --- a/plugins/imagem8/m8.cpp +++ b/plugins/imagem8/m8.cpp @@ -54,7 +54,7 @@ void LoadM8( const char *name, unsigned char **pic, int *width, int *height ){ } } strcat( text_buf, ".m8" ); - if ( length = vfsLoadFile( (char *) text_buf, (void **) &m8_file_buffer, 0 ) == (unsigned int) -1 ) { + if ( ( length = vfsLoadFile( (char *) text_buf, (void **) &m8_file_buffer, 0 ) ) == (unsigned int) -1 ) { Sys_Printf( "Unable to open file %s\n",name ); return; } diff --git a/plugins/model/cpicomodel.h b/plugins/model/cpicomodel.h index b893003c..a5556f24 100644 --- a/plugins/model/cpicomodel.h +++ b/plugins/model/cpicomodel.h @@ -47,7 +47,7 @@ CPicoModel( const Str& name ); CPicoModel( const Str& name, const int frame ); CPicoModel( const char *name, const int frame ); ~CPicoModel(); -void CPicoModel::load( const char *name, const int frame ); +void load( const char *name, const int frame ); void IncRef(){ ++m_refcount; diff --git a/plugins/shaders/shaders.cpp b/plugins/shaders/shaders.cpp index 5b89112a..bbe6a531 100644 --- a/plugins/shaders/shaders.cpp +++ b/plugins/shaders/shaders.cpp @@ -240,7 +240,7 @@ char *ShaderNameLookup( patchMesh_t * patch ){ } } Sys_Printf( "ERROR: failed to lookup name in ShaderNameLookup??\n" ); - return SHADER_NOT_FOUND; + return const_cast(SHADER_NOT_FOUND); } //++timo end clean diff --git a/plugins/textool/TexTool.cpp b/plugins/textool/TexTool.cpp index f5612dbd..c173c2fc 100644 --- a/plugins/textool/TexTool.cpp +++ b/plugins/textool/TexTool.cpp @@ -828,7 +828,7 @@ extern "C" void QERPlug_Dispatch( const char* p, vec3_t vMin, vec3_t vMax, bool if ( !g_pToolWnd ) { g_pToolWnd = g_UITable.m_pfnCreateGLWindow(); g_pToolWnd->setSizeParm( 300,300 ); - g_pToolWnd->setName( "TexTool" ); + g_pToolWnd->setName( const_cast("TexTool") ); // g_Listener is a static class, we need to bump the refCount to avoid premature release problems g_Listen.IncRef(); // setListener will incRef on the listener too diff --git a/plugins/vfspak/vfs.cpp b/plugins/vfspak/vfs.cpp index 08e0bc13..47f9b829 100644 --- a/plugins/vfspak/vfs.cpp +++ b/plugins/vfspak/vfs.cpp @@ -164,7 +164,7 @@ static void vfsInitPakFile( const char *filename ){ // fix filename vfsFixDOSName( file->entry.filename ); - g_strdown( file->entry.filename ); + strlwr( file->entry.filename ); //g_FuncTable.m_pfnSysPrintf("vfs file from pak: %s\n", file->entry.filename); } } @@ -183,7 +183,7 @@ static GSList* vfsGetListInternal( const char *dir, const char *ext, bool direct dirname[0] = '\0'; if ( dir != NULL ) { strcat( dirname, dir ); - g_strdown( dirname ); + strlwr( dirname ); vfsFixDOSName( dirname ); vfsAddSlash( dirname ); Sys_Printf( "vfs dirname_1: %s\n", dirname ); @@ -198,7 +198,7 @@ static GSList* vfsGetListInternal( const char *dir, const char *ext, bool direct else{ extension[0] = '\0'; } - g_strdown( extension ); + strlwr( extension ); for ( lst = g_pakFiles; lst != NULL; lst = g_slist_next( lst ) ) { @@ -261,7 +261,7 @@ static GSList* vfsGetListInternal( const char *dir, const char *ext, bool direct { strcpy( dirname, g_strDirs[i] ); strcat( dirname, dir ); - g_strdown( dirname ); + strlwr( dirname ); vfsFixDOSName( dirname ); vfsAddSlash( dirname ); @@ -291,7 +291,7 @@ static GSList* vfsGetListInternal( const char *dir, const char *ext, bool direct dirlist = g_strdup( name ); - g_strdown( dirlist ); + strlwr( dirlist ); char *ptr_ext = strrchr( dirlist, '.' ); if ( ext == NULL @@ -473,7 +473,7 @@ int vfsGetFileCount( const char *filename, int flag ){ strcpy( fixed, filename ); vfsFixDOSName( fixed ); - g_strdown( fixed ); + strlwr( fixed ); for ( lst = g_pakFiles; lst != NULL; lst = g_slist_next( lst ) ) { @@ -505,7 +505,7 @@ int vfsLoadFile( const char *filename, void **bufferptr, int index ){ *bufferptr = NULL; strcpy( fixed, filename ); vfsFixDOSName( fixed ); - g_strdown( fixed ); + strlwr( fixed ); for ( i = 0; i < g_numDirs; i++ ) { @@ -703,7 +703,7 @@ char* vfsGetFullPath( const char *in, int index, int flag ){ strcpy( fixed, in ); vfsFixDOSName( fixed ); - g_strdown( fixed ); + strlwr( fixed ); for ( lst = g_pakFiles; lst != NULL; lst = g_slist_next( lst ) ) { diff --git a/plugins/vfspk3/vfs.cpp b/plugins/vfspk3/vfs.cpp index cf6e36db..51c64cde 100644 --- a/plugins/vfspk3/vfs.cpp +++ b/plugins/vfspk3/vfs.cpp @@ -144,7 +144,7 @@ static void vfsInitPakFile( const char *filename ){ g_pakFiles = g_slist_append( g_pakFiles, file ); vfsFixDOSName( filename_inzip ); - g_strdown( filename_inzip ); + strlwr( filename_inzip ); file->name = g_strdup( filename_inzip ); file->size = file_info.uncompressed_size; @@ -173,7 +173,7 @@ static GSList* vfsGetListInternal( const char *refdir, const char *ext, bool dir if ( refdir != NULL ) { strcpy( dirname, refdir ); - g_strdown( dirname ); + strlwr( dirname ); vfsFixDOSName( dirname ); vfsAddSlash( dirname ); } @@ -188,7 +188,7 @@ static GSList* vfsGetListInternal( const char *refdir, const char *ext, bool dir else{ extension[0] = '\0'; } - g_strdown( extension ); + strlwr( extension ); for ( lst = g_pakFiles; lst != NULL; lst = g_slist_next( lst ) ) { @@ -278,7 +278,7 @@ static GSList* vfsGetListInternal( const char *refdir, const char *ext, bool dir dirlist = g_strdup( name ); - g_strdown( dirlist ); + strlwr( dirlist ); char *ptr_ext = strrchr( dirlist, '.' ); if ( ext == NULL @@ -534,7 +534,7 @@ int vfsGetFileCount( const char *filename, int flag ){ strcpy( fixed, filename ); vfsFixDOSName( fixed ); - g_strdown( fixed ); + strlwr( fixed ); if ( !flag || ( flag & VFS_SEARCH_PAK ) ) { for ( lst = g_pakFiles; lst != NULL; lst = g_slist_next( lst ) ) @@ -598,7 +598,7 @@ int vfsLoadFile( const char *filename, void **bufferptr, int index ){ *bufferptr = NULL; strcpy( fixed, filename ); vfsFixDOSName( fixed ); - g_strdown( fixed ); + strlwr( fixed ); for ( i = 0; i < g_numDirs; i++ ) { @@ -788,7 +788,7 @@ char* vfsGetFullPath( const char *in, int index, int flag ){ strcpy( fixed, in ); vfsFixDOSName( fixed ); - g_strdown( fixed ); + strlwr( fixed ); for ( lst = g_pakFiles; lst != NULL; lst = g_slist_next( lst ) ) { diff --git a/plugins/vfsqlpk3/vfs.cpp b/plugins/vfsqlpk3/vfs.cpp index f08f11bf..160c860b 100644 --- a/plugins/vfsqlpk3/vfs.cpp +++ b/plugins/vfsqlpk3/vfs.cpp @@ -144,7 +144,7 @@ static void vfsInitPakFile( const char *filename ){ g_pakFiles = g_slist_append( g_pakFiles, file ); vfsFixDOSName( filename_inzip ); - g_strdown( filename_inzip ); + strlwr( filename_inzip ); file->name = g_strdup( filename_inzip ); file->size = file_info.uncompressed_size; @@ -173,7 +173,7 @@ static GSList* vfsGetListInternal( const char *refdir, const char *ext, bool dir if ( refdir != NULL ) { strcpy( dirname, refdir ); - g_strdown( dirname ); + strlwr( dirname ); vfsFixDOSName( dirname ); vfsAddSlash( dirname ); } @@ -188,7 +188,7 @@ static GSList* vfsGetListInternal( const char *refdir, const char *ext, bool dir else{ extension[0] = '\0'; } - g_strdown( extension ); + strlwr( extension ); for ( lst = g_pakFiles; lst != NULL; lst = g_slist_next( lst ) ) { @@ -278,7 +278,7 @@ static GSList* vfsGetListInternal( const char *refdir, const char *ext, bool dir dirlist = g_strdup( name ); - g_strdown( dirlist ); + strlwr( dirlist ); char *ptr_ext = strrchr( dirlist, '.' ); if ( ext == NULL @@ -534,7 +534,7 @@ int vfsGetFileCount( const char *filename, int flag ){ strcpy( fixed, filename ); vfsFixDOSName( fixed ); - g_strdown( fixed ); + strlwr( fixed ); if ( !flag || ( flag & VFS_SEARCH_PAK ) ) { for ( lst = g_pakFiles; lst != NULL; lst = g_slist_next( lst ) ) @@ -598,7 +598,7 @@ int vfsLoadFile( const char *filename, void **bufferptr, int index ){ *bufferptr = NULL; strcpy( fixed, filename ); vfsFixDOSName( fixed ); - g_strdown( fixed ); + strlwr( fixed ); for ( i = 0; i < g_numDirs; i++ ) { @@ -788,7 +788,7 @@ char* vfsGetFullPath( const char *in, int index, int flag ){ strcpy( fixed, in ); vfsFixDOSName( fixed ); - g_strdown( fixed ); + strlwr( fixed ); for ( lst = g_pakFiles; lst != NULL; lst = g_slist_next( lst ) ) { diff --git a/plugins/vfswad/vfs.cpp b/plugins/vfswad/vfs.cpp index 37950dd8..94f42d40 100644 --- a/plugins/vfswad/vfs.cpp +++ b/plugins/vfswad/vfs.cpp @@ -185,7 +185,7 @@ static void vfsInitPakFile( const char *filename ){ g_pakFiles = g_slist_append( g_pakFiles, file ); vfsFixDOSName( filename_inwad ); - g_strdown( filename_inwad ); + strlwr( filename_inwad ); // texturenames in wad files don't have an extensions or paths, so we must add them! if ( wf->lpLump->type == WAD2_TYPE_MIP ) { @@ -221,7 +221,7 @@ static GSList* vfsGetListInternal( const char *refdir, const char *ext, bool dir if ( refdir != NULL ) { strcpy( dirname, refdir ); - g_strdown( dirname ); + strlwr( dirname ); vfsFixDOSName( dirname ); vfsAddSlash( dirname ); } @@ -236,7 +236,7 @@ static GSList* vfsGetListInternal( const char *refdir, const char *ext, bool dir else{ extension[0] = '\0'; } - g_strdown( extension ); + strlwr( extension ); for ( lst = g_pakFiles; lst != NULL; lst = g_slist_next( lst ) ) { @@ -326,7 +326,7 @@ static GSList* vfsGetListInternal( const char *refdir, const char *ext, bool dir char* direntry = g_strdup( name ); - g_strdown( direntry ); + strlwr( direntry ); char *ptr_ext = strrchr( direntry, '.' ); @@ -451,7 +451,7 @@ int vfsGetFileCount( const char *filename, int flag ){ strcpy( fixed, filename ); vfsFixDOSName( fixed ); - g_strdown( fixed ); + strlwr( fixed ); if ( !flag || ( flag & VFS_SEARCH_PAK ) ) { for ( lst = g_pakFiles; lst != NULL; lst = g_slist_next( lst ) ) @@ -515,7 +515,7 @@ int vfsLoadFile( const char *filename, void **bufferptr, int index ){ *bufferptr = NULL; strcpy( fixed, filename ); vfsFixDOSName( fixed ); - g_strdown( fixed ); + strlwr( fixed ); for ( i = 0; i < g_numDirs; i++ ) { @@ -695,7 +695,7 @@ char* vfsGetFullPath( const char *in, int index, int flag ){ strcpy( fixed, in ); vfsFixDOSName( fixed ); - g_strdown( fixed ); + strlwr( fixed ); for ( lst = g_pakFiles; lst != NULL; lst = g_slist_next( lst ) ) { diff --git a/radiant/feedback.cpp b/radiant/feedback.cpp index 978f8f6f..e36b6ecd 100644 --- a/radiant/feedback.cpp +++ b/radiant/feedback.cpp @@ -321,7 +321,7 @@ void CDbgDlg::BuildDialog(){ { GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 0, NULL ); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 0, (char *) NULL ); gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column ); } diff --git a/radiant/groupdialog.cpp b/radiant/groupdialog.cpp index 03a15de3..440a36f8 100644 --- a/radiant/groupdialog.cpp +++ b/radiant/groupdialog.cpp @@ -1261,7 +1261,7 @@ void GroupDlg::Create(){ { GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "Key", renderer, "text", 0, NULL ); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "Key", renderer, "text", 0, (char *) NULL ); gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column ); } @@ -1362,13 +1362,13 @@ void GroupDlg::Create(){ { GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 0, NULL ); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 0, (char *) NULL ); gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column ); } { GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 1, NULL ); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 1, (char *) NULL ); gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column ); } diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index 75d1cdac..f55e9534 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -564,7 +564,7 @@ void DoProjectSettings(){ gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE ); GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 0, NULL ); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 0, (char *) NULL ); gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column ); GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) ); @@ -1328,14 +1328,14 @@ void DoMapInfo(){ { GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( _( "Entity" ), renderer, "text", 0, NULL ); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( _( "Entity" ), renderer, "text", 0, (char *) NULL ); gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column ); gtk_tree_view_column_set_sort_column_id( column, 0 ); } { GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( _( "Count" ), renderer, "text", 1, NULL ); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( _( "Count" ), renderer, "text", 1, (char *) NULL ); gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column ); gtk_tree_view_column_set_sort_column_id( column, 1 ); } @@ -1521,7 +1521,7 @@ void DoEntityList(){ { GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 0, NULL ); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 0, (char *) NULL ); gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column ); } @@ -1608,13 +1608,13 @@ void DoEntityList(){ { GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( _( "Key" ), renderer, "text", 0, NULL ); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( _( "Key" ), renderer, "text", 0, (char *) NULL ); gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column ); } { GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( _( "Value" ), renderer, "text", 1, NULL ); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( _( "Value" ), renderer, "text", 1, (char *) NULL ); gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column ); } @@ -2718,13 +2718,13 @@ void DoCommandListDlg(){ { GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( _( "Command" ), renderer, "text", 0, NULL ); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( _( "Command" ), renderer, "text", 0, (char *) NULL ); gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column ); } { GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( _( "Key" ), renderer, "text", 1, NULL ); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( _( "Key" ), renderer, "text", 1, (char *) NULL ); gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column ); } @@ -2860,7 +2860,7 @@ void DoTextureListDlg(){ { GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 0, NULL ); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 0, (char *) NULL ); gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column ); } @@ -3125,7 +3125,7 @@ void DoScriptsDlg(){ { GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 0, NULL ); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 0, (char *) NULL ); gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column ); } diff --git a/radiant/gtkmisc.cpp b/radiant/gtkmisc.cpp index d6b1f675..10da1e57 100644 --- a/radiant/gtkmisc.cpp +++ b/radiant/gtkmisc.cpp @@ -199,14 +199,19 @@ unsigned char *load_bitmap_file( const char* filename, guint16 *width, guint16 * size_t rc; rc = fread( &m1, 1, 1, fp ); - m_bytesRead++; - if ( rc == -1 ) { + if ( rc != 1 ) { fclose( fp ); return NULL; } + m_bytesRead++; rc = fread( &m2, 1, 1, fp ); + if ( rc != 1) { + fclose( fp ); + return NULL; + } m_bytesRead++; + if ( ( m1 != 'B' ) || ( m2 != 'M' ) ) { fclose( fp ); return NULL; @@ -1518,14 +1523,14 @@ const char* file_dialog( void *parent, gboolean open, const char* title, const c GTK_RESPONSE_CANCEL, open ? GTK_STOCK_OPEN : GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, - NULL ); + (char *) NULL ); gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER( file_sel ), new_path ); delete[] new_path; // Setting the file chooser dialog to modal and centering it on the parent is done automatically. if ( pattern != NULL ) { - GtkFileFilter *allTypesFilter = gtk_file_filter_new(); + //GtkFileFilter *allTypesFilter = gtk_file_filter_new(); // http://www.gtkforums.com/viewtopic.php?p=6044 //gtk_file_filter_set_name( allTypesFilter, "All supported types" ); for ( int i = 0; i < typelist.GetNumTypes(); i++ ) { @@ -1634,7 +1639,7 @@ char* WINAPI dir_dialog( void *parent, const char* title, const char* path ){ GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, - NULL ); + (char *) NULL ); if ( path != NULL ) { gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER( file_sel ), path ); diff --git a/radiant/main.cpp b/radiant/main.cpp index b0bc7692..5ba7b518 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -222,7 +222,7 @@ void loki_initpaths( char *argv0 ){ home = loki_gethomedir(); if ( home == NULL ) { - home = "."; + home = const_cast("."); } if ( *game_name == 0 ) { /* Game name defaults to argv[0] */ @@ -412,7 +412,8 @@ void error_redirect( const gchar *domain, GLogLevelFlags log_level, const gchar #define LOCALEDIR "lang" int main( int argc, char* argv[] ) { - char *libgl, *ptr; + const char *libgl; + char *ptr; int i, j, k; @@ -1170,7 +1171,7 @@ void RunBsp( char *command ){ Error( "CreateProcess failed" ); break; case 0: - execlp( batpath, batpath, NULL ); + execlp( batpath, batpath, (char *) NULL ); printf( "execlp error !" ); _exit( 0 ); break; diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 43a510ed..959e6dfe 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -3060,6 +3060,7 @@ void RefreshModelSkin( GSList **pModels, entitymodel_t *model ){ #endif // and also keeping it so we have an actual count of empty models + // jdolan: FIXME uhm, shouldn't we track the return value from this append? g_slist_append( *pModels, model ); return; } diff --git a/radiant/mainframe.h b/radiant/mainframe.h index 3caf5840..f0b14d17 100644 --- a/radiant/mainframe.h +++ b/radiant/mainframe.h @@ -44,11 +44,11 @@ const int RAD_PRESS = 0x08; struct SCommandInfo { - char* m_strCommand; + const char* m_strCommand; unsigned int m_nKey; unsigned int m_nModifiers; unsigned int m_nCommand; - char* m_strMenu; + const char* m_strMenu; }; struct SKeyInfo diff --git a/radiant/parse.cpp b/radiant/parse.cpp index c37b74e7..ecfc4c4b 100644 --- a/radiant/parse.cpp +++ b/radiant/parse.cpp @@ -27,7 +27,7 @@ char* script_p; int scriptline; // Hydra: added support for GetTokenExtra() -char *currentdelimiters; +const char *currentdelimiters; qboolean script_keepdelimiter; void StartTokenParsing( char *data ){ @@ -179,9 +179,9 @@ void UngetToken( void ){ GetToken(false); // contains "2" ============== */ -qboolean GetTokenExtra( qboolean crossline,char *delimiters, qboolean keepdelimiter ){ +qboolean GetTokenExtra( qboolean crossline,const char *delimiters, qboolean keepdelimiter ){ qboolean result; - char *olddelimiters = currentdelimiters; // store it + const char *olddelimiters = currentdelimiters; // store it currentdelimiters = delimiters; // change the delimiters script_keepdelimiter = keepdelimiter; // change the global flag diff --git a/radiant/parse.h b/radiant/parse.h index b85d924a..0f75dfd7 100644 --- a/radiant/parse.h +++ b/radiant/parse.h @@ -31,4 +31,4 @@ void StartTokenParsing( char *data ); qboolean GetToken( qboolean crossline ); void UngetToken( void ); qboolean TokenAvailable( void ); -qboolean GetTokenExtra( qboolean crossline,char *delimiters,qboolean keepdelimiter ); // Hydra: added support for GetTokenExtra() +qboolean GetTokenExtra( qboolean crossline,const char *delimiters,qboolean keepdelimiter ); // Hydra: added support for GetTokenExtra() diff --git a/radiant/points.cpp b/radiant/points.cpp index 9a84f6c5..7f31e401 100644 --- a/radiant/points.cpp +++ b/radiant/points.cpp @@ -226,5 +226,5 @@ void CPointfile::saxCharacters( message_info_t *ctx, const xmlChar *ch, int len } char * CPointfile::getName(){ - return "Map is leaked"; + return const_cast("Map is leaked"); } diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index d9cff7d6..1af3d6c8 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -1583,7 +1583,7 @@ void PrefsDlg::BuildDialog(){ { GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( _( "Preferences" ), renderer, "text", 0, NULL ); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( _( "Preferences" ), renderer, "text", 0, (char *) NULL ); gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column ); } diff --git a/radiant/qe3.cpp b/radiant/qe3.cpp index 28fd7ec8..0ece4e7f 100644 --- a/radiant/qe3.cpp +++ b/radiant/qe3.cpp @@ -1083,7 +1083,7 @@ char *argv[MAX_NUM_ARGVS]; */ void ParseCommandLine( char *lpCmdLine ){ argc = 1; - argv[0] = "programname"; + argv[0] = const_cast("programname"); while ( *lpCmdLine && ( argc < MAX_NUM_ARGVS ) ) { @@ -1741,7 +1741,7 @@ extern "C" void Sys_FPrintf_VA( int level, const char *text, va_list args ) { tag = standard_tag; break; } - gtk_text_buffer_insert_with_tags( buffer, &iter, buf, length, tag, NULL ); + gtk_text_buffer_insert_with_tags( buffer, &iter, buf, length, tag, (char *) NULL ); gtk_text_view_scroll_mark_onscreen( GTK_TEXT_VIEW( g_qeglobals_gui.d_edit ), end ); diff --git a/radiant/qgl.c b/radiant/qgl.c index ce4e5fb4..cf42a3b6 100644 --- a/radiant/qgl.c +++ b/radiant/qgl.c @@ -1118,10 +1118,10 @@ const GLubyte* WINAPI gluErrorString( GLenum errCode ){ for ( search = 0; glu_errlist[search].errstr; search++ ) { if ( errCode == glu_errlist[search].errnum ) { - return (const char *)glu_errlist[search].errstr; + return (GLubyte *) glu_errlist[search].errstr; } } //end for - return "Unknown error"; + return (GLubyte *) "Unknown error"; } #ifdef ATIHACK_812 diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index a4dc381c..d6409bd6 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -611,7 +611,7 @@ void FillTextureMenu( GSList** pArray ){ ExtractFileName( (char*)l_shaderfiles->data, shaderfile ); StripExtension( shaderfile ); - g_strdown( shaderfile ); + strlwr( shaderfile ); for ( GSList *tmp = texdirs; tmp; tmp = g_slist_next( tmp ) ) if ( !strcasecmp( (char*)tmp->data, shaderfile ) ) { diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index d350fd9f..55b4ae96 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -437,7 +437,7 @@ void CreateEntityFromName( const char* name, const vec3_t origin ){ } } -void CreateRightClickEntity( XYWnd* pWnd, int x, int y, char* pName ){ +void CreateRightClickEntity( XYWnd* pWnd, int x, int y, const char* pName ){ int height = pWnd->GetWidget()->allocation.height; vec3_t point; pWnd->SnapToPoint( x, height - 1 - y, point ); @@ -918,7 +918,7 @@ void XYWnd::SetPointMode( bool b ){ void XYWnd::SetViewType( int n ){ m_nViewType = n; if ( g_pParentWnd->CurrentStyle() == MainFrame::eFloating ) { - char* str = "YZ Side"; + const char* str = "YZ Side"; if ( m_nViewType == XY ) { str = "XY Top"; } From 1ec49a4a06b6d26db536fdadb7a871bb9f2593eb Mon Sep 17 00:00:00 2001 From: jdolan Date: Fri, 3 May 2013 02:59:10 -0400 Subject: [PATCH 3/4] Don't ignore return value of g_slist_append. --- radiant/mainframe.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 959e6dfe..3d94b5d4 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -3060,8 +3060,7 @@ void RefreshModelSkin( GSList **pModels, entitymodel_t *model ){ #endif // and also keeping it so we have an actual count of empty models - // jdolan: FIXME uhm, shouldn't we track the return value from this append? - g_slist_append( *pModels, model ); + *pModels = g_slist_append( *pModels, model ); return; } // do we have this model already? From 5ee9bd63f1f43d91eafb97cee59db57f7609d043 Mon Sep 17 00:00:00 2001 From: jdolan Date: Fri, 3 May 2013 03:04:19 -0400 Subject: [PATCH 4/4] Fix a couple Q_strlwr's that slipped through the cracks. --- contrib/gtkgensurf/gensurf.cpp | 2 +- contrib/gtkgensurf/heretic.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/gtkgensurf/gensurf.cpp b/contrib/gtkgensurf/gensurf.cpp index bc31f858..17160aa9 100644 --- a/contrib/gtkgensurf/gensurf.cpp +++ b/contrib/gtkgensurf/gensurf.cpp @@ -117,7 +117,7 @@ bool GenSurfInit(){ basepath = g_FuncTable.m_pfnReadProjectKey("basepath"); if (basepath) { - Q_strlwr (basepath); + strlwr (basepath); if (strstr(basepath,"baseq3")) Game = QUAKE3; else if (strstr (basepath,"baseq2")) diff --git a/contrib/gtkgensurf/heretic.cpp b/contrib/gtkgensurf/heretic.cpp index 00765538..7f24179a 100644 --- a/contrib/gtkgensurf/heretic.cpp +++ b/contrib/gtkgensurf/heretic.cpp @@ -75,7 +75,7 @@ int GetDefSurfaceProps( char *Tex ){ if (NULL != (fpak = fopen(pakfile[Game], "rb"))) { sprintf(path,"textures/%s.m8",Tex); - Q_strlwr(path); + strlwr(path); num=fread(&pakheader,1,sizeof(pak_header_t),fpak); if((size_t)num < sizeof(pak_header_t)) { @@ -116,7 +116,7 @@ int GetDefSurfaceProps( char *Tex ){ // Assume .map will be output to gamedir/maps, then back up // to the gamedir and append /textures. Ugly but it should work strcpy(path,gszMapFile); - Q_strlwr(path); + strlwr(path); p = strstr(path,"maps"); if(!p) return 0; p[0] = '\0';