]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Finished cleanng up mess: multiplication reinstalled.
authorPavel Machek <pavel@ucw.cz>
Wed, 17 May 2000 12:14:05 +0000 (12:14 +0000)
committerPavel Machek <pavel@ucw.cz>
Wed, 17 May 2000 12:14:05 +0000 (12:14 +0000)
filter/filter.c

index 3a1ee0749ba92ba979cf78dbf2515537a89f01ad..dd3700886c888a233abb311fff63d4a9704a3315 100644 (file)
@@ -230,6 +230,22 @@ interpret(struct f_inst *what)
     default: runtime( "Usage of unknown type" );
     }
     break;
+  case '-':
+    TWOARGS_C;
+    switch (res.type = v1.type) {
+    case T_VOID: runtime( "Can not operate with values of type void" );
+    case T_INT: res.val.i = v1.val.i - v2.val.i; break;
+    default: runtime( "Usage of unknown type" );
+    }
+    break;
+  case '*':
+    TWOARGS_C;
+    switch (res.type = v1.type) {
+    case T_VOID: runtime( "Can not operate with values of type void" );
+    case T_INT: res.val.i = v1.val.i * v2.val.i; break;
+    default: runtime( "Usage of unknown type" );
+    }
+    break;
   case '/':
     TWOARGS_C;
     switch (res.type = v1.type) {
@@ -582,6 +598,8 @@ i_same(struct f_inst *f1, struct f_inst *f2)
   switch(f1->code) {
   case ',': /* fall through */
   case '+':
+  case '-':
+  case '*':
   case '/':
   case P('!','='):
   case P('=','='):