fehler147 (produces invisible lightning gun in quake3)
authorMatthias Braun <matze@braunis.de>
Wed, 3 Sep 2008 12:42:46 +0000 (12:42 +0000)
committerMatthias Braun <matze@braunis.de>
Wed, 3 Sep 2008 12:42:46 +0000 (12:42 +0000)
[r21664]

ir/be/test/fehler147.c [new file with mode: 0644]

diff --git a/ir/be/test/fehler147.c b/ir/be/test/fehler147.c
new file mode 100644 (file)
index 0000000..0ab53fd
--- /dev/null
@@ -0,0 +1,24 @@
+float g = 0.098;
+
+#define myftol(x) ((int)(x))
+
+void foo(unsigned char *colors) {
+       int v;
+       float glow = g;
+
+       if (glow < 0) {
+               glow = 0;
+       } else if(glow > 1) {
+               glow = 1;
+       }
+
+       v = myftol(255*glow);
+       colors[0] = colors[1] = colors[2] = v;
+}
+
+int main(void) {
+       unsigned char colors[3];
+       foo(colors);
+       printf("%d %d %d\n", colors[0], colors[1], colors[2]);
+       return 0;
+}