summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2012-12-02 02:51:18 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2012-12-03 01:34:19 +0400
commit0564bd8369783d44bbb4759dd23690eb361988c0 (patch)
tree2a9f0d6aa890fdb240c9f94579e2dbb21434f013
parentea135e8e731253986c3b384699584b96d8c35cc1 (diff)
downloadnasm-0564bd8369783d44bbb4759dd23690eb361988c0.tar.gz
assemble: Use case3/4 where appropriate
This allows to shrink code a bit. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r--assemble.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/assemble.c b/assemble.c
index 48c82ad9..1e268d96 100644
--- a/assemble.c
+++ b/assemble.c
@@ -867,16 +867,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;
@@ -988,9 +983,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;
@@ -1111,9 +1104,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;
@@ -1126,9 +1117,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: