summaryrefslogtreecommitdiff
path: root/src/new32.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/new32.c')
-rw-r--r--src/new32.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/new32.c b/src/new32.c
index 9136115..654b793 100644
--- a/src/new32.c
+++ b/src/new32.c
@@ -9,16 +9,16 @@ static const unsigned int divtab[244] = {
[243] = 0x010d + 1l
};
-#define FASTDIV(n, C) (((n) * (C)) >> 16)
-#define FASTMOD(n, d, C) ((n) - (d) * FASTDIV((n), (C)))
+#define FASTDIV(n, d) (((n) * divtab[d]) >> 16)
+#define FASTMOD(n, d) ((n) - (d) * FASTDIV((n), (d)))
int new32(int i, int x, int y)
{
int A, B, C;
- A = FASTDIV(i, divtab[y]);
- B = FASTMOD(A, 3, divtab[3]);
- C = FASTMOD(A + x, 3, divtab[3]);
+ A = FASTDIV(i, y);
+ B = FASTMOD(A, 3);
+ C = FASTMOD(A + x, 3);
return i + (C - B) * y;
}