diff options
author | Aaron Lehmann <aaronl@vitelius.com> | 2001-12-06 03:29:37 +0000 |
---|---|---|
committer | Aaron Lehmann <aaronl@vitelius.com> | 2001-12-06 03:29:37 +0000 |
commit | 2dd2d7a37da0f292ede2f9bfe1575280a49a5106 (patch) | |
tree | 4247527c485b74ddc67f5318dad1b77cb089a6fe /miscutils/dc.c | |
parent | b9df470c4d886f03b26d9277ec059130e6472f40 (diff) | |
download | busybox-w32-2dd2d7a37da0f292ede2f9bfe1575280a49a5106.tar.gz busybox-w32-2dd2d7a37da0f292ede2f9bfe1575280a49a5106.tar.bz2 busybox-w32-2dd2d7a37da0f292ede2f9bfe1575280a49a5106.zip |
Patch to avoid warnings
Diffstat (limited to 'miscutils/dc.c')
-rw-r--r-- | miscutils/dc.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/miscutils/dc.c b/miscutils/dc.c index 8d7a92a28..f9020b360 100644 --- a/miscutils/dc.c +++ b/miscutils/dc.c | |||
@@ -19,65 +19,65 @@ static void push(double a) | |||
19 | stack[pointer++] = a; | 19 | stack[pointer++] = a; |
20 | } | 20 | } |
21 | 21 | ||
22 | static double pop() | 22 | static double pop(void) |
23 | { | 23 | { |
24 | if (pointer == 0) | 24 | if (pointer == 0) |
25 | error_msg_and_die("stack underflow"); | 25 | error_msg_and_die("stack underflow"); |
26 | return stack[--pointer]; | 26 | return stack[--pointer]; |
27 | } | 27 | } |
28 | 28 | ||
29 | static void add() | 29 | static void add(void) |
30 | { | 30 | { |
31 | push(pop() + pop()); | 31 | push(pop() + pop()); |
32 | } | 32 | } |
33 | 33 | ||
34 | static void sub() | 34 | static void sub(void) |
35 | { | 35 | { |
36 | double subtrahend = pop(); | 36 | double subtrahend = pop(); |
37 | 37 | ||
38 | push(pop() - subtrahend); | 38 | push(pop() - subtrahend); |
39 | } | 39 | } |
40 | 40 | ||
41 | static void mul() | 41 | static void mul(void) |
42 | { | 42 | { |
43 | push(pop() * pop()); | 43 | push(pop() * pop()); |
44 | } | 44 | } |
45 | 45 | ||
46 | static void divide() | 46 | static void divide(void) |
47 | { | 47 | { |
48 | double divisor = pop(); | 48 | double divisor = pop(); |
49 | 49 | ||
50 | push(pop() / divisor); | 50 | push(pop() / divisor); |
51 | } | 51 | } |
52 | 52 | ||
53 | static void and() | 53 | static void and(void) |
54 | { | 54 | { |
55 | push((unsigned int) pop() & (unsigned int) pop()); | 55 | push((unsigned int) pop() & (unsigned int) pop()); |
56 | } | 56 | } |
57 | 57 | ||
58 | static void or() | 58 | static void or(void) |
59 | { | 59 | { |
60 | push((unsigned int) pop() | (unsigned int) pop()); | 60 | push((unsigned int) pop() | (unsigned int) pop()); |
61 | } | 61 | } |
62 | 62 | ||
63 | static void eor() | 63 | static void eor(void) |
64 | { | 64 | { |
65 | push((unsigned int) pop() ^ (unsigned int) pop()); | 65 | push((unsigned int) pop() ^ (unsigned int) pop()); |
66 | } | 66 | } |
67 | 67 | ||
68 | static void not() | 68 | static void not(void) |
69 | { | 69 | { |
70 | push(~(unsigned int) pop()); | 70 | push(~(unsigned int) pop()); |
71 | } | 71 | } |
72 | 72 | ||
73 | static void print() | 73 | static void print(void) |
74 | { | 74 | { |
75 | printf("%g\n", pop()); | 75 | printf("%g\n", pop()); |
76 | } | 76 | } |
77 | 77 | ||
78 | struct op { | 78 | struct op { |
79 | const char *name; | 79 | const char *name; |
80 | void (*function) (); | 80 | void (*function) (void); |
81 | }; | 81 | }; |
82 | 82 | ||
83 | static const struct op operators[] = { | 83 | static const struct op operators[] = { |