Scicos_blocks src: fix EXPRESSION block 89/18389/2
Paul Bignier [Mon, 25 Jul 2016 13:56:27 +0000 (15:56 +0200)]
 * https://codereview.scilab.org/#/c/18018/ fixed a missing "default" but previous case fell into it!

Change-Id: I636a7dc44337d37d2beec3da924c92deb5442eb3

scilab/modules/scicos_blocks/src/c/evaluate_expr.c

index 4a2c858..ccde9ea 100644 (file)
@@ -491,11 +491,11 @@ SCICOS_BLOCKS_IMPEXP void evaluate_expr(scicos_block *block, int flag)
                                 stack[bottom] = (double) block->mode[nzcr];
                             }
                             break;
-                        /*  if (stack[bottom]>0) {
-                          stack[bottom]=floor(stack[bottom]+.5);
-                        }else{
-                          stack[bottom]=ceil(stack[bottom]-.5);
-                        }*/
+                            /*  if (stack[bottom]>0) {
+                              stack[bottom]=floor(stack[bottom]+.5);
+                            }else{
+                              stack[bottom]=ceil(stack[bottom]-.5);
+                            }*/
                         case 111:
                             if (block->ng > 0)
                             {
@@ -595,13 +595,13 @@ SCICOS_BLOCKS_IMPEXP void evaluate_expr(scicos_block *block, int flag)
                                 stack[bottom] = (double) block->mode[nzcr];
                             }
                             break;
-                        /* if (stack[bottom]>0) {
-                          stack[bottom]=1.0;
-                        }else if(stack[bottom]<0){
-                          stack[bottom]=-1.0;
-                        }else{
-                          stack[bottom]=0.0;
-                          }*/
+                            /* if (stack[bottom]>0) {
+                              stack[bottom]=1.0;
+                            }else if(stack[bottom]<0){
+                              stack[bottom]=-1.0;
+                            }else{
+                              stack[bottom]=0.0;
+                              }*/
                         case 114:  /* abs */
                             if (block->ng > 0)
                             {
@@ -643,11 +643,11 @@ SCICOS_BLOCKS_IMPEXP void evaluate_expr(scicos_block *block, int flag)
                                 stack[bottom] = stack[bottom] * (block->mode[nzcr]);
                             }
                             break;
-                        /* if (stack[bottom]>0) {
-                          stack[bottom]=stack[bottom];
-                        }else {
-                          stack[bottom]=-stack[bottom];
-                          }*/
+                            /* if (stack[bottom]>0) {
+                              stack[bottom]=stack[bottom];
+                            }else {
+                              stack[bottom]=-stack[bottom];
+                              }*/
                         case 115:
                             if (block->ng > 0)
                             {
@@ -737,6 +737,8 @@ SCICOS_BLOCKS_IMPEXP void evaluate_expr(scicos_block *block, int flag)
                             stack[bottom] = log10(stack[bottom]);
                             break;
                     }
+                    break;
+
                 default:
                     set_block_error(-2);
                     return;