[PATCH 2/2 v3] winecoreaudio.drv: Don't print 32-bit values as long integers. (Clang)
Andrew Eikum
aeikum at codeweavers.com
Tue Feb 23 08:03:49 CST 2016
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
On Mon, Feb 22, 2016 at 04:23:42PM -0700, Charles Davis wrote:
> Signed-off-by: Charles Davis <cdavis5x at gmail.com>
> ---
> Try 3: Go back to casting for OSStatus, too.
>
> dlls/winecoreaudio.drv/mmdevdrv.c | 64 +++++++++++++++++++--------------------
> 1 file changed, 32 insertions(+), 32 deletions(-)
>
> diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c
> index 60ff3d9..9f9fd0d 100644
> --- a/dlls/winecoreaudio.drv/mmdevdrv.c
> +++ b/dlls/winecoreaudio.drv/mmdevdrv.c
> @@ -406,7 +406,7 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids,
> sc = AudioObjectGetPropertyData(kAudioObjectSystemObject, &addr, 0,
> NULL, &size, &default_id);
> if(sc != noErr){
> - WARN("Getting _DefaultInputDevice property failed: %lx\n", sc);
> + WARN("Getting _DefaultInputDevice property failed: %x\n", (int)sc);
> default_id = -1;
> }
>
> @@ -414,7 +414,7 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids,
> sc = AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, &addr, 0,
> NULL, &devsize);
> if(sc != noErr){
> - WARN("Getting _Devices property size failed: %lx\n", sc);
> + WARN("Getting _Devices property size failed: %x\n", (int)sc);
> return osstatus_to_hresult(sc);
> }
>
> @@ -425,7 +425,7 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids,
> sc = AudioObjectGetPropertyData(kAudioObjectSystemObject, &addr, 0, NULL,
> &devsize, devices);
> if(sc != noErr){
> - WARN("Getting _Devices property failed: %lx\n", sc);
> + WARN("Getting _Devices property failed: %x\n", (int)sc);
> HeapFree(GetProcessHeap(), 0, devices);
> return osstatus_to_hresult(sc);
> }
> @@ -462,7 +462,7 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids,
> sc = AudioObjectGetPropertyDataSize(devices[i], &addr, 0, NULL, &size);
> if(sc != noErr){
> WARN("Unable to get _StreamConfiguration property size for "
> - "device %lu: %lx\n", devices[i], sc);
> + "device %u: %x\n", (unsigned int)devices[i], (int)sc);
> continue;
> }
>
> @@ -480,7 +480,7 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids,
> &size, buffers);
> if(sc != noErr){
> WARN("Unable to get _StreamConfiguration property for "
> - "device %lu: %lx\n", devices[i], sc);
> + "device %u: %x\n", (unsigned int)devices[i], (int)sc);
> HeapFree(GetProcessHeap(), 0, buffers);
> continue;
> }
> @@ -502,8 +502,8 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids,
> sc = AudioObjectGetPropertyData(devices[i], &addr, 0, NULL,
> &size, &name);
> if(sc != noErr){
> - WARN("Unable to get _Name property for device %lu: %lx\n",
> - devices[i], sc);
> + WARN("Unable to get _Name property for device %u: %x\n",
> + (unsigned int)devices[i], (int)sc);
> continue;
> }
>
> @@ -621,7 +621,7 @@ static AudioComponentInstance get_audiounit(EDataFlow dataflow, AudioDeviceID ad
>
> sc = AudioComponentInstanceNew(comp, &unit);
> if(sc != noErr){
> - WARN("AudioComponentInstanceNew failed: %lx\n", sc);
> + WARN("AudioComponentInstanceNew failed: %x\n", (int)sc);
> return NULL;
> }
>
> @@ -632,7 +632,7 @@ static AudioComponentInstance get_audiounit(EDataFlow dataflow, AudioDeviceID ad
> sc = AudioUnitSetProperty(unit, kAudioOutputUnitProperty_EnableIO,
> kAudioUnitScope_Input, 1, &enableio, sizeof(enableio));
> if(sc != noErr){
> - WARN("Couldn't enable I/O on input element: %lx\n", sc);
> + WARN("Couldn't enable I/O on input element: %x\n", (int)sc);
> AudioComponentInstanceDispose(unit);
> return NULL;
> }
> @@ -641,7 +641,7 @@ static AudioComponentInstance get_audiounit(EDataFlow dataflow, AudioDeviceID ad
> sc = AudioUnitSetProperty(unit, kAudioOutputUnitProperty_EnableIO,
> kAudioUnitScope_Output, 0, &enableio, sizeof(enableio));
> if(sc != noErr){
> - WARN("Couldn't disable I/O on output element: %lx\n", sc);
> + WARN("Couldn't disable I/O on output element: %x\n", (int)sc);
> AudioComponentInstanceDispose(unit);
> return NULL;
> }
> @@ -1131,7 +1131,7 @@ static void capture_resample(ACImpl *This)
> sc = AudioConverterFillComplexBuffer(This->converter, feed_cb,
> This, &wanted_frames, &converted_list, NULL);
> if(sc != noErr){
> - WARN("AudioConverterFillComplexBuffer failed: %lx\n", sc);
> + WARN("AudioConverterFillComplexBuffer failed: %x\n", (int)sc);
> break;
> }
>
> @@ -1215,11 +1215,11 @@ static OSStatus ca_capture_cb(void *user, AudioUnitRenderActionFlags *flags,
> static void dump_adesc(const char *aux, AudioStreamBasicDescription *desc)
> {
> TRACE("%s: mSampleRate: %f\n", aux, desc->mSampleRate);
> - TRACE("%s: mBytesPerPacket: %ld\n", aux, desc->mBytesPerPacket);
> - TRACE("%s: mFramesPerPacket: %ld\n", aux, desc->mFramesPerPacket);
> - TRACE("%s: mBytesPerFrame: %ld\n", aux, desc->mBytesPerFrame);
> - TRACE("%s: mChannelsPerFrame: %ld\n", aux, desc->mChannelsPerFrame);
> - TRACE("%s: mBitsPerChannel: %ld\n", aux, desc->mBitsPerChannel);
> + TRACE("%s: mBytesPerPacket: %u\n", aux, (unsigned int)desc->mBytesPerPacket);
> + TRACE("%s: mFramesPerPacket: %u\n", aux, (unsigned int)desc->mFramesPerPacket);
> + TRACE("%s: mBytesPerFrame: %u\n", aux, (unsigned int)desc->mBytesPerFrame);
> + TRACE("%s: mChannelsPerFrame: %u\n", aux, (unsigned int)desc->mChannelsPerFrame);
> + TRACE("%s: mBitsPerChannel: %u\n", aux, (unsigned int)desc->mBitsPerChannel);
> }
>
> static HRESULT ca_setup_audiounit(EDataFlow dataflow, AudioComponentInstance unit,
> @@ -1245,7 +1245,7 @@ static HRESULT ca_setup_audiounit(EDataFlow dataflow, AudioComponentInstance uni
> sc = AudioUnitGetProperty(unit, kAudioUnitProperty_StreamFormat,
> kAudioUnitScope_Input, 1, dev_desc, &size);
> if(sc != noErr){
> - WARN("Couldn't get unit format: %lx\n", sc);
> + WARN("Couldn't get unit format: %x\n", (int)sc);
> return osstatus_to_hresult(sc);
> }
> dump_adesc("hardware", dev_desc);
> @@ -1258,13 +1258,13 @@ static HRESULT ca_setup_audiounit(EDataFlow dataflow, AudioComponentInstance uni
> sc = AudioUnitSetProperty(unit, kAudioUnitProperty_StreamFormat,
> kAudioUnitScope_Output, 1, dev_desc, sizeof(*dev_desc));
> if(sc != noErr){
> - WARN("Couldn't set unit format: %lx\n", sc);
> + WARN("Couldn't set unit format: %x\n", (int)sc);
> return osstatus_to_hresult(sc);
> }
>
> sc = AudioConverterNew(dev_desc, &desc, converter);
> if(sc != noErr){
> - WARN("Couldn't create audio converter: %lx\n", sc);
> + WARN("Couldn't create audio converter: %x\n", (int)sc);
> return osstatus_to_hresult(sc);
> }
> }else{
> @@ -1276,7 +1276,7 @@ static HRESULT ca_setup_audiounit(EDataFlow dataflow, AudioComponentInstance uni
> sc = AudioUnitSetProperty(unit, kAudioUnitProperty_StreamFormat,
> kAudioUnitScope_Input, 0, dev_desc, sizeof(*dev_desc));
> if(sc != noErr){
> - WARN("Couldn't set format: %lx\n", sc);
> + WARN("Couldn't set format: %x\n", (int)sc);
> return osstatus_to_hresult(sc);
> }
> }
> @@ -1383,7 +1383,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
> sc = AudioUnitSetProperty(This->unit, kAudioOutputUnitProperty_SetInputCallback,
> kAudioUnitScope_Output, 1, &input, sizeof(input));
> if(sc != noErr){
> - WARN("Couldn't set callback: %lx\n", sc);
> + WARN("Couldn't set callback: %x\n", (int)sc);
> AudioConverterDispose(This->converter);
> This->converter = NULL;
> CoTaskMemFree(This->fmt);
> @@ -1401,7 +1401,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
> sc = AudioUnitSetProperty(This->unit, kAudioUnitProperty_SetRenderCallback,
> kAudioUnitScope_Input, 0, &input, sizeof(input));
> if(sc != noErr){
> - WARN("Couldn't set callback: %lx\n", sc);
> + WARN("Couldn't set callback: %x\n", (int)sc);
> CoTaskMemFree(This->fmt);
> This->fmt = NULL;
> OSSpinLockUnlock(&This->lock);
> @@ -1411,7 +1411,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
>
> sc = AudioUnitInitialize(This->unit);
> if(sc != noErr){
> - WARN("Couldn't initialize: %lx\n", sc);
> + WARN("Couldn't initialize: %x\n", (int)sc);
> if(This->converter){
> AudioConverterDispose(This->converter);
> This->converter = NULL;
> @@ -1426,7 +1426,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
> * a while to return */
> sc = AudioOutputUnitStart(This->unit);
> if(sc != noErr){
> - WARN("Unit failed to start: %lx\n", sc);
> + WARN("Unit failed to start: %x\n", (int)sc);
> if(This->converter){
> AudioConverterDispose(This->converter);
> This->converter = NULL;
> @@ -1525,7 +1525,7 @@ static HRESULT ca_get_max_stream_latency(ACImpl *This, UInt32 *max)
> sc = AudioObjectGetPropertyDataSize(This->adevid, &addr, 0, NULL,
> &size);
> if(sc != noErr){
> - WARN("Unable to get size for _Streams property: %lx\n", sc);
> + WARN("Unable to get size for _Streams property: %x\n", (int)sc);
> return osstatus_to_hresult(sc);
> }
>
> @@ -1535,7 +1535,7 @@ static HRESULT ca_get_max_stream_latency(ACImpl *This, UInt32 *max)
>
> sc = AudioObjectGetPropertyData(This->adevid, &addr, 0, NULL, &size, ids);
> if(sc != noErr){
> - WARN("Unable to get _Streams property: %lx\n", sc);
> + WARN("Unable to get _Streams property: %x\n", (int)sc);
> HeapFree(GetProcessHeap(), 0, ids);
> return osstatus_to_hresult(sc);
> }
> @@ -1551,7 +1551,7 @@ static HRESULT ca_get_max_stream_latency(ACImpl *This, UInt32 *max)
> sc = AudioObjectGetPropertyData(ids[i], &addr, 0, NULL,
> &size, &latency);
> if(sc != noErr){
> - WARN("Unable to get _Latency property: %lx\n", sc);
> + WARN("Unable to get _Latency property: %x\n", (int)sc);
> continue;
> }
>
> @@ -1593,7 +1593,7 @@ static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient *iface,
> sc = AudioObjectGetPropertyData(This->adevid, &addr, 0, NULL,
> &size, &latency);
> if(sc != noErr){
> - WARN("Couldn't get _Latency property: %lx\n", sc);
> + WARN("Couldn't get _Latency property: %x\n", (int)sc);
> OSSpinLockUnlock(&This->lock);
> return osstatus_to_hresult(sc);
> }
> @@ -1756,7 +1756,7 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
> sc = AudioObjectGetPropertyDataSize(This->adevid, &addr, 0, NULL, &size);
> if(sc != noErr){
> CoTaskMemFree(fmt);
> - WARN("Unable to get size for _StreamConfiguration property: %lx\n", sc);
> + WARN("Unable to get size for _StreamConfiguration property: %x\n", (int)sc);
> return osstatus_to_hresult(sc);
> }
>
> @@ -1771,7 +1771,7 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
> if(sc != noErr){
> CoTaskMemFree(fmt);
> HeapFree(GetProcessHeap(), 0, buffers);
> - WARN("Unable to get _StreamConfiguration property: %lx\n", sc);
> + WARN("Unable to get _StreamConfiguration property: %x\n", (int)sc);
> return osstatus_to_hresult(sc);
> }
>
> @@ -1788,7 +1788,7 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
> sc = AudioObjectGetPropertyData(This->adevid, &addr, 0, NULL, &size, &rate);
> if(sc != noErr){
> CoTaskMemFree(fmt);
> - WARN("Unable to get _NominalSampleRate property: %lx\n", sc);
> + WARN("Unable to get _NominalSampleRate property: %x\n", (int)sc);
> return osstatus_to_hresult(sc);
> }
> fmt->Format.nSamplesPerSec = rate;
> @@ -2842,7 +2842,7 @@ static HRESULT ca_setvol(ACImpl *This, UINT32 index)
> sc = AudioUnitSetParameter(This->unit, kHALOutputParam_Volume,
> kAudioUnitScope_Global, 0, level, 0);
> if(sc != noErr)
> - WARN("Couldn't set volume: %lx\n", sc);
> + WARN("Couldn't set volume: %x\n", (int)sc);
>
> return S_OK;
> }
> --
> 2.7.1
>
More information about the wine-patches
mailing list