13 Mar, 2010, triskaledia wrote in the 1st comment:
Votes: 0
tables.c:942: warning: initialization makes integer from pointer without a cast tables.c:942: error: initializer element is not computable at load time tables.c:942: error: (near initialization for material_solid_table[9].materialname)
struct material_info { char materialname; int armorboost; };
I've been running back and forth in the code, trying to compare to see what it is that I'm doing wrong to get these errors and that one warning, but I can't seem to pinpoint the problem. Looking at the other arrays/tables designed inside of tables.c/const.c it appears that I have them down exactly how they've been setup.
tables.c:942: error: initializer element is not computable at load time
tables.c:942: error: (near initialization for material_solid_table[9].materialname)
struct material_info
{
char materialname;
int armorboost;
};
const char material_info material_gem_table[] =
{
{"amber", 0},
{"aquamarine", 0},
{"diamond", 1},
{"emerald", 0},
{"glass", 0},
{"gold", 0},
{"opal", 0},
{"pearl", 0},
{"ruby", 0},
{"sapphire", 0},
{"skeletal", 0},
{"spinel", 0},
{"topaz", 0}
};
const char material_info material_solid_table[] =
{
{"leather", 0},
{"bronze", 0},
{"copper", 0},
{"iron", 0},
{"metal", 0},
{"mithril", 0},
{"glass", 0},
{"obsidian", 0},
{"platinum", 0},
{"titanium", 0}
};
I've been running back and forth in the code, trying to compare to see what it is that I'm doing wrong
to get these errors and that one warning, but I can't seem to pinpoint the problem. Looking at the other
arrays/tables designed inside of tables.c/const.c it appears that I have them down exactly how they've
been setup.