14 Apr, 2009, David Haley wrote in the 21st comment:
Votes: 0
Actually I'm looking for the definition of struct ability_data, not the ability_table array. My bad, sorry I misspoke earlier.
14 Apr, 2009, erdrick wrote in the 22nd comment:
Votes: 0
give me a couple hours to figure that one out…I am sorta new at the whole coding thing….I know enough to boot, make changes here and there, etc. But dunno what you mean by definition of the table…so..this may take a bit.
14 Apr, 2009, Sharmair wrote in the 23rd comment:
Votes: 0
Um…
extern  const  struct  ability_table        ability_data[];

This is the actual line in ability.h? That just seems conceptually wrong.
I think it should be:
extern  const  struct  ability_data        ability_table[];
14 Apr, 2009, erdrick wrote in the 24th comment:
Votes: 0
Wow, that actually fixed the ability.c error, now I got something to do with tables.h

basically, every extern line came up with an error, and I think again it's something written wrong…hrm..maybe I can figure this one out…doubt it, lol.
14 Apr, 2009, erdrick wrote in the 25th comment:
Votes: 0
Error is here, bottom follows what is in those files.

gcc -c -Wall -O -g -DNOCRYPT act_comm.c
In file included from act_comm.c:14:
tables.h:2: error: array type has incomplete element type
tables.h:3: error: array type has incomplete element type
tables.h:4: error: array type has incomplete element type
tables.h:7: error: array type has incomplete element type
tables.h:8: error: array type has incomplete element type
tables.h:9: error: array type has incomplete element type
tables.h:10: error: array type has incomplete element type
tables.h:11: error: array type has incomplete element type
tables.h:12: error: array type has incomplete element type
tables.h:13: error: array type has incomplete element type
tables.h:14: error: array type has incomplete element type
tables.h:15: error: array type has incomplete element type
tables.h:16: error: array type has incomplete element type
tables.h:17: error: array type has incomplete element type
tables.h:18: error: array type has incomplete element type
tables.h:19: error: array type has incomplete element type
tables.h:20: error: array type has incomplete element type
tables.h:21: error: array type has incomplete element type
tables.h:22: error: array type has incomplete element type
tables.h:23: error: array type has incomplete element type
tables.h:24: error: array type has incomplete element type
tables.h:25: error: array type has incomplete element type
tables.h:26: error: array type has incomplete element type
tables.h:27: error: array type has incomplete element type
tables.h:28: error: array type has incomplete element type
tables.h:29: error: array type has incomplete element type
tables.h:30: error: array type has incomplete element type
tables.h:31: error: array type has incomplete element type
tables.h:32: error: array type has incomplete element type
tables.h:33: error: array type has incomplete element type
tables.h:34: error: array type has incomplete element type
tables.h:35: error: array type has incomplete element type
tables.h:36: error: array type has incomplete element type
tables.h:37: error: array type has incomplete element type
tables.h:38: error: array type has incomplete element type
tables.h:39: error: array type has incomplete element type
tables.h:40: error: array type has incomplete element type
tables.h:41: error: array type has incomplete element type
tables.h:42: error: array type has incomplete element type
tables.h:43: error: array type has incomplete element type
make: *** [act_comm.o] Error 1

act_comm.c
Line 14
#include "tables.h"

tables.h
/* game tables */
extern const struct position_type position_table[];
extern const struct sex_type sex_table[];
extern const struct size_type size_table[];

/* flag tables */
extern const struct flag_type act_flags[];
extern const struct flag_type plr_flags[];
extern const struct flag_type affect_flags[];
extern const struct flag_type off_flags[];
extern const struct flag_type imm_flags[];
extern const struct flag_type form_flags[];
extern const struct flag_type part_flags[];
extern const struct flag_type comm_flags[];
extern const struct flag_type extra_flags[];
extern const struct flag_type wear_flags[];
extern const struct flag_type weapon_flags[];
extern const struct flag_type container_flags[];
extern const struct flag_type portal_flags[];
extern const struct flag_type room_flags[];
extern const struct flag_type exit_flags[];
extern const struct flag_type mprog_flags[];
extern const struct flag_type area_flags[];
extern const struct flag_type sector_flags[];
extern const struct flag_type door_resets[];
extern const struct flag_type wear_loc_strings[];
extern const struct flag_type wear_loc_flags[];
extern const struct flag_type res_flags[];
extern const struct flag_type imm_flags[];
extern const struct flag_type vuln_flags[];
extern const struct flag_type type_flags[];
extern const struct flag_type apply_flags[];
extern const struct flag_type sex_flags[];
extern const struct flag_type furniture_flags[];
extern const struct flag_type weapon_class[];
extern const struct flag_type apply_types[];
extern const struct flag_type weapon_type2[];
extern const struct flag_type apply_types[];
extern const struct flag_type size_flags[];
extern const struct flag_type position_flags[];
extern const struct flag_type ac_type[];
extern const struct bit_type bitvector_type[];
extern const struct flag_type guild_flags[];

