aboutsummaryrefslogtreecommitdiff
path: root/dc.c
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2000-12-01 02:55:13 +0000
committerMatt Kraai <kraai@debian.org>2000-12-01 02:55:13 +0000
commit3e856ce428cabaf6c8d99a2374a1f9a4a05db5f0 (patch)
tree013a1e7752113314831ad7d51854ce8dc9e0918b /dc.c
parentb558e76eb1ba173ce3501c3e13fb80f426a7faac (diff)
downloadbusybox-w32-3e856ce428cabaf6c8d99a2374a1f9a4a05db5f0.tar.gz
busybox-w32-3e856ce428cabaf6c8d99a2374a1f9a4a05db5f0.tar.bz2
busybox-w32-3e856ce428cabaf6c8d99a2374a1f9a4a05db5f0.zip
Stop using TRUE and FALSE for exit status.
Diffstat (limited to 'dc.c')
-rw-r--r--dc.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/dc.c b/dc.c
index 48aa830d6..0f5f1fc77 100644
--- a/dc.c
+++ b/dc.c
@@ -13,19 +13,15 @@ static unsigned int pointer;
13 13
14static void push(double a) 14static void push(double a)
15{ 15{
16 if (pointer >= (sizeof(stack) / sizeof(*stack))) { 16 if (pointer >= (sizeof(stack) / sizeof(*stack)))
17 errorMsg("stack overflow\n"); 17 fatalError("stack overflow\n");
18 exit(-1); 18 stack[pointer++] = a;
19 } else
20 stack[pointer++] = a;
21} 19}
22 20
23static double pop() 21static double pop()
24{ 22{
25 if (pointer == 0) { 23 if (pointer == 0)
26 errorMsg("stack underflow\n"); 24 fatalError("stack underflow\n");
27 exit(-1);
28 }
29 return stack[--pointer]; 25 return stack[--pointer];
30} 26}
31 27
@@ -124,8 +120,7 @@ static void stack_machine(const char *argument)
124 } 120 }
125 o++; 121 o++;
126 } 122 }
127 errorMsg("%s: syntax error.\n", argument); 123 fatalError("%s: syntax error.\n", argument);
128 exit(-1);
129} 124}
130 125
131/* return pointer to next token in buffer and set *buffer to one char 126/* return pointer to next token in buffer and set *buffer to one char
@@ -182,5 +177,5 @@ int dc_main(int argc, char **argv)
182 } 177 }
183 } 178 }
184 stack_machine(0); 179 stack_machine(0);
185 return( TRUE); 180 return EXIT_SUCCESS;
186} 181}