annotations and fixes

This commit is contained in:
Walter Julius Hennecke 2013-05-24 22:11:53 +02:00
parent 263c803e5a
commit decb2bdf52
4 changed files with 12 additions and 11 deletions

View file

@ -125,7 +125,7 @@ struct bgLex_s {
};
bgLex* bgLex_create(char* data);
void bgLex_destroy(bgLex* lex);
void bgLex_destroy(/*@only@*/ /*@out@*/ /*@null@*/ bgLex* lex);
int bgLex_lex(bgLex* lex);
bgLexSymbol bgLex_textToSymbol(char* text);
void bgLexFatalError(const char* msg, void* lex);

View file

@ -13,6 +13,6 @@ typedef struct
extern group_list_t group_list[MAX_GROUP_MEMBERS];
extern int group_count;
extern char* BG_RegisterRace( const char *name );
extern char *G_searchGroupList(const char *name);
/*@shared@*/ /*@null@*/ extern char *G_searchGroupList(const char *name);
#define MAX_SKINS_FOR_RACE 128

View file

@ -1477,6 +1477,7 @@ char *G_searchGroupList(const char *name)
int i;
char mod_name[200];
memset (mod_name, 0, sizeof(mod_name));
memset (races, 0, sizeof(races));
memset (text, 0, sizeof(text));
@ -1491,7 +1492,7 @@ char *G_searchGroupList(const char *name)
// find the name in the group list
for (i=0; i<group_count; i++)
{
if (!Q_stricmp(mod_name, group_list[i].name))
if (Q_stricmp(mod_name, group_list[i].name) == 0)
{
text_p = group_list[i].text;
break;
@ -1536,9 +1537,9 @@ static void G_FindTeams( void ) {
continue;
if (!e->team)
continue;
if (e->flags & FL_TEAMSLAVE)
if ((e->flags & FL_TEAMSLAVE) != 0)
continue;
if ( e->classname && Q_stricmp( "func_door", e->classname ) != 0 )
if ( (e->classname != NULL) && Q_stricmp( "func_door", e->classname ) != 0 )
{//not a door
if ( Q_stricmp( "1", e->team ) == 0 || Q_stricmp( "2", e->team ) == 0 )
{//is trying to tell us it belongs to the TEAM_RED or TEAM_BLUE
@ -1554,9 +1555,9 @@ static void G_FindTeams( void ) {
continue;
if (!e2->team)
continue;
if (e2->flags & FL_TEAMSLAVE)
if ((e2->flags & FL_TEAMSLAVE) != 0)
continue;
if (!strcmp(e->team, e2->team))
if (strcmp(e->team, e2->team) == 0)
{
c2++;
e2->teamchain = e->teamchain;

View file

@ -674,7 +674,7 @@ void Parse1DMatrix (char **buf_p, int x, float *m);
void Parse2DMatrix (char **buf_p, int y, int x, float *m);
void Parse3DMatrix (char **buf_p, int z, int y, int x, float *m);
void QDECL Com_sprintf (char *dest, size_t size, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
void QDECL Com_sprintf (/*@null@*/ char *dest, size_t size, /*@null@*/ const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
// mode parm for FS_FOpenFile
@ -712,11 +712,11 @@ int Q_stricmpn (/*@null@*/ const char *s1, /*@null@*/ const char *s2, int n);
* if no longer needed). Returns NULL if no token is found. Make sure
* to adjust str for the next call yourself as this function won't do that.
*/
/*@shared@*/ /*@null@*/ char* Q_strtok(/*@null@*/ char* str, /*@null@*/ const char *tok, int size);
/*@shared@*/ /*@null@*/ char* Q_strtok(/*@null@*/ char* str, /*@null@*/ const char *tok, size_t size);
// buffer size safe library replacements
void Q_strncpyz( /*@null@*/ char *dest, /*@null@*/ const char *src, int destsize );
void Q_strcat( /*@null@*/ char *dest, int size, /*@null@*/ const char *src );
void Q_strncpyz( /*@null@*/ char *dest, /*@null@*/ const char *src, size_t destsize );
void Q_strcat( /*@null@*/ char *dest, size_t size, /*@null@*/ const char *src );
// strlen that discounts Quake color sequences
int Q_PrintStrlen( /*@null@*/ const char *string );