projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
419ca86
)
fehler147 (produces invisible lightning gun in quake3)
author
Matthias Braun
<matze@braunis.de>
Wed, 3 Sep 2008 12:42:46 +0000
(12:42 +0000)
committer
Matthias 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]
patch
|
blob
diff --git a/ir/be/test/fehler147.c
b/ir/be/test/fehler147.c
new file mode 100644
(file)
index 0000000..
0ab53fd
--- /dev/null
+++ b/
ir/be/test/fehler147.c
@@ -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;
+}