summaryrefslogtreecommitdiffstats
path: root/debian/uncrustify-trinity/uncrustify-trinity-0.76.0/tests/expected/pawn/60004-enum.pawn
blob: 7dd318f3569834627818ab98cb20c3bd3b92519c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91

enum rect { left, top, right, bottom }

enum boot(<<= 1) { a=1, b, c, d }

enum booty(<<= 1)
{
    a=1, b, c, d
}

forward addvector(a[], const b[], size);

enum message {
    text[40 char],
    priority
}

enum token
{
    t_type,
    Rational:t_value,
    t_word[20],
}

new bool:flag = true;

increment(&value, incr=1)
{
    value += incr;
}

new msg[message] = { !"My Text", 1 };
main()
{
    new my_rect[rect];

    my_rect[left] = 10;
    my_rect[right] = 100;
    my_rect[top] = 10;
    my_rect[bottom] = 100;

    for (new i = 0; rect:i < rect; i++) {
        my_rect[rect:i] *= 2;
    }

    new vect[3] = { 1, 2, 3 };
    addvector(vect, { 5, 5, 5 }, 3);

    new Float:xpos;
    new Float:ypos;

    new a = 5;
    increment(a);
    increment(a, _);
    increment(a, 1);
}

sum(a, b)
{
    return a + b;
}

power(x, y)
{
    /* returns x raised to the power of y */
    assert y >= 0;
    new r = 1;
    for (new i = 0; i < y; i++) {
        r *= x;
    }
    return r;
}

addvector(a[], const b[], size)
{
    for (new i = 0; i < size; i++) {
        a[i] += b[i];
    }
}

stock remove_filepath(szFilePath[], szFile[], pMax)
{
    new len = strlen(szFilePath);

    while ((--len >= 0) && (szFilePath[len] != '/') &&
           (szFilePath[len] != '\'')) { }

    copy(szFile, pMax, szFilePath[len + 1]);

    return;
}