fehler147 (produces invisible lightning gun in quake3)
[libfirm] / ir / be / test / fehler147.c
1 float g = 0.098;
2
3 #define myftol(x) ((int)(x))
4
5 void foo(unsigned char *colors) {
6         int v;
7         float glow = g;
8
9         if (glow < 0) {
10                 glow = 0;
11         } else if(glow > 1) {
12                 glow = 1;
13         }
14
15         v = myftol(255*glow);
16         colors[0] = colors[1] = colors[2] = v;
17 }
18
19 int main(void) {
20         unsigned char colors[3];
21         foo(colors);
22         printf("%d %d %d\n", colors[0], colors[1], colors[2]);
23         return 0;
24 }