On Sun, Jan 22, 2012 at 6:55 AM, Enlightenment SVN <[email protected]> wrote: > Log: > Eina "Fix" printf conversion format on Windows. printf family on Windows is > just plain weirdness > +#ifdef _WIN32 > +# define FMT_CHAR "%c" > +# define FMT_UCHAR "%c" > +# define FMT_XCHAR "%c" > +# define FMT_OCHAR "%c" > +# define FMT_2XCHAR "%2c" > +#else > +# define FMT_CHAR "%hhd" > +# define FMT_UCHAR "%hhu" > +# define FMT_XCHAR "%hhx" > +# define FMT_OCHAR "%hho" > +# define FMT_2XCHAR "%02hhx" > +#endif
this is wrong. %c = character value, or "as character", 'a' not 97. %hhu = numeric value with single byte size, 97 not 'a'. %hhx = numeric value in hexadecimal base, 0x61 not 'a' %hho = numeric value in octagonal base, 0141 not 'a' On Linux the interface to pass variable size parameters promote small types to big ones, so "unsigned char" (%hhu) and "unsigned short" (%hu) will all use 4 bytes, that said the "h" modifier is just to save on the formatter size as "%u", "%x" and "%o" would work as well. -- Gustavo Sverzut Barbieri http://profusion.mobi embedded systems -------------------------------------- MSN: [email protected] Skype: gsbarbieri Mobile: +55 (19) 9225-2202 ------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
