mirror of
https://github.com/UberGames/GtkRadiant.git
synced 2024-11-24 12:51:28 +00:00
Low hanging fruit: bring the number of compiler warnings down from 264 to 33.
This commit is contained in:
parent
043398589d
commit
a269593afe
54 changed files with 175 additions and 160 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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++ );
|
||||
|
|
|
@ -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<DEntity*> entityList;
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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 ---------
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"))
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 ) );
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 ];
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -29,7 +29,9 @@
|
|||
#include <time.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
|
||||
#endif
|
||||
|
||||
#define LERP_DELTA 1e-6
|
||||
|
||||
|
|
|
@ -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<char*>("");
|
||||
}
|
||||
|
||||
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<char*>("");
|
||||
}
|
||||
*o++ = *s++;
|
||||
}
|
||||
|
@ -800,7 +803,7 @@ char *Info_ValueForKey( const char *s, const char *key ) {
|
|||
s++;
|
||||
}
|
||||
|
||||
return "";
|
||||
return const_cast<char*>("");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -750,6 +750,8 @@ void idCameraDef::buildCamera() {
|
|||
break;
|
||||
*/
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<char*>(SHADER_NOT_FOUND);
|
||||
}
|
||||
//++timo end clean
|
||||
|
||||
|
|
|
@ -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<char*>("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
|
||||
|
|
|
@ -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 ) )
|
||||
{
|
||||
|
|
|
@ -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 ) )
|
||||
{
|
||||
|
|
|
@ -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 ) )
|
||||
{
|
||||
|
|
|
@ -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 ) )
|
||||
{
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -222,7 +222,7 @@ void loki_initpaths( char *argv0 ){
|
|||
|
||||
home = loki_gethomedir();
|
||||
if ( home == NULL ) {
|
||||
home = ".";
|
||||
home = const_cast<char*>(".");
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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<char*>("Map is leaked");
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
|
@ -1083,7 +1083,7 @@ char *argv[MAX_NUM_ARGVS];
|
|||
*/
|
||||
void ParseCommandLine( char *lpCmdLine ){
|
||||
argc = 1;
|
||||
argv[0] = "programname";
|
||||
argv[0] = const_cast<char*>("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 );
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 ) ) {
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue