[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/28] strtosz() use qemu_toupper() to simplify swit
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 02/28] strtosz() use qemu_toupper() to simplify switch statement |
Date: |
Mon, 31 Jan 2011 16:28:50 +0100 |
From: Jes Sorensen <address@hidden>
Signed-off-by: Jes Sorensen <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
cutils.c | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/cutils.c b/cutils.c
index a067cf4..78d35e2 100644
--- a/cutils.c
+++ b/cutils.c
@@ -323,16 +323,14 @@ int64_t strtosz_suffix(const char *nptr, char **end,
const char default_suffix)
d = c;
}
}
- switch (d) {
+ switch (qemu_toupper(d)) {
case 'B':
- case 'b':
mul = 1;
if (mul_required) {
goto fail;
}
break;
case 'K':
- case 'k':
mul = 1 << 10;
break;
case 0:
@@ -340,15 +338,12 @@ int64_t strtosz_suffix(const char *nptr, char **end,
const char default_suffix)
goto fail;
}
case 'M':
- case 'm':
mul = 1ULL << 20;
break;
case 'G':
- case 'g':
mul = 1ULL << 30;
break;
case 'T':
- case 't':
mul = 1ULL << 40;
break;
default:
--
1.7.2.3
- [Qemu-devel] [PULL 00/28] Block patches, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 01/28] strtosz(): use unsigned char and switch to qemu_isspace(), Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 04/28] strtosz(): Use suffix macros in switch() statement, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 02/28] strtosz() use qemu_toupper() to simplify switch statement,
Kevin Wolf <=
- [Qemu-devel] [PATCH 07/28] virtio-blk: tell the guest about size changes, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 03/28] strtosz(): Fix name confusion in use of modf(), Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 12/28] sheepdog: support creating images on remote hosts, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 05/28] block: add block_resize monitor command, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 08/28] virtio-pci: Disable virtio-ioeventfd when !CONFIG_IOTHREAD, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 10/28] ahci: Fix cpu_physical_memory_unmap() argument ordering, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 18/28] qcow2-refcount: remove write-only variables, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 15/28] qed: Images with backing file do not require QED_F_NEED_CHECK, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 11/28] Reorganize struct Qcow2Cache for better struct packing, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 14/28] qcow2: Add bdrv_discard support, Kevin Wolf, 2011/01/31