Warning: more initiallers than enum fields
#1

pawn Код:
enum istr
{
    INV_NAME[24],// error 001: expected token: "}", but found "("
    Float:INV_WEIGHT,
    INV_MODEL,
    Float:INV_MODEL_ZOOM,
    Float:INV_MODEL_ROOTX,
    Float:INV_MODEL_ROOTY,
    Float:INV_MODEL_ROOTZ
};
new const Inventory[][istr] =
{
    {"nnnnn",                   0.0,    0,          0.0,        0.0,        0.0,        0.0},//warning 228: length of initialler exceeds size of the enum field  ++++ warning 227: more initiallers than enum fields
    {"GPS navigacija",          0.32,   18875,      1.0,        -90.0,      0.0,        180.0},
    {"N. liemene",              3.25,   1242,       1.0,        0.0,        0.0,        0.0},
    {"Pasas",                   0.01,   1581,       1.0,        0.0,        0.0,        210.0},
    {"Somedaikas1",             0.35,   1581,       1.0,        0.0,        0.0,        210.0},
    {"Somedaikas2",             0.35,   1581,       1.0,        0.0,        0.0,        210.0},
    {"Somedaikas3",             0.35,   1581,       1.0,        0.0,        0.0,        210.0},
    {"Somedaikas4",             0.35,   1581,       1.0,        0.0,        0.0,        210.0},
    {"Somedaikas5",             0.35,   1581,       1.0,        0.0,        0.0,        210.0},
    {"Somedaikas6",             0.35,   1581,       1.0,        0.0,        0.0,        210.0},
    {"Somedaikas7",             0.35,   1581,       1.0,        0.0,        0.0,        210.0},
    {"Somedaikas8",             0.35,   1581,       1.0,        0.0,        0.0,        210.0}
};
Errors and warnings note in code. Any ideas?
Reply
#2

Nothing on my side



I think it cames from you, but somewhere else in your code.
Reply
#3

Show us where Inventory array is used because that's where the mistake is.

@S4t3K: Even if there was a mistake in the initialization of it, it wouldn't show the errors/warnings as you never use it anywhere.
Reply
#4

@Konstantinos : That's why I tried to use the array using this code :

PHP код:

public OnFilterScriptInit()
{
    
printf("%s"Inventory[0][INV_NAME]);
    
printf("%d"Inventory[0][INV_WEIGHT]);
    
printf("%d"Inventory[0][INV_MODEL]);
    
printf("%f"Inventory[0][INV_MODEL_ZOOM]);
    
printf("%f"Inventory[0][INV_MODEL_ROOTX]);
    
printf("%f"Inventory[0][INV_MODEL_ROOTY]);
    
printf("%f"Inventory[0][INV_MODEL_ROOTZ]);
    return 
1;

But the only change that I noticed was that the warning : unused symbol was removed.
As you've stated, the problem cames from the way he uses the array.
Reply
#5

Reply
#6

I fixed all erors, but where I using variable INV_NAME I'll give warning 213: tag mismatch
Reply
#7

I fixed all erors, but where I using variable INV_NAME I'll give warning 213: tag mismatch
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)