From 00dcd5cffa79c86035cd151541e15fefe46c0511 Mon Sep 17 00:00:00 2001 From: jsalmon3 <> Date: Tue, 18 Mar 2003 00:35:28 +0000 Subject: [PATCH] Use strcmp instead of gh_eq_p --- src/unit/script_unittype.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/unit/script_unittype.cpp b/src/unit/script_unittype.cpp index 1cf200726..82cdc7575 100644 --- a/src/unit/script_unittype.cpp +++ b/src/unit/script_unittype.cpp @@ -10,7 +10,7 @@ // /**@name ccl_unittype.c - The unit-type ccl functions. */ // -// (c) Copyright 1999-2002 by Lutz Sammer +// (c) Copyright 1999-2003 by Lutz Sammer and Jimmy Salmon // // FreeCraft is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published @@ -108,17 +108,18 @@ local SCM CclDefineUnitType(SCM list) sublist=gh_car(list); list=gh_cdr(list); while( !gh_null_p(sublist) ) { + char* str; value=gh_car(sublist); sublist=gh_cdr(sublist); // FIXME: use a general get tileset function here! + str=gh_scm2newstr(value,NULL); i=0; - if( !gh_eq_p(value,gh_symbol2scm("default")) ) { + if( strcmp(str,"default") ) { for( ; i<TilesetMax; ++i ) { - if( gh_eq_p(value,gh_symbol2scm(Tilesets[i]->Ident)) || - gh_eq_p(value, - gh_symbol2scm(Tilesets[i]->Class)) ) { + if( !strcmp(str,Tilesets[i]->Ident) || + !strcmp(str,Tilesets[i]->Class) ) { break; } } @@ -127,6 +128,7 @@ local SCM CclDefineUnitType(SCM list) errl("Unsupported tileset tag",value); } } + free(str); type->File[i]=gh_scm2newstr(gh_car(sublist),NULL); sublist=gh_cdr(sublist); }