aboutsummaryrefslogtreecommitdiff
path: root/miscutils/dc.c
diff options
context:
space:
mode:
authorAaron Lehmann <aaronl@vitelius.com>2001-12-06 03:29:37 +0000
committerAaron Lehmann <aaronl@vitelius.com>2001-12-06 03:29:37 +0000
commit2dd2d7a37da0f292ede2f9bfe1575280a49a5106 (patch)
tree4247527c485b74ddc67f5318dad1b77cb089a6fe /miscutils/dc.c
parentb9df470c4d886f03b26d9277ec059130e6472f40 (diff)
downloadbusybox-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.c22
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
22static double pop() 22static 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
29static void add() 29static void add(void)
30{ 30{
31 push(pop() + pop()); 31 push(pop() + pop());
32} 32}
33 33
34static void sub() 34static 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
41static void mul() 41static void mul(void)
42{ 42{
43 push(pop() * pop()); 43 push(pop() * pop());
44} 44}
45 45
46static void divide() 46static 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
53static void and() 53static 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
58static void or() 58static 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
63static void eor() 63static 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
68static void not() 68static void not(void)
69{ 69{
70 push(~(unsigned int) pop()); 70 push(~(unsigned int) pop());
71} 71}
72 72
73static void print() 73static void print(void)
74{ 74{
75 printf("%g\n", pop()); 75 printf("%g\n", pop());
76} 76}
77 77
78struct op { 78struct op {
79 const char *name; 79 const char *name;
80 void (*function) (); 80 void (*function) (void);
81}; 81};
82 82
83static const struct op operators[] = { 83static const struct op operators[] = {