fixed warnings

This commit is contained in:
Walter Julius Hennecke 2013-05-24 22:25:14 +02:00
parent d15d902aaa
commit 2c91fb8df7
3 changed files with 13 additions and 5 deletions

View file

@ -1396,7 +1396,7 @@ static void G_LoadLocationsFile( void )
return;
}
} else {
if(!result) {
if(result == 0) {
G_Printf(S_COLOR_RED "ERROR: Unexpected end of file.\n");
free(buffer);
bgLex_destroy(lex);
@ -1420,7 +1420,7 @@ static void G_LoadLocationsFile( void )
return;
}
ent->classname = "target_location";
ent->classname = G_NewString("target_location");
//copy position data
VectorCopy( origin, ent->s.origin );
@ -1443,7 +1443,7 @@ static void G_LoadLocationsFile( void )
rest = 0;
if(lex->morphem->type == LMT_SYMBOL && lex->morphem->data.symbol == LSYM_SEMICOLON) {
if(!bgLex_lex(lex)) {
if(bgLex_lex(lex) == 0) {
G_Printf(S_COLOR_RED "ERROR: Unexpected end of file.\n");
free(buffer);
bgLex_destroy(lex);

View file

@ -13,7 +13,7 @@
static char memoryPool[POOLSIZE];
static int allocPoint;
void *G_Alloc( int size ) {
/*@shared@*/ /*@null@*/ void *G_Alloc( int size ) {
char *p;
if ( g_debugAlloc.integer ) {

View file

@ -512,14 +512,22 @@ Builds a copy of the string, translating \n to real linefeeds
so message texts can be multi-line
=============
*/
char *G_NewString( const char *string ) {
/*@shared@*/ /*@null@*/ char *G_NewString( /*@null@*/ const char *string ) {
char *newb, *new_p;
int i,l;
if(string == NULL) {
return NULL;
}
l = strlen(string) + 1;
newb = (char *)G_Alloc( l );
if(newb == NULL) {
return NULL;
}
new_p = newb;
// turn \n into a real linefeed