assemble: Use case3/4 where appropriate
authorCyrill Gorcunov <gorcunov@gmail.com>
Sat, 1 Dec 2012 22:51:18 +0000 (02:51 +0400)
committerCyrill Gorcunov <gorcunov@gmail.com>
Fri, 1 Mar 2013 22:59:21 +0000 (02:59 +0400)
This allows to shrink code a bit.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
assemble.c

index 0f3a338..76b147f 100644 (file)
@@ -840,16 +840,11 @@ static int64_t calcsize(int32_t segment, int64_t offset, int bits,
         opex = 0;               /* For the next iteration */
 
         switch (c) {
-        case 01:
-        case 02:
-        case 03:
-        case 04:
+        case4(01):
             codes += c, length += c;
             break;
 
-        case 05:
-        case 06:
-        case 07:
+        case3(05):
             opex = c;
             break;
 
@@ -938,9 +933,7 @@ static int64_t calcsize(int32_t segment, int64_t offset, int bits,
             ins->vex_wlp = *codes++;
             break;
 
-        case 0271:
-        case 0272:
-        case 0273:
+        case3(0271):
             hleok = c & 3;
             break;
 
@@ -1064,9 +1057,7 @@ static int64_t calcsize(int32_t segment, int64_t offset, int bits,
         case 0360:
             break;
 
-        case 0361:
-        case 0362:
-        case 0363:
+        case3(0361):
             length++;
             break;
 
@@ -1079,9 +1070,7 @@ static int64_t calcsize(int32_t segment, int64_t offset, int bits,
             length++;
             break;
 
-        case 0370:
-        case 0371:
-        case 0372:
+        case3(0370):
             break;
 
         case 0373: