On Sat, Jan 19, 2013 at 10:35 AM, Michael Tokarev <m...@tls.msk.ru> wrote: > 19.01.2013 13:33, Blue Swirl wrote: >> >> On Fri, Jan 18, 2013 at 4:17 PM, Anthony Liguori <anth...@codemonkey.ws> >> wrote: >>> >>> Markus Armbruster <arm...@redhat.com> 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