thats line 43, where the error ends, at the end.
14 Apr, 2009, erdrick wrote in the 26th comment:
Votes: 0
Go me, I solved that issue all on my own. and a few others, and someone else is helping me also. but now this has us both stumped.


act_info.c: In function 'show_inventory_to_char':
act_info.c:363: error: incompatible type for argument 1 of 'flag_string'
make: *** [act_info.o] Error 1

sprintf(itemtype, "%s", flag_string(weapon_class,obj->value[0]));
else if (obj->item_type == ITEM_ARMOR)
sprintf(itemtype, "Armor");
else if (obj->item_type == ITEM_QUEST)
sprintf(itemtype, "Quest");

that is line 363 and a bit beyond…any help would be appreciated
14 Apr, 2009, Sharmair wrote in the 27th comment:
Votes: 0
What it is saying is that weapon_class is not of the type the flag_string function expects.
It would help to compare the definitions of weapon_class and how flag_string() is declared
(or defined). As I recall, weapon_class would be a name of an array of const char* and it
might be just a const/nonconst issue. One other thing, check to make sure flag_string()
is being used right, I don't know about your code here, but in the SMAUG derived code I
work in, the bitvector is the 1st argument and the string array the 2nd (the reverse of
how your code seems to be doing it).
14 Apr, 2009, David Haley wrote in the 28th comment:
Votes: 0
I hadn't even noticed that the names were inverted in the extern declaration and the table definition. A hint at what the problem was is indeed that different structure names were being used. It's kind of interesting that this error has been in there all these years – cheers for better compilers I suppose. :wink:
15 Apr, 2009, Skol wrote in the 29th comment:
Votes: 0
David Haley said:
grep "text to search for" *.c *.h
will search for "text to search for" in all .c and .h files.


David, how does that differ from:
grep "text to search for" *.[ch]

Although I could see using the *.are *.bak if it's a multi-character file extension.
15 Apr, 2009, David Haley wrote in the 30th comment:
Votes: 0
It doesn't. *.[ch] means anything followed by a dot followed by c or h. This is pretty clearly the same as anything ending in .c and anything ending in .h.
15 Apr, 2009, erdrick wrote in the 31st comment:
Votes: 0
Small update: Upon gaining a third free shell provider, I tried changing the compiler in my makefile to gcc-3.4 and the game compiled cleanly! It doesn't seem to work in my other two shells, but the third one works like a charm, so I am reaaal happy. I would like to thank all the people who helped me here!
15 Apr, 2009, Skol wrote in the 32nd comment:
Votes: 0
David Haley said:
It doesn't. *.[ch] means anything followed by a dot followed by c or h. This is pretty clearly the same as anything ending in .c and anything ending in .h.

Ah cool, my grep-fu isn't as good as it could be (grep patterns etc) but I figured I'd ask.
The .(string) way seems nice also, especially in longer file extensions like .3 etc.
15 Apr, 2009, David Haley wrote in the 33rd comment:
Votes: 0
Well, I'll make a stronger statement: it's actually very impractical to deal with multi-character extensions using single-letter character classes. :wink:

I think it's actually kind of interesting that you prefer the character class notation, as personally I find that that requires more understanding of what's going on, as opposed to a sequence of simple patterns.
15 Apr, 2009, Tyche wrote in the 34th comment:
Votes: 0
In gcc 4.x when declaring arrays, the complete type declaration must appear before the array.

struct foo {int x;};
struct foo foo_array[];

instead of..
struct foo foo_array[];
struct foo {int x;};
16 Apr, 2009, Skol wrote in the 35th comment:
Votes: 0
David Haley said:
Well, I'll make a stronger statement: it's actually very impractical to deal with multi-character extensions using single-letter character classes. :wink:

I think it's actually kind of interesting that you prefer the character class notation, as personally I find that that requires more understanding of what's going on, as opposed to a sequence of simple patterns.

I hear you, I use that exclusively in my source, not when dealing with the multi-character extensions. So it's always .c or .h files, kind of made it the shortest route to type for me. But, I was also first tutored by a C programmer who did MUD programming for his fun stuff and wrote embedded code for military chips for his regular stuff. He had me start with 'A book on C' and continually would chide me to do things the a certain way heh. That style of grep was how he'd originally showed me way back. But I do often use that (although usually with more like [a-z] -i etc heh) in my grep patterns.

I'm still a hack, but I'm working on it heh ;p.
16 Apr, 2009, elanthis wrote in the 36th comment:
Votes: 0
Skol said:
Ah cool, my grep-fu isn't as good as it could be (grep patterns etc) but I figured I'd ask.
The .(string) way seems nice also, especially in longer file extensions like .3 etc.


Minor nit: has nothing to do with grep, as the *.[ch] stuff is all part of the shell globbing. Totally different kind of pattern than what grep itself is using, which are POSIX regular expressions. :)
20.0/36