summaryrefslogtreecommitdiffstats
path: root/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/tests/expected/d/40002-volatile.d
blob: 4dbd66dcdbe0ed1f8f20bad8c76e3d7010bbbeb6 (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
void foo(void)
{
    while (nextSegmentIndex >= 0)
    {
        Segment seg = map.segments[nextSegmentIndex--];
        volatile if (seg.count)
            {
                currentTable = seg.table;
                for (int j = currentTable.length - 1; j >= 0; --j)
                {
                    if ((nextEntry = currentTable[j]) !is null)
                    {
                        nextTableIndex = j - 1;
                        return;
                    }
                }
            }
    }

    if (e)
        volatile
        {
            oldValue = e.value;
            e.value  = newValue;
        }
    return oldValue;
}