[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/2] strtosz(): Use suffix macros in switch() st
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH 2/2] strtosz(): Use suffix macros in switch() statement |
Date: |
Tue, 18 Jan 2011 10:20:54 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
address@hidden writes:
> From: Jes Sorensen <address@hidden>
>
> Signed-off-by: Jes Sorensen <address@hidden>
> ---
> cutils.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/cutils.c b/cutils.c
> index 328738c..f2c8bbd 100644
> --- a/cutils.c
> +++ b/cutils.c
> @@ -324,26 +324,26 @@ ssize_t strtosz_suffix(const char *nptr, char **end,
> const char default_suffix)
> }
> }
> switch (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:
And this improves what? Certainly not clarity.
In my opinion, the STRTOSZ_DEFSUFFIX_TB are useless chaff. Chacun à son
goût.
- [Qemu-devel] [PATCH 0/2] strtosz() more cleanups, Jes . Sorensen, 2011/01/17
- [Qemu-devel] [PATCH 1/2] strtosz(): Fix name confusion in use of modf(), Jes . Sorensen, 2011/01/17
- [Qemu-devel] [PATCH 2/2] strtosz(): Use suffix macros in switch() statement, Jes . Sorensen, 2011/01/17
- Re: [Qemu-devel] [PATCH 2/2] strtosz(): Use suffix macros in switch() statement,
Markus Armbruster <=
- Re: [Qemu-devel] [PATCH 2/2] strtosz(): Use suffix macros in switch() statement, Jes Sorensen, 2011/01/18
- Re: [Qemu-devel] [PATCH 2/2] strtosz(): Use suffix macros in switch() statement, Alex Williamson, 2011/01/18
- Re: [Qemu-devel] [PATCH 2/2] strtosz(): Use suffix macros in switch() statement, Anthony Liguori, 2011/01/18
- Re: [Qemu-devel] [PATCH 2/2] strtosz(): Use suffix macros in switch() statement, Jes Sorensen, 2011/01/18
- Re: [Qemu-devel] [PATCH 2/2] strtosz(): Use suffix macros in switch() statement, Eric Blake, 2011/01/18
- Re: [Qemu-devel] [PATCH 2/2] strtosz(): Use suffix macros in switch() statement, Anthony Liguori, 2011/01/18
- Re: [Qemu-devel] [PATCH 2/2] strtosz(): Use suffix macros in switch() statement, Jes Sorensen, 2011/01/18
- Re: [Qemu-devel] [PATCH 2/2] strtosz(): Use suffix macros in switch() statement, Anthony Liguori, 2011/01/18
- Re: [Qemu-devel] [PATCH 2/2] strtosz(): Use suffix macros in switch() statement, Jes Sorensen, 2011/01/19
[Qemu-devel] Re: [PATCH 0/2] strtosz() more cleanups, Alex Williamson, 2011/01/17