Header size, coder size, data size compiling warning
#1

Hello guys, I get these errors when I try to compile
pawn Code:
D:\Users\Omar\Desktop\Server Files\pawno\include\seif_walk.inc(41) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase

Header size:          10500 bytes
Code size:          1803344 bytes
Data size:         10390908 bytes
Stack/heap size:      16384 bytes; estimated max. usage=7272 cells (29088 bytes)
Total requirements:12221136 bytes

1 Warning.
Actually, I am not familiar with memory errors. Thank you in advance.
Reply
#2

Loose indentation isn't a memory error, neither is it an error. Lose indentation is a warning because you are not indenting your code.
Reply
#3

You're probably using huge variables. Try optimising your code.

Also check #pragma dynamic


@thefatshizms - He's talking about Stack/heap size (i think ?)
Reply
#4

Quote:
Originally Posted by Djole1337
View Post
You're using huge variables. Try optimising your code.

Also check #pragma dynamic


@thefatshizms - He's talking about Stack/heap size (i think ?)
Yes I am talking about that error, but when I add #pragma dynamic these errors appear
pawn Code:
D:\Users\Omar\Desktop\Server Files\gamemodes\LOL.pwn(16) : error 029: invalid expression, assumed zero // this is the line of #pragma dynamic
D:\Users\Omar\Desktop\Server Files\pawno\include\utils.inc(16 -- 1) : error 008: must be a constant expression; assumed zero
D:\Users\Omar\Desktop\Server Files\pawno\include\utils.inc(2) : error 055: start of function body without function header
D:\Users\Omar\Desktop\Server Files\pawno\include\utils.inc(3) : error 010: invalid function or declaration
D:\Users\Omar\Desktop\Server Files\pawno\include\utils.inc(5) : error 010: invalid function or declaration
D:\Users\Omar\Desktop\Server Files\pawno\include\utils.inc(7) : error 010: invalid function or declaration
D:\Users\Omar\Desktop\Server Files\pawno\include\utils.inc(19) : error 017: undefined symbol "IsNumeric"
D:\Users\Omar\Desktop\Server Files\pawno\include\seif_walk.inc(41) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


7 Errors.
and this is the utils.inc
pawn Code:
IsNumeric(const string[])
{
    for (new i = 0, j = strlen(string); i < j; i++)
    {
        if (string[i] > '9' || string[i] < '0') return 0;
    }
    return 1;
}

ReturnUser(text[], playerid = INVALID_PLAYER_ID)
{
    new pos = 0;
    while (text[pos] < 0x21) // Strip out leading spaces
    {
        if (text[pos] == 0) return INVALID_PLAYER_ID; // No passed text
        pos++;
    }
    new userid = INVALID_PLAYER_ID;
    if (IsNumeric(text[pos])) // Check whole passed string
    {
        // If they have a numeric name you have a problem (although names are checked on id failure)
        userid = strval(text[pos]);
        if (userid >=0 && userid < MAX_PLAYERS)
        {
            if(!IsPlayerConnected(userid))
            {
                /*if (playerid != INVALID_PLAYER_ID)
                {
                    SendClientMessage(playerid, 0xFF0000AA, "User not connected");
                }*/

                userid = INVALID_PLAYER_ID;
            }
            else
            {
                return userid; // A player was found
            }
        }
        /*else
        {
            if (playerid != INVALID_PLAYER_ID)
            {
                SendClientMessage(playerid, 0xFF0000AA, "Invalid user ID");
            }
            userid = INVALID_PLAYER_ID;
        }
        return userid;*/

        // Removed for fallthrough code
    }
    // They entered [part of] a name or the id search failed (check names just incase)
    new len = strlen(text[pos]);
    new count = 0;
    new name[MAX_PLAYER_NAME];
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i))
        {
            GetPlayerName(i, name, sizeof (name));
            if (strcmp(name, text[pos], true, len) == 0) // Check segment of name
            {
                if (len == strlen(name)) // Exact match
                {
                    return i; // Return the exact player on an exact match
                    // Otherwise if there are two players:
                    // Me and MeYou any time you entered Me it would find both
                    // And never be able to return just Me's id
                }
                else // Partial match
                {
                    count++;
                    userid = i;
                }
            }
        }
    }
    if (count != 1)
    {
        if (playerid != INVALID_PLAYER_ID)
        {
            if (count)
            {
                SendClientMessage(playerid, 0xFF0000AA, "Multiple users found, please narrow earch");
            }
            else
            {
                SendClientMessage(playerid, 0xFF0000AA, "No matching user found");
            }
        }
        userid = INVALID_PLAYER_ID;
    }
    return userid; // INVALID_USER_ID for bad return
}
Quote:
Originally Posted by thefatshizms
View Post
Loose indentation isn't a memory error, neither is it an error. Lose indentation is a warning because you are not indenting your code.
I didn't mean the loose indentation error LOL, I meant the other warning that looks weird !
Reply
#5

What value you have used ?
Reply
#6

Value of what ? please provide a full answer as I cannot fully understand you.
Reply
#7

Bump.
Reply
#8

https://sampwiki.blast.hk/wiki/Keywords:...ives#.23pragma
Reply
#9

You've got a lose indication on your seif_walk.inc on line 41 right? Could you post line 41 with their direct lines around it. Like you have a if statment with on line 41 a sendclientmessage then you should post the whole if statement to check where it's losing the indication
Reply
#10

Thank you. I understood that the suitable one to use is #pragma dynamic, but in the value written, it says "generally a power of 2", so should I choose a large number higher than the estimated maximum usage (in the error) ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)