strtosz(): Use suffix macros in switch() statement
authorJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 24 Jan 2011 15:33:31 +0000 (16:33 +0100)
committerKevin Wolf <kwolf@redhat.com>
Mon, 31 Jan 2011 09:03:00 +0000 (10:03 +0100)
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
cutils.c

index 369a01687575945dfddadf27a34e7b1d767f37f1..8d562b28ab0d5fb71c0fa88a44cdcdcd623af2b2 100644 (file)
--- a/cutils.c
+++ b/cutils.c
@@ -324,26 +324,26 @@ int64_t strtosz_suffix(const char *nptr, char **end, const char default_suffix)
         }
     }
     switch (qemu_toupper(d)) {
-    case 'B':
+    case STRTOSZ_DEFSUFFIX_B:
         mul = 1;
         if (mul_required) {
             goto fail;
         }
         break;
-    case 'K':
+    case STRTOSZ_DEFSUFFIX_KB:
         mul = 1 << 10;
         break;
     case 0:
         if (mul_required) {
             goto fail;
         }
-    case 'M':
+    case STRTOSZ_DEFSUFFIX_MB:
         mul = 1ULL << 20;
         break;
-    case 'G':
+    case STRTOSZ_DEFSUFFIX_GB:
         mul = 1ULL << 30;
         break;
-    case 'T':
+    case STRTOSZ_DEFSUFFIX_TB:
         mul = 1ULL << 40;
         break;
     default: