readding grub.c problems 2005-05-06 - By Christopher Lengel
Back Hi, I am attempting to readd grub.c to smaugFuss and I am running into some problems. Does anyone know if this is possible to begin with? If it is, can you help me figure out these bugs? I've been studying this code for a while now, but I am far from an expert, any help would be greatly appreciated. Here are the bugs I'm getting:
grub.c: In function `gr_read': grub.c:1501: warning: declaration of `sex' shadows a global declaration grub.c:468: warning: shadowed declaration is here grub.c:1502: warning: declaration of `class' shadows a global declaration grub.c:468: warning: shadowed declaration is here grub.c:1503: warning: declaration of `race' shadows a global declaration grub.c:468: warning: shadowed declaration is here grub.c:1506: warning: declaration of `clan' shadows a global declaration grub.c:468: warning: shadowed declaration is here grub.c:1509: warning: declaration of `council' shadows a global declaration grub.c:468: warning: shadowed declaration is here grub.c: In function `do_diagnose': grub.c:2017: warning: declaration of `race' shadows a global declaration grub.c:468: warning: shadowed declaration is here grub.c:2017: warning: declaration of `class' shadows a global declaration grub.c:468: warning: shadowed declaration is here
Here is the specific code for each section: 460's enum gr_field_type /* enumerates the fields in the input record */ {name, sex, class, race, level, room, gold, clan, council, site, last, pkill}; struct gr_struct /* input record containing pfile info */ { char name [MAX_NAME_LENGTH]; char sex; char class; char race; char level; short room; long gold; char clan; char council; char site [MAX_SITE_LENGTH]; long last; char pkill; };
1500's void gr_read ( CHAR_DATA *ch, int op_num, bool or_sw, int dis_num) { FILE *fp; bool res; /* result of a boolean exp */ bool title_sw = FALSE; /* only print title once */ int tot_match = 0; /* total records matched */ GR_STRUCT r; /* input (physical record) */ char sex[] = "NMF"; /* convert sex to text */ char class[] = "MCTWVDRAPN"; /* convert class to text */ char race[][3] = /* convert race to text */ {"Hu", "El", "Dw", "Ha", "Px", "Va", "Og", "HO", "HT", "HE", "Gi", "Dr", "SE", "Li", "Gn"}; char clan[][4] = { " ", "Gui", "DS ", "MS ", "RB ", "AR ", "Bru", "Las","Nos", "Tre", "Ven", "Inc", "Baa", "Rol"}; char council[][4] = {" ", "CoE", "MC ", "NC ", "Pro", "PK ", "QC ", "Neo", "Cod", "AC ", "Sym", "VC "};
I understand that it is declaring these twice, but I'm really not sure how to fix it, do I keep the declaration in the structure? or should I rename the variables in the function? Anything else that I'm missing on this? Again thanks for any help in this matter.
Chris Lengel
aka Christian http://nemesis.worldsofnemesis.org
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
|
|