[PATCH 2/2] winecoreaudio.drv: Don't print 32-bit values as long integers. (Clang)

Andrew Eikum aeikum at codeweavers.com
Sat Feb 20 08:26:57 CST 2016


On Sat, Feb 20, 2016 at 01:19:43AM -0600, Ken Thomases wrote:
> Unfortunately, for historical compatibility reasons, these types are defined as (unsigned) long for 32-bit but (unsigned) int for 64-bit.  So, there's no one correct format specifier.  Well, at least not a cross-platform one supported by Wine's logging functions.
> 
> I'm ambivalent about using int instead of OSStatus, because I think it doesn't make the code significantly more confusing.  However, using unsigned int instead of AudioDeviceID seems like it loses important semantic information.  It's also likely to backslide as new code is written (assuming others habitually follow the API, as I would).
> 
> Also, stuff like seen in the hunk above where the type of "devices" is changed but the type of "default_id" is not, just because one is used in logging and the other is not, is bothersome.  If a new logging statement is added that starts logging default_id, will we have to change its type?  That's no way to live. ;)
> 

I agree, I don't think this is a good change. I think having the types
match the API has a lot of value, even if it's all the same to the
compiler, including OSStatus.

Does Apple provide inttypes-style (e.g. PRIu64) macros for these
types? Can we use them in Wine?

Andrew



More information about the wine-devel mailing list