projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make ICC more happy by spelling -f combo as -fcombo, so it can properly ignore "combo...
[libfirm]
/
ir
/
be
/
test
/
tailrec.c
diff --git
a/ir/be/test/tailrec.c
b/ir/be/test/tailrec.c
index
9e21795
..
4bac479
100644
(file)
--- a/
ir/be/test/tailrec.c
+++ b/
ir/be/test/tailrec.c
@@
-1,16
+1,11
@@
#include <stdio.h>
#include <stdio.h>
-static unsigned
_fak(unsigned a, unsigned b
)
+static unsigned
fak(unsigned n
)
{
{
- if (
a
== 0)
- return
b
;
+ if (
n
== 0)
+ return
1
;
- return _fak(a-1, a*b);
-}
-
-static fak(unsigned a)
-{
- return _fak(a, 1);
+ return n * fak(n - 1);
}
}