[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() st
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement |
Date: |
Mon, 24 Jan 2011 18:47:17 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Jes Sorensen <address@hidden> writes:
> On 01/24/11 17:39, Markus Armbruster wrote:
>>>>> + case STRTOSZ_DEFSUFFIX_TB:
>>>>> >>> mul = 1ULL << 40;
>>>>> >>> break;
>>>>> >>> default:
>>>> >>
>>>> >> Phony abstraction. And it leaks: code here assumes the
>>>> >> STRTOSZ_DEFSUFFIX_T* are all upper case.
>>> >
>>> > qemu_toupper() - whats the problem?
>> If a STRTOSZ_DEFSUFFIX_T? expands to a lower case character, its case
>> will not match any input.
>
> Right, so one has to be careful when adding new suffix constants.
Calls for a comment right next to the definition of the
STRTOSZ_DEFSUFFIX_T*.
I hate unstated restrictions that are hidden far away from the place
where you can break them.
> However given that we already have all the likely to be used ones for
> the near future, that isn't exactly a big issue.
>
> On the other hand forcing the use of the macros makes it less likely
> that someone specifies an unsupported constant by hitting 'y' instead of
> 't' or similar.
Takes a combination of butterfingers, cross-eyedness, and near-total
incompetence at basic smoke-testing.
- [Qemu-devel] [PATCH 1/4] strtosz(): use unsigned char and switch to qemu_isspace(), (continued)
- [Qemu-devel] [PATCH 2/4] strtosz() use qemu_toupper() to simplify switch statement, Jes . Sorensen, 2011/01/24
- [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement, Jes . Sorensen, 2011/01/24
- Re: [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement, Markus Armbruster, 2011/01/24
- Re: [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement, Jes Sorensen, 2011/01/24
- Re: [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement, Markus Armbruster, 2011/01/24
- Re: [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement, Jes Sorensen, 2011/01/24
- Re: [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement,
Markus Armbruster <=
- Re: [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement, Jes Sorensen, 2011/01/25
- Re: [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement, Markus Armbruster, 2011/01/25
- Re: [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement, Jes Sorensen, 2011/01/25
[Qemu-devel] [PATCH 3/4] strtosz(): Fix name confusion in use of modf(), Jes . Sorensen, 2011/01/24
[Qemu-devel] Re: [PATCH v4 0/4] strtosz() cleanups, Kevin Wolf, 2011/01/24