Skip to content

Commit

Permalink
* clang support
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.icculus.org/quake3/trunk@2187 edf5b092-35ff-0310-97b2-ce42778d08ea
  • Loading branch information
tma committed Oct 21, 2011
1 parent db1eae3 commit b533105
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu"))
endif

BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
-pipe -DUSE_ICON
-Wno-self-assign -pipe -DUSE_ICON
CLIENT_CFLAGS += $(SDL_CFLAGS)

OPTIMIZEVM = -O3 -funroll-loops -fomit-frame-pointer
Expand Down
6 changes: 3 additions & 3 deletions code/asm/snapvector.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ void qsnapvectorsse(vec3_t vec)

#define QROUNDX87(src) \
"flds " src "\n" \
"fistp " src "\n" \
"fild " src "\n" \
"fstp " src "\n"
"fistpl " src "\n" \
"fildl " src "\n" \
"fstpl " src "\n"

void qsnapvectorx87(vec3_t vec)
{
Expand Down
2 changes: 1 addition & 1 deletion code/botlib/be_ai_chat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ bot_matchpiece_t *BotLoadMatchPieces(source_t *source, char *endtoken)
{
if (token.type == TT_NUMBER && (token.subtype & TT_INTEGER))
{
if (token.intvalue < 0 || token.intvalue >= MAX_MATCHVARIABLES)
if (token.intvalue >= MAX_MATCHVARIABLES)
{
SourceError(source, "can't have more than %d match variables\n", MAX_MATCHVARIABLES);
FreeSource(source);
Expand Down
2 changes: 1 addition & 1 deletion code/game/g_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ static void G_VoiceTo( gentity_t *ent, gentity_t *other, int mode, const char *i
return;
}
// no chatting to players in tournements
if ( (g_gametype.integer == GT_TOURNAMENT )) {
if ( g_gametype.integer == GT_TOURNAMENT ) {
return;
}

Expand Down
3 changes: 3 additions & 0 deletions code/qcommon/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2329,7 +2329,10 @@ A way to force a bus error for development reasons
=================
*/
static void Com_Crash_f( void ) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnull-dereference"
* ( int * ) 0 = 0x12345678;
#pragma clang diagnostic pop
}

/*
Expand Down
5 changes: 5 additions & 0 deletions code/qcommon/q_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define OS_STRING "kFreeBSD"
#endif

#ifdef __clang__
#define ID_INLINE static inline
#else
#define ID_INLINE inline
#endif

#define PATH_SEP '/'

#if defined __i386__
Expand Down
2 changes: 1 addition & 1 deletion code/qcommon/unzip.c
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ extern int ZEXPORT unzReadCurrentFile (file, buf, len)
return UNZ_PARAMERROR;


if ((pfile_in_zip_read_info->read_buffer == NULL))
if (pfile_in_zip_read_info->read_buffer == NULL)
return UNZ_END_OF_LIST_OF_FILE;
if (len==0)
return 0;
Expand Down
9 changes: 3 additions & 6 deletions code/renderer/tr_model_iqm.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
LL( triangle->vertex[1] );
LL( triangle->vertex[2] );

if( triangle->vertex[0] < 0 || triangle->vertex[0] > header->num_vertexes ||
triangle->vertex[1] < 0 || triangle->vertex[1] > header->num_vertexes ||
triangle->vertex[2] < 0 || triangle->vertex[2] > header->num_vertexes ) {
if( triangle->vertex[0] > header->num_vertexes ||
triangle->vertex[1] > header->num_vertexes ||
triangle->vertex[2] > header->num_vertexes ) {
return qfalse;
}
}
Expand Down Expand Up @@ -323,9 +323,7 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
mesh->first_vertex + mesh->num_vertexes > header->num_vertexes ||
mesh->first_triangle >= header->num_triangles ||
mesh->first_triangle + mesh->num_triangles > header->num_triangles ||
mesh->name < 0 ||
mesh->name >= header->num_text ||
mesh->material < 0 ||
mesh->material >= header->num_text ) {
return qfalse;
}
Expand Down Expand Up @@ -354,7 +352,6 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na

if( joint->parent < -1 ||
joint->parent >= (int)header->num_joints ||
joint->name < 0 ||
joint->name >= (int)header->num_text ) {
return qfalse;
}
Expand Down
2 changes: 1 addition & 1 deletion code/renderer/tr_scene.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void RE_AddRefEntityToScene( const refEntity_t *ent ) {
}
return;
}
if ( ent->reType < 0 || ent->reType >= RT_MAX_REF_ENTITY_TYPE ) {
if ( (int)ent->reType < 0 || ent->reType >= RT_MAX_REF_ENTITY_TYPE ) {
ri.Error( ERR_DROP, "RE_AddRefEntityToScene: bad reType %i", ent->reType );
}

Expand Down

0 comments on commit b533105

Please sign in to comment.