From: Jes Sorensen Date: Mon, 24 Jan 2011 15:33:29 +0000 (+0100) Subject: strtosz() use qemu_toupper() to simplify switch statement X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~3639 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c1b00c3bb392e981cc55e7013616eacc23d3632f;p=sdk%2Femulator%2Fqemu.git strtosz() use qemu_toupper() to simplify switch statement Signed-off-by: Jes Sorensen Signed-off-by: Kevin Wolf --- diff --git a/cutils.c b/cutils.c index a067cf45b3..78d35e23ca 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: