addflags("-Wextra")
addflags("-pedantic")
-addflags("-Wno-pedantic")
addflags("-Wno-parentheses")
addflags("-Wno-sign-compare")
addflags("-Wno-write-strings")
bool operator ==( DPlane& other );
bool IsRedundant( std::list<DPoint*>& 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 );
}
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;
/// \deprecated Use \c openFile.
inline int vfsLoadFile( const char* filename, void** buffer, int index = 0 ){
return static_cast<int>( GlobalFileSystem().loadFile( filename, buffer ) );
-};
+}
/// \deprecated Deprecated.
inline void vfsFreeFile( void* p ){
namespace scene
{
class Instance;
-};
+}
class InstanceSelectionObserver
{
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 ){
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:
_pico_free( env->name );
}
lwListFree( env->key, _pico_free );
- lwListFree( env->cfilter, (void *) lwFreePlugin );
+ lwListFree(env->cfilter, (void (*)(void *)) lwFreePlugin);
_pico_free( env );
}
}
}
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;
}
lwFreePoints( &layer->point );
lwFreePolygons( &layer->polygon );
- lwListFree( layer->vmap, (void *) lwFreeVMap );
+ lwListFree(layer->vmap, (void (*)(void *)) lwFreeVMap);
_pico_free( 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 );
}
_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 );
}
default: return 0;
}
- lwListInsert( (void **) list, tex, ( void *) compare_textures );
+ lwListInsert((void **) list, tex, (int (*)(void *, void *)) compare_textures);
return 1;
}
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;
for (auto &it : attributes) {
gtk_tree_view_column_add_attribute(this, renderer, it.attribute, it.column);
}
- };
+ }
IMPL(AccelGroup, GTK_ACCEL_GROUP);
#if GTK_TARGET == 2
return this.connect("expose_event", pFunction, data);
#endif
- };
+ }
}
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
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:
namespace scene
{
class Node;
-};
+}
class EntityClass;
scene::Node& New_EclassModel( EntityClass* eclass );
namespace scene
{
class Node;
-};
+}
class EntityClass;
scene::Node& New_Light( EntityClass* eclass );
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" );
}
}
}
static void LoadMapName( FILE *fp, char *buffer, int thisChunkLen ){
- unsigned short chunkID;
+ short chunkID;
long chunkLen;
long bytesRead = 0;
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];
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;
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];
}
static void LoadEditChunk( FILE *fp, long thisChunkLen, _3DSEditChunk_t *pEC ){
- unsigned short chunkID;
+ short chunkID;
long chunkLen;
long bytesRead = 0;
_3DSEditChunk_t editChunk;
static void Load3DS( const char *filename, _3DS_t *p3DS, qboolean verbose ){
FILE *fp;
- unsigned short chunkID;
+ short chunkID;
long chunkLen;
_3DSEditChunk_t editChunk;
_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 );
/*
** 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;
#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] );
// 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;
}
}
// 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;
}
// 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;
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++;
}
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++;
}