[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 0/3] Purge the silly GLib Basic Types
From: |
Blue Swirl |
Subject: |
Re: [Qemu-devel] [PATCH 0/3] Purge the silly GLib Basic Types |
Date: |
Sat, 19 Jan 2013 11:20:59 +0000 |
On Sat, Jan 19, 2013 at 10:35 AM, Michael Tokarev <address@hidden> wrote:
> 19.01.2013 13:33, Blue Swirl wrote:
>>
>> On Fri, Jan 18, 2013 at 4:17 PM, Anthony Liguori <address@hidden>
>> wrote:
>>>
>>> Markus Armbruster <address@hidden> writes:
>>>
>>>> See PATCH 1/3 for rationale.
>>>>
>>>> Markus Armbruster (3):
>>>> Purge the silly GLib "Basic Types", except for gboolean
>>>> Purge GLib's gboolean, it's a trap for the unwary
>>>> checkpatch: Keep out the GLib silliness we just purged
>>>
>>>
>>> Changing QEMU code to work around checkpatch's failing is insane.
>>>
>>> When interacting with glib, use glib types. Not using those types just
>>> makes the code more difficult to understand.
>>
>>
>> While the types are indeed useless and even cause problems (gboolean),
>> I agree with Anthony. It's the same as using DWORD for Win32 APIs.
>
>
> Actually it is far from DWORD. DWORD is like uint32_t, where no
> standard C type matches (since these depends on the word size etc).
> So in Win32, these DWORDs are justified.
I think they are historic remnants of Win16. The machine word size has
not been 16 bits since ages and so double word should be 2 * 32 = 64
bits on Win32, QWORD should be 256 bits on Win64.
MS could have started using the standard types at some point: uint32_t
if the API needs 32 bits, long or intptr_t for machine words etc. I
don't agree with their compatibility strategy, but I don't appreciate
very much the Linux version (no ABI breakages ever) either.
>
> With GLib, things are sillier than that, since they redefine _standard_
> C types, without gaining anything in portability.
>
> /mjt
- [Qemu-devel] [PATCH 0/3] Purge the silly GLib Basic Types, Markus Armbruster, 2013/01/18
- [Qemu-devel] [PATCH 3/3] checkpatch: Keep out the GLib silliness we just purged, Markus Armbruster, 2013/01/18
- [Qemu-devel] [PATCH 2/3] Purge GLib's gboolean, it's a trap for the unwary, Markus Armbruster, 2013/01/18
- [Qemu-devel] [PATCH 1/3] Purge the silly GLib "Basic Types", except for gboolean, Markus Armbruster, 2013/01/18
- Re: [Qemu-devel] [PATCH 0/3] Purge the silly GLib Basic Types, Anthony Liguori, 2013/01/18