From 265c42d5a54ec436f9463e79e000b5a566a0b296 Mon Sep 17 00:00:00 2001 From: TimePath Date: Sun, 6 Aug 2017 18:41:54 +1000 Subject: [PATCH] Remove -Wno-pedantic --- CMakeLists.txt | 1 - contrib/bobtoolz/DPlane.h | 2 +- contrib/prtview/portals.cpp | 2 +- include/ifilesystem.h | 2 +- include/iselection.h | 2 +- libs/gtkutil/clipboard.cpp | 4 +- libs/picomodel/lwo/clip.c | 4 +- libs/picomodel/lwo/envelope.c | 4 +- libs/picomodel/lwo/lwo2.c | 10 ++-- libs/picomodel/lwo/surface.c | 29 +++++------ libs/uilib/uilib.cpp | 4 +- plugins/archivezip/pkzip.h | 4 +- plugins/entity/eclassmodel.h | 2 +- plugins/entity/light.h | 2 +- tools/quake3/common/threads.c | 2 +- tools/quake3/q3data/3dslib.c | 12 ++--- tools/quake3/q3data/3dslib.h | 94 +++++++++++++++++------------------ tools/quake3/q3data/md3lib.c | 2 +- tools/quake3/q3data/md3lib.h | 2 +- tools/quake3/q3data/video.c | 6 +-- tools/quake3/q3map2/shaders.c | 4 +- 21 files changed, 98 insertions(+), 96 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e1ad1622..db0a1cae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,7 +87,6 @@ addflags("-Wall") addflags("-Wextra") addflags("-pedantic") -addflags("-Wno-pedantic") addflags("-Wno-parentheses") addflags("-Wno-sign-compare") addflags("-Wno-write-strings") diff --git a/contrib/bobtoolz/DPlane.h b/contrib/bobtoolz/DPlane.h index 6e840cdb..88a33584 100644 --- a/contrib/bobtoolz/DPlane.h +++ b/contrib/bobtoolz/DPlane.h @@ -54,7 +54,7 @@ bool operator !=( DPlane& other ); bool operator ==( DPlane& other ); bool IsRedundant( std::list& pointList ); -bool PlaneIntersection( DPlane* pl1, DPlane* pl2, vec3_t out );; +bool PlaneIntersection( DPlane* pl1, DPlane* pl2, vec3_t out ); vec_t DistanceToPoint( vec3_t pnt ); diff --git a/contrib/prtview/portals.cpp b/contrib/prtview/portals.cpp index a896fcd4..c9b80176 100644 --- a/contrib/prtview/portals.cpp +++ b/contrib/prtview/portals.cpp @@ -271,7 +271,7 @@ void CPortals::Load(){ } if ( !portal[n].Build( buf ) ) { - if ( first && sscanf( buf, "%d %d", &test_vals_1, &test_vals_2 ) == 1 ) { // skip additional counts of later data, not needed + if ( first && sscanf( buf, "%d %d", (int *) &test_vals_1, (int *) &test_vals_2 ) == 1 ) { // skip additional counts of later data, not needed // We can count on hint flags being in the file hint_flags = true; continue; diff --git a/include/ifilesystem.h b/include/ifilesystem.h index 70b5da92..f497528f 100644 --- a/include/ifilesystem.h +++ b/include/ifilesystem.h @@ -124,7 +124,7 @@ inline VirtualFileSystem& GlobalFileSystem(){ /// \deprecated Use \c openFile. inline int vfsLoadFile( const char* filename, void** buffer, int index = 0 ){ return static_cast( GlobalFileSystem().loadFile( filename, buffer ) ); -}; +} /// \deprecated Deprecated. inline void vfsFreeFile( void* p ){ diff --git a/include/iselection.h b/include/iselection.h index f5c76310..ba000021 100644 --- a/include/iselection.h +++ b/include/iselection.h @@ -42,7 +42,7 @@ virtual bool isSelected() const = 0; namespace scene { class Instance; -}; +} class InstanceSelectionObserver { diff --git a/libs/gtkutil/clipboard.cpp b/libs/gtkutil/clipboard.cpp index 29148753..7d45bd1a 100644 --- a/libs/gtkutil/clipboard.cpp +++ b/libs/gtkutil/clipboard.cpp @@ -90,8 +90,10 @@ enum RADIANT_CLIPPINGS = 23, }; +static char RADIANT_CLIPPINGS_STR[] = "RADIANT_CLIPPINGS"; + static const GtkTargetEntry clipboard_targets[] = { - { "RADIANT_CLIPPINGS", 0, RADIANT_CLIPPINGS, }, + {RADIANT_CLIPPINGS_STR, 0, RADIANT_CLIPPINGS, }, }; static void clipboard_get( GtkClipboard *clipboard, GtkSelectionData *selection_data, guint info, gpointer data ){ diff --git a/libs/picomodel/lwo/clip.c b/libs/picomodel/lwo/clip.c index 1e68cc1c..6a347f58 100644 --- a/libs/picomodel/lwo/clip.c +++ b/libs/picomodel/lwo/clip.c @@ -20,8 +20,8 @@ void lwFreeClip( lwClip *clip ){ if ( clip ) { - lwListFree( clip->ifilter, (void *) lwFreePlugin ); - lwListFree( clip->pfilter, (void *) lwFreePlugin ); + lwListFree(clip->ifilter, (void (*)(void *)) lwFreePlugin); + lwListFree(clip->pfilter, (void (*)(void *)) lwFreePlugin); switch ( clip->type ) { case ID_STIL: diff --git a/libs/picomodel/lwo/envelope.c b/libs/picomodel/lwo/envelope.c index 8c5bb8fa..27992d49 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, (void *) lwFreePlugin ); + lwListFree(env->cfilter, (void (*)(void *)) lwFreePlugin); _pico_free( env ); } } @@ -105,7 +105,7 @@ lwEnvelope *lwGetEnvelope( picoMemStream_t *fp, int cksize ){ } key->time = getF4( fp ); key->value = getF4( fp ); - lwListInsert( (void **) &env->key, key, (void *) compare_keys ); + lwListInsert((void **) &env->key, key, (int (*)(void *, void *)) compare_keys); env->nkeys++; break; diff --git a/libs/picomodel/lwo/lwo2.c b/libs/picomodel/lwo/lwo2.c index 1bbc7a36..5299d297 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, (void *) lwFreeVMap ); + lwListFree(layer->vmap, (void (*)(void *)) lwFreeVMap); _pico_free( layer ); } } @@ -45,10 +45,10 @@ void lwFreeLayer( lwLayer *layer ){ void lwFreeObject( lwObject *object ){ if ( object ) { - lwListFree( object->layer, (void *) lwFreeLayer ); - lwListFree( object->env, (void *) lwFreeEnvelope ); - lwListFree( object->clip, (void *) lwFreeClip ); - lwListFree( object->surf, (void *) lwFreeSurface ); + lwListFree(object->layer, (void (*)(void *)) lwFreeLayer); + lwListFree(object->env, (void (*)(void *)) lwFreeEnvelope); + lwListFree(object->clip, (void (*)(void *)) lwFreeClip); + lwListFree(object->surf, (void (*)(void *)) lwFreeSurface); lwFreeTags( &object->taglist ); _pico_free( object ); } diff --git a/libs/picomodel/lwo/surface.c b/libs/picomodel/lwo/surface.c index 4b350024..1b2c1fcd 100644 --- a/libs/picomodel/lwo/surface.c +++ b/libs/picomodel/lwo/surface.c @@ -93,18 +93,19 @@ void lwFreeSurface( lwSurface *surf ){ _pico_free( surf->srcname ); } - lwListFree( surf->shader, (void *) lwFreePlugin ); - - lwListFree( surf->color.tex, (void *) lwFreeTexture ); - lwListFree( surf->luminosity.tex, (void *) lwFreeTexture ); - lwListFree( surf->diffuse.tex, (void *) lwFreeTexture ); - lwListFree( surf->specularity.tex, (void *) lwFreeTexture ); - lwListFree( surf->glossiness.tex, (void *) lwFreeTexture ); - lwListFree( surf->reflection.val.tex, (void *) lwFreeTexture ); - lwListFree( surf->transparency.val.tex, (void *) lwFreeTexture ); - lwListFree( surf->eta.tex, (void *) lwFreeTexture ); - lwListFree( surf->translucency.tex, (void *) lwFreeTexture ); - lwListFree( surf->bump.tex, (void *) lwFreeTexture ); + lwListFree(surf->shader, (void (*)(void *)) lwFreePlugin); + + void (*freeTexture)(void *) = (void (*)(void *)) lwFreeTexture; + lwListFree(surf->color.tex, freeTexture); + lwListFree(surf->luminosity.tex, freeTexture); + lwListFree(surf->diffuse.tex, freeTexture); + lwListFree(surf->specularity.tex, freeTexture); + lwListFree(surf->glossiness.tex, freeTexture); + lwListFree(surf->reflection.val.tex, freeTexture); + lwListFree(surf->transparency.val.tex, freeTexture); + lwListFree(surf->eta.tex, freeTexture); + lwListFree(surf->translucency.tex, freeTexture); + lwListFree(surf->bump.tex, freeTexture); _pico_free( surf ); } @@ -817,7 +818,7 @@ static int add_texture( lwSurface *surf, lwTexture *tex ){ default: return 0; } - lwListInsert( (void **) list, tex, ( void *) compare_textures ); + lwListInsert((void **) list, tex, (int (*)(void *, void *)) compare_textures); return 1; } @@ -1057,7 +1058,7 @@ lwSurface *lwGetSurface( picoMemStream_t *fp, int cksize ){ if ( !shdr ) { goto Fail; } - lwListInsert( (void **) &surf->shader, shdr, (void *) compare_shaders ); + lwListInsert((void **) &surf->shader, shdr, (int (*)(void *, void *)) compare_shaders); ++surf->nshaders; set_flen( 4 + get_flen() ); break; diff --git a/libs/uilib/uilib.cpp b/libs/uilib/uilib.cpp index 72da1de0..7aaccfa2 100644 --- a/libs/uilib/uilib.cpp +++ b/libs/uilib/uilib.cpp @@ -359,7 +359,7 @@ namespace ui { for (auto &it : attributes) { gtk_tree_view_column_add_attribute(this, renderer, it.attribute, it.column); } - }; + } IMPL(AccelGroup, GTK_ACCEL_GROUP); @@ -391,6 +391,6 @@ namespace ui { #if GTK_TARGET == 2 return this.connect("expose_event", pFunction, data); #endif - }; + } } diff --git a/plugins/archivezip/pkzip.h b/plugins/archivezip/pkzip.h index 146c4075..01d4b5f2 100644 --- a/plugins/archivezip/pkzip.h +++ b/plugins/archivezip/pkzip.h @@ -98,7 +98,7 @@ inline void istream_read_zip_file_header( SeekableInputStream& istream, zip_file file_header.z_namlen = istream_read_uint16_le( istream ); file_header.z_extras = istream_read_uint16_le( istream ); istream.seek( file_header.z_namlen + file_header.z_extras, SeekableInputStream::cur ); -}; +} /* B. data descriptor * the data descriptor exists only if bit 3 of z_flags is set. It is byte aligned @@ -120,7 +120,7 @@ inline void istream_read_zip_file_trailer( InputStream& istream, zip_file_traile file_trailer.z_crc32 = istream_read_uint32_le( istream ); file_trailer.z_csize = istream_read_uint32_le( istream ); file_trailer.z_usize = istream_read_uint32_le( istream ); -}; +} /* C. central directory structure: diff --git a/plugins/entity/eclassmodel.h b/plugins/entity/eclassmodel.h index bdfd51e3..5dfe2fe9 100644 --- a/plugins/entity/eclassmodel.h +++ b/plugins/entity/eclassmodel.h @@ -25,7 +25,7 @@ namespace scene { class Node; -}; +} class EntityClass; scene::Node& New_EclassModel( EntityClass* eclass ); diff --git a/plugins/entity/light.h b/plugins/entity/light.h index 4eaf7d8a..5c807ab2 100644 --- a/plugins/entity/light.h +++ b/plugins/entity/light.h @@ -25,7 +25,7 @@ namespace scene { class Node; -}; +} class EntityClass; scene::Node& New_Light( EntityClass* eclass ); diff --git a/tools/quake3/common/threads.c b/tools/quake3/common/threads.c index 04946dd2..b886cb87 100644 --- a/tools/quake3/common/threads.c +++ b/tools/quake3/common/threads.c @@ -576,7 +576,7 @@ void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ for ( i = 0 ; i < numthreads ; i++ ) { /* Default pthread attributes: joinable & non-realtime scheduling */ - if ( pthread_create( &work_threads[i], &attr, (void*)func, (void*)(size_t)i ) != 0 ) { + if (pthread_create(&work_threads[i], &attr, (void *(*)(void *)) func, (void*)(size_t)i ) != 0 ) { Error( "pthread_create failed" ); } } diff --git a/tools/quake3/q3data/3dslib.c b/tools/quake3/q3data/3dslib.c index 164f9d1b..296bba4e 100644 --- a/tools/quake3/q3data/3dslib.c +++ b/tools/quake3/q3data/3dslib.c @@ -58,7 +58,7 @@ static int ReadChunkAndLength( FILE *fp, short *chunk, long *len ){ } static void LoadMapName( FILE *fp, char *buffer, int thisChunkLen ){ - unsigned short chunkID; + short chunkID; long chunkLen; long bytesRead = 0; @@ -82,7 +82,7 @@ static void LoadMapName( FILE *fp, char *buffer, int thisChunkLen ){ static void LoadMaterialList( FILE *fp, long thisChunkLen, _3DSMaterial_t *pMat ){ long chunkLen; - unsigned short chunkID; + short chunkID; long bytesRead = 0; _3DSMaterial_t mat; char curdir[1024]; @@ -230,7 +230,7 @@ static void LoadMeshMaterialGroup( FILE *fp, long thisChunkLen, _3DSMeshMaterial static void LoadNamedTriObject( FILE *fp, long thisChunkLen, _3DSTriObject_t *pTO ){ long chunkLen; - unsigned short chunkID; + short chunkID; int i = 0; long bytesRead = 0; _3DSTriObject_t triObj; @@ -347,7 +347,7 @@ static void LoadNamedTriObject( FILE *fp, long thisChunkLen, _3DSTriObject_t *pT static void LoadNamedObject( FILE *fp, long thisChunkLen, _3DSNamedObject_t *pNO ){ long chunkLen; - unsigned short chunkID; + short chunkID; int i = 0; long bytesRead = 0; char name[100]; @@ -391,7 +391,7 @@ static void LoadNamedObject( FILE *fp, long thisChunkLen, _3DSNamedObject_t *pNO } static void LoadEditChunk( FILE *fp, long thisChunkLen, _3DSEditChunk_t *pEC ){ - unsigned short chunkID; + short chunkID; long chunkLen; long bytesRead = 0; _3DSEditChunk_t editChunk; @@ -451,7 +451,7 @@ static void LoadEditChunk( FILE *fp, long thisChunkLen, _3DSEditChunk_t *pEC ){ static void Load3DS( const char *filename, _3DS_t *p3DS, qboolean verbose ){ FILE *fp; - unsigned short chunkID; + short chunkID; long chunkLen; _3DSEditChunk_t editChunk; diff --git a/tools/quake3/q3data/3dslib.h b/tools/quake3/q3data/3dslib.h index 5490e939..68c3c24f 100644 --- a/tools/quake3/q3data/3dslib.h +++ b/tools/quake3/q3data/3dslib.h @@ -88,52 +88,52 @@ typedef struct _3DSEditChunk_t editChunk; } _3DS_t; -#define _3DS_CHUNK_NULL 0x0000 -#define _3DS_CHUNK_UNKNOWN0 0x0001 -#define _3DS_CHUNK_M3D_VERSION 0x0002 -#define _3DS_CHUNK_M3D_KFVERSION 0x0005 -#define _3DS_CHUNK_COLOR_F 0x0010 -#define _3DS_CHUNK_COLOR_24 0x0011 -#define _3DS_CHUNK_LIN_COLOR_24 0x0012 -#define _3DS_CHUNK_LIN_COLOR_F 0x0013 -#define _3DS_CHUNK_INT_PERCENTAGE 0x0030 -#define _3DS_CHUNK_FLOAT_PERCENT 0x0031 -#define _3DS_CHUNK_MASTER_SCALE 0x0100 -#define _3DS_CHUNK_CHUNK_TYPE 0x0995 -#define _3DS_CHUNK_CHUNK_UNIQUE 0x0996 -#define _3DS_CHUNK_NOT_CHUNK 0x0997 -#define _3DS_CHUNK_CONTAINER 0x0998 -#define _3DS_CHUNK_IS_CHUNK 0x0999 -#define _3DS_CHUNK_C_SXP_SELFI_MASKDATA 0x0c3c - -#define _3DS_CHUNK_BITMAP 0x1100 -#define _3DS_CHUNK_USE_BITMAP 0x1101 -#define _3DS_CHUNK_SOLID_BGND 0x1200 -#define _3DS_CHUNK_USE_SOLID_BGND 0x1201 - -#define _3DS_CHUNK_EDIT 0x3d3d -#define _3DS_CHUNK_MESH_VERSION 0x3d3e - -#define _3DS_CHUNK_NAMED_OBJECT 0x4000 -#define _3DS_CHUNK_NAMED_TRI_OBJECT 0x4100 -#define _3DS_CHUNK_POINT_ARRAY 0x4110 -#define _3DS_CHUNK_POINT_FLAG_ARRAY 0x4111 -#define _3DS_CHUNK_FACE_ARRAY 0x4120 -#define _3DS_CHUNK_MSH_MAT_GROUP 0x4130 -#define _3DS_CHUNK_TEX_VERTS 0x4140 -#define _3DS_CHUNK_SMOOTH_GROUP 0x4150 -#define _3DS_CHUNK_MESH_MATRIX 0x4160 -#define _3DS_CHUNK_MAGIC 0x4d4d - -#define _3DS_CHUNK_MAT_NAME 0xa000 -#define _3DS_CHUNK_TEXMAP 0xa200 -#define _3DS_CHUNK_SPECMAP 0xa204 -#define _3DS_CHUNK_OPACMAP 0xa210 -#define _3DS_CHUNK_REFLMAP 0xa220 -#define _3DS_CHUNK_BUMPMAP 0xa230 -#define _3DS_CHUNK_MAT_MAPNAME 0xa300 -#define _3DS_CHUNK_MAT_LIST 0xafff - -#define _3DS_CHUNK_KEYFRAME_DATA 0xb000 +#define _3DS_CHUNK_NULL ((short) 0x0000) +#define _3DS_CHUNK_UNKNOWN0 ((short) 0x0001) +#define _3DS_CHUNK_M3D_VERSION ((short) 0x0002) +#define _3DS_CHUNK_M3D_KFVERSION ((short) 0x0005) +#define _3DS_CHUNK_COLOR_F ((short) 0x0010) +#define _3DS_CHUNK_COLOR_24 ((short) 0x0011) +#define _3DS_CHUNK_LIN_COLOR_24 ((short) 0x0012) +#define _3DS_CHUNK_LIN_COLOR_F ((short) 0x0013) +#define _3DS_CHUNK_INT_PERCENTAGE ((short) 0x0030) +#define _3DS_CHUNK_FLOAT_PERCENT ((short) 0x0031) +#define _3DS_CHUNK_MASTER_SCALE ((short) 0x0100) +#define _3DS_CHUNK_CHUNK_TYPE ((short) 0x0995) +#define _3DS_CHUNK_CHUNK_UNIQUE ((short) 0x0996) +#define _3DS_CHUNK_NOT_CHUNK ((short) 0x0997) +#define _3DS_CHUNK_CONTAINER ((short) 0x0998) +#define _3DS_CHUNK_IS_CHUNK ((short) 0x0999) +#define _3DS_CHUNK_C_SXP_SELFI_MASKDATA ((short) 0x0c3c) + +#define _3DS_CHUNK_BITMAP ((short) 0x1100) +#define _3DS_CHUNK_USE_BITMAP ((short) 0x1101) +#define _3DS_CHUNK_SOLID_BGND ((short) 0x1200) +#define _3DS_CHUNK_USE_SOLID_BGND ((short) 0x1201) + +#define _3DS_CHUNK_EDIT ((short) 0x3d3d) +#define _3DS_CHUNK_MESH_VERSION ((short) 0x3d3e) + +#define _3DS_CHUNK_NAMED_OBJECT ((short) 0x4000) +#define _3DS_CHUNK_NAMED_TRI_OBJECT ((short) 0x4100) +#define _3DS_CHUNK_POINT_ARRAY ((short) 0x4110) +#define _3DS_CHUNK_POINT_FLAG_ARRAY ((short) 0x4111) +#define _3DS_CHUNK_FACE_ARRAY ((short) 0x4120) +#define _3DS_CHUNK_MSH_MAT_GROUP ((short) 0x4130) +#define _3DS_CHUNK_TEX_VERTS ((short) 0x4140) +#define _3DS_CHUNK_SMOOTH_GROUP ((short) 0x4150) +#define _3DS_CHUNK_MESH_MATRIX ((short) 0x4160) +#define _3DS_CHUNK_MAGIC ((short) 0x4d4d) + +#define _3DS_CHUNK_MAT_NAME ((short) 0xa000) +#define _3DS_CHUNK_TEXMAP ((short) 0xa200) +#define _3DS_CHUNK_SPECMAP ((short) 0xa204) +#define _3DS_CHUNK_OPACMAP ((short) 0xa210) +#define _3DS_CHUNK_REFLMAP ((short) 0xa220) +#define _3DS_CHUNK_BUMPMAP ((short) 0xa230) +#define _3DS_CHUNK_MAT_MAPNAME ((short) 0xa300) +#define _3DS_CHUNK_MAT_LIST ((short) 0xafff) + +#define _3DS_CHUNK_KEYFRAME_DATA ((short) 0xb000) void _3DS_LoadPolysets( const char *filename, polyset_t **ppPSET, int *numpsets, qboolean verbose ); diff --git a/tools/quake3/q3data/md3lib.c b/tools/quake3/q3data/md3lib.c index 66dfa52d..f78390ef 100644 --- a/tools/quake3/q3data/md3lib.c +++ b/tools/quake3/q3data/md3lib.c @@ -32,7 +32,7 @@ /* ** MD3_ComputeTagFromTri */ -void MD3_ComputeTagFromTri( md3Tag_t *pTag, const float pTri[3][3] ){ +void MD3_ComputeTagFromTri( md3Tag_t *pTag, float pTri[3][3] ){ float len[3]; vec3_t axes[3], sides[3]; int longestSide, shortestSide, hypotSide; diff --git a/tools/quake3/q3data/md3lib.h b/tools/quake3/q3data/md3lib.h index 5158b539..17cd86b1 100644 --- a/tools/quake3/q3data/md3lib.h +++ b/tools/quake3/q3data/md3lib.h @@ -25,4 +25,4 @@ #include "../common/qfiles.h" void MD3_Dump( const char *filename ); -void MD3_ComputeTagFromTri( md3Tag_t *pTag, const float tri[3][3] ); +void MD3_ComputeTagFromTri( md3Tag_t *pTag, float tri[3][3] ); diff --git a/tools/quake3/q3data/video.c b/tools/quake3/q3data/video.c index 9ce704a3..26b79a0f 100644 --- a/tools/quake3/q3data/video.c +++ b/tools/quake3/q3data/video.c @@ -106,7 +106,7 @@ void FindNextChunk( char *name ){ // Sys_Error ("FindNextChunk: %i length is past the 1 meg sanity limit", iff_chunk_len); data_p -= 8; last_chunk = data_p + 8 + ( ( iff_chunk_len + 1 ) & ~1 ); - if ( !strncmp( data_p, name, 4 ) ) { + if ( !strncmp((const char *) data_p, name, 4 ) ) { return; } } @@ -155,7 +155,7 @@ wavinfo_t GetWavinfo( char *name, byte *wav, int wavlength ){ // find "RIFF" chunk FindChunk( "RIFF" ); - if ( !( data_p && !strncmp( data_p + 8, "WAVE", 4 ) ) ) { + if ( !( data_p && !strncmp((const char *) (data_p + 8), "WAVE", 4 ) ) ) { printf( "Missing RIFF/WAVE chunks\n" ); return info; } @@ -191,7 +191,7 @@ wavinfo_t GetWavinfo( char *name, byte *wav, int wavlength ){ // if the next chunk is a LIST chunk, look for a cue length marker FindNextChunk( "LIST" ); if ( data_p ) { - if ( !strncmp( data_p + 28, "mark", 4 ) ) { // this is not a proper parse, but it works with cooledit... + if ( !strncmp((const char *) (data_p + 28), "mark", 4 ) ) { // this is not a proper parse, but it works with cooledit... data_p += 24; i = GetLittleLong(); // samples in loop info.samples = info.loopstart + i; diff --git a/tools/quake3/q3map2/shaders.c b/tools/quake3/q3map2/shaders.c index 923fe8a4..166319aa 100644 --- a/tools/quake3/q3map2/shaders.c +++ b/tools/quake3/q3map2/shaders.c @@ -2039,7 +2039,7 @@ static void ParseCustomInfoParms( void ){ custSurfaceParms[ numCustSurfaceParms ].name = safe_malloc( MAX_OS_PATH ); strcpy( custSurfaceParms[ numCustSurfaceParms ].name, token ); GetToken( qfalse ); - sscanf( token, "%x", &custSurfaceParms[ numCustSurfaceParms ].contentFlags ); + sscanf( token, "%x", (unsigned int *) &custSurfaceParms[ numCustSurfaceParms ].contentFlags ); numCustSurfaceParms++; } @@ -2065,7 +2065,7 @@ static void ParseCustomInfoParms( void ){ custSurfaceParms[ numCustSurfaceParms ].name = safe_malloc( MAX_OS_PATH ); strcpy( custSurfaceParms[ numCustSurfaceParms ].name, token ); GetToken( qfalse ); - sscanf( token, "%x", &custSurfaceParms[ numCustSurfaceParms ].surfaceFlags ); + sscanf( token, "%x", (unsigned int *) &custSurfaceParms[ numCustSurfaceParms ].surfaceFlags ); numCustSurfaceParms++; } -- 2.39.2