Test commit
[cogito/jonas.git] / Documentation / tutorial-script / 0008-alice-clear.patch
blob96ec6b259140bbf73f16f63aa8250fbc70f02ab7
1 diff --git a/rpn.c b/rpn.c
2 --- a/rpn.c
3 +++ b/rpn.c
4 @@ -11,6 +11,7 @@ double val;
6 extern double pop(void);
7 extern void push(double);
8 +extern void clear(void);
10 extern int getsym(void);
12 @@ -53,6 +54,9 @@ int main(void)
13 case 'd':
14 pop();
15 break;
16 + case 'C':
17 + clear();
18 + break;
19 default:
20 fprintf(stderr, "Unknown '%c'\n", sym);
21 return 1;
22 diff --git a/stack.c b/stack.c
23 --- a/stack.c
24 +++ b/stack.c
25 @@ -19,3 +19,8 @@ double pop(void)
27 return stack[top--];
30 +void clear(void)
32 + top = -1;