qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] Darwin CoreAudio warning fixes
@ 2011-06-23 11:43 Andreas Färber
  2011-06-23 11:43 ` [Qemu-devel] [PATCH RFT 1/2] coreaudio: Fix OSStatus format specifier Andreas Färber
  2011-06-23 11:48 ` [Qemu-devel] [PATCH 0/2] Darwin CoreAudio warning fixes Andreas Färber
  0 siblings, 2 replies; 11+ messages in thread
From: Andreas Färber @ 2011-06-23 11:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: cerbere, Andreas Färber

Hello,

These patches fix two format related warnings noticed on Darwin/ppc64 host (LP64).
They will probably affect Darwin/x86_64, too.

Three warnings remain: 1x CoreAudioAddIOProc, 2x CoreAudioRemoveIOProc being deprecated.

Regards,
Andreas


Andreas Färber (2):
  coreaudio: Fix OSStatus format specifier
  coreaudio: Fix format for UInt32 type

 audio/coreaudio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

-- 
1.7.5.3

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH RFT 1/2] coreaudio: Fix OSStatus format specifier
  2011-06-23 11:43 [Qemu-devel] [PATCH 0/2] Darwin CoreAudio warning fixes Andreas Färber
@ 2011-06-23 11:43 ` Andreas Färber
  2011-06-23 11:43   ` [Qemu-devel] [PATCH 2/2] coreaudio: Fix format for UInt32 type Andreas Färber
  2011-06-23 12:54   ` [Qemu-devel] [PATCH RFT 1/2] coreaudio: Fix OSStatus format specifier malc
  2011-06-23 11:48 ` [Qemu-devel] [PATCH 0/2] Darwin CoreAudio warning fixes Andreas Färber
  1 sibling, 2 replies; 11+ messages in thread
From: Andreas Färber @ 2011-06-23 11:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: cerbere, Andreas Färber

OSStatus type is defined as SInt32.
Use %d format instead of %ld to avoid a warning on ppc64.

Cc: Alexandre Raymond <cerbere@gmail.com>
Cc: malc <av1474@comtv.ru>
Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
---
 Alexandre, Could you please test this on v10.6? Thanks!
 
 audio/coreaudio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/audio/coreaudio.c b/audio/coreaudio.c
index 3bd75cd..d2b9248 100644
--- a/audio/coreaudio.c
+++ b/audio/coreaudio.c
@@ -104,7 +104,7 @@ static void coreaudio_logstatus (OSStatus status)
         break;
 
     default:
-        AUD_log (AUDIO_CAP, "Reason: status code %ld\n", status);
+        AUD_log (AUDIO_CAP, "Reason: status code %d\n", status);
         return;
     }
 
-- 
1.7.5.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 2/2] coreaudio: Fix format for UInt32 type
  2011-06-23 11:43 ` [Qemu-devel] [PATCH RFT 1/2] coreaudio: Fix OSStatus format specifier Andreas Färber
@ 2011-06-23 11:43   ` Andreas Färber
  2011-06-23 12:54   ` [Qemu-devel] [PATCH RFT 1/2] coreaudio: Fix OSStatus format specifier malc
  1 sibling, 0 replies; 11+ messages in thread
From: Andreas Färber @ 2011-06-23 11:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: cerbere, Andreas Färber

coreaudioVoiceOut's audioDevicePropertyBufferFrameSize is defined as UInt32.
Use %u instead of %ld to avoid a warning on ppc64.

Cc: malc <av1474@comtv.ru>
Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
---
 audio/coreaudio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/audio/coreaudio.c b/audio/coreaudio.c
index d2b9248..69a0f05 100644
--- a/audio/coreaudio.c
+++ b/audio/coreaudio.c
@@ -360,7 +360,7 @@ static int coreaudio_init_out (HWVoiceOut *hw, struct audsettings *as)
         &core->audioDevicePropertyBufferFrameSize);
     if (status != kAudioHardwareNoError) {
         coreaudio_logerr2 (status, typ,
-                           "Could not set device buffer frame size %ld\n",
+                           "Could not set device buffer frame size %u\n",
                            core->audioDevicePropertyBufferFrameSize);
         return -1;
     }
-- 
1.7.5.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH 0/2] Darwin CoreAudio warning fixes
  2011-06-23 11:43 [Qemu-devel] [PATCH 0/2] Darwin CoreAudio warning fixes Andreas Färber
  2011-06-23 11:43 ` [Qemu-devel] [PATCH RFT 1/2] coreaudio: Fix OSStatus format specifier Andreas Färber
@ 2011-06-23 11:48 ` Andreas Färber
  1 sibling, 0 replies; 11+ messages in thread
From: Andreas Färber @ 2011-06-23 11:48 UTC (permalink / raw)
  To: qemu-devel Developers

Am 23.06.2011 um 13:43 schrieb Andreas Färber:

> Hello,
>
> These patches fix two format related warnings noticed on Darwin/ 
> ppc64 host (LP64).
> They will probably affect Darwin/x86_64, too.
>
> Three warnings remain: 1x CoreAudioAddIOProc, 2x  
> CoreAudioRemoveIOProc being deprecated.

Erm, AudioDevice{Add,Remove}IOProc.

> Regards,
> Andreas
>
>
> Andreas Färber (2):
>  coreaudio: Fix OSStatus format specifier
>  coreaudio: Fix format for UInt32 type
>
> audio/coreaudio.c |    4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> -- 
> 1.7.5.3

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH RFT 1/2] coreaudio: Fix OSStatus format specifier
  2011-06-23 11:43 ` [Qemu-devel] [PATCH RFT 1/2] coreaudio: Fix OSStatus format specifier Andreas Färber
  2011-06-23 11:43   ` [Qemu-devel] [PATCH 2/2] coreaudio: Fix format for UInt32 type Andreas Färber
@ 2011-06-23 12:54   ` malc
  2011-06-23 14:24     ` [Qemu-devel] [PATCH v2 " Andreas Färber
  2011-06-23 14:29     ` [Qemu-devel] [PATCH RFT " Andreas Färber
  1 sibling, 2 replies; 11+ messages in thread
From: malc @ 2011-06-23 12:54 UTC (permalink / raw)
  To: Andreas Färber; +Cc: cerbere, qemu-devel

On Thu, 23 Jun 2011, Andreas F?rber wrote:

> OSStatus type is defined as SInt32.
> Use %d format instead of %ld to avoid a warning on ppc64.

Which itself is defined as

typedef signed long        SInt32;

(here on ppc32 inside:
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/libkern/OSTypes.h)

So i'd suggest to just cast the thing to appropriate long type
and be done with it.

> 
> Cc: Alexandre Raymond <cerbere@gmail.com>
> Cc: malc <av1474@comtv.ru>
> Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
> ---
>  Alexandre, Could you please test this on v10.6? Thanks!
>  
>  audio/coreaudio.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/audio/coreaudio.c b/audio/coreaudio.c
> index 3bd75cd..d2b9248 100644
> --- a/audio/coreaudio.c
> +++ b/audio/coreaudio.c
> @@ -104,7 +104,7 @@ static void coreaudio_logstatus (OSStatus status)
>          break;
>  
>      default:
> -        AUD_log (AUDIO_CAP, "Reason: status code %ld\n", status);
> +        AUD_log (AUDIO_CAP, "Reason: status code %d\n", status);
>          return;
>      }
>  
> 

-- 
mailto:av1474@comtv.ru

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH v2 1/2] coreaudio: Fix OSStatus format specifier
  2011-06-23 12:54   ` [Qemu-devel] [PATCH RFT 1/2] coreaudio: Fix OSStatus format specifier malc
@ 2011-06-23 14:24     ` Andreas Färber
  2011-06-23 14:24       ` [Qemu-devel] [PATCH 2/2] coreaudio: Avoid formatting UInt32 type Andreas Färber
  2011-06-23 14:58       ` [Qemu-devel] [PATCH v2 1/2] coreaudio: Fix OSStatus format specifier malc
  2011-06-23 14:29     ` [Qemu-devel] [PATCH RFT " Andreas Färber
  1 sibling, 2 replies; 11+ messages in thread
From: Andreas Färber @ 2011-06-23 14:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: cerbere, Andreas Färber

OSStatus type is defined as SInt32. That's signed int on __LP64__ and
signed long otherwise.
Since it is an explicit 32-bit-width type, cast to corresponsing POSIX type
and use PRId32 format specifier. This avoids a warning on ppc64.

Cc: malc <av1474@comtv.ru>
Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
---
 audio/coreaudio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/audio/coreaudio.c b/audio/coreaudio.c
index 3bd75cd..508bcbe 100644
--- a/audio/coreaudio.c
+++ b/audio/coreaudio.c
@@ -104,7 +104,7 @@ static void coreaudio_logstatus (OSStatus status)
         break;
 
     default:
-        AUD_log (AUDIO_CAP, "Reason: status code %ld\n", status);
+        AUD_log (AUDIO_CAP, "Reason: status code %" PRId32 "\n", (int32_t)status);
         return;
     }
 
-- 
1.7.5.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 2/2] coreaudio: Avoid formatting UInt32 type
  2011-06-23 14:24     ` [Qemu-devel] [PATCH v2 " Andreas Färber
@ 2011-06-23 14:24       ` Andreas Färber
  2011-06-23 14:56         ` Andreas Färber
  2011-06-23 14:58       ` [Qemu-devel] [PATCH v2 1/2] coreaudio: Fix OSStatus format specifier malc
  1 sibling, 1 reply; 11+ messages in thread
From: Andreas Färber @ 2011-06-23 14:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: cerbere, Andreas Färber

coreaudioVoiceOut's audioDevicePropertyBufferFrameSize is defined as UInt32
and is being used by reference for AudioDevice{Get,Set}Property().
UInt32 is unsigned int on __LP64__ but unsigned long otherwise.

Cast to POSIX type and use PRIu32 format specifier to hide the details.
This avoids a warning on ppc64.

Cc: malc <av1474@comtv.ru>
Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
---
 audio/coreaudio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/audio/coreaudio.c b/audio/coreaudio.c
index 508bcbe..5964c62 100644
--- a/audio/coreaudio.c
+++ b/audio/coreaudio.c
@@ -360,8 +360,8 @@ static int coreaudio_init_out (HWVoiceOut *hw, struct audsettings *as)
         &core->audioDevicePropertyBufferFrameSize);
     if (status != kAudioHardwareNoError) {
         coreaudio_logerr2 (status, typ,
-                           "Could not set device buffer frame size %ld\n",
-                           core->audioDevicePropertyBufferFrameSize);
+                           "Could not set device buffer frame size %" PRIu32 "\n",
+                           (uint32_t)core->audioDevicePropertyBufferFrameSize);
         return -1;
     }
 
-- 
1.7.5.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH RFT 1/2] coreaudio: Fix OSStatus format specifier
  2011-06-23 12:54   ` [Qemu-devel] [PATCH RFT 1/2] coreaudio: Fix OSStatus format specifier malc
  2011-06-23 14:24     ` [Qemu-devel] [PATCH v2 " Andreas Färber
@ 2011-06-23 14:29     ` Andreas Färber
  1 sibling, 0 replies; 11+ messages in thread
From: Andreas Färber @ 2011-06-23 14:29 UTC (permalink / raw)
  To: malc; +Cc: cerbere, qemu-devel

Am 23.06.2011 um 14:54 schrieb malc:

> On Thu, 23 Jun 2011, Andreas F?rber wrote:
>
>> OSStatus type is defined as SInt32.
>> Use %d format instead of %ld to avoid a warning on ppc64.
>
> Which itself is defined as
>
> typedef signed long        SInt32;
>
> (here on ppc32 inside:
> /Developer/SDKs/MacOSX10.4u.sdk/usr/include/libkern/OSTypes.h)

Thanks for the pointer! Here it's:

#if __LP64__
typedef signed int  SInt32;
#else
typedef signed long SInt32;
#endif

> So i'd suggest to just cast the thing to appropriate long type
> and be done with it.

I posted a different solution to avoid unnecessary 64-bit width on  
ppc64/x86_64.

Andreas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] coreaudio: Avoid formatting UInt32 type
  2011-06-23 14:24       ` [Qemu-devel] [PATCH 2/2] coreaudio: Avoid formatting UInt32 type Andreas Färber
@ 2011-06-23 14:56         ` Andreas Färber
  0 siblings, 0 replies; 11+ messages in thread
From: Andreas Färber @ 2011-06-23 14:56 UTC (permalink / raw)
  To: qemu-devel Developers

$subject missing v2

Am 23.06.2011 um 16:24 schrieb Andreas Färber:

> coreaudioVoiceOut's audioDevicePropertyBufferFrameSize is defined as  
> UInt32
> and is being used by reference for AudioDevice{Get,Set}Property().
> UInt32 is unsigned int on __LP64__ but unsigned long otherwise.
>
> Cast to POSIX type and use PRIu32 format specifier to hide the  
> details.
> This avoids a warning on ppc64.
>
> Cc: malc <av1474@comtv.ru>
> Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
> ---
> audio/coreaudio.c |    4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/audio/coreaudio.c b/audio/coreaudio.c
> index 508bcbe..5964c62 100644
> --- a/audio/coreaudio.c
> +++ b/audio/coreaudio.c
> @@ -360,8 +360,8 @@ static int coreaudio_init_out (HWVoiceOut *hw,  
> struct audsettings *as)
>         &core->audioDevicePropertyBufferFrameSize);
>     if (status != kAudioHardwareNoError) {
>         coreaudio_logerr2 (status, typ,
> -                           "Could not set device buffer frame size  
> %ld\n",
> -                           core->audioDevicePropertyBufferFrameSize);
> +                           "Could not set device buffer frame size  
> %" PRIu32 "\n",
> +                           (uint32_t)core- 
> >audioDevicePropertyBufferFrameSize);
>         return -1;
>     }
>
> -- 
> 1.7.5.3
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v2 1/2] coreaudio: Fix OSStatus format specifier
  2011-06-23 14:24     ` [Qemu-devel] [PATCH v2 " Andreas Färber
  2011-06-23 14:24       ` [Qemu-devel] [PATCH 2/2] coreaudio: Avoid formatting UInt32 type Andreas Färber
@ 2011-06-23 14:58       ` malc
  2011-06-29  3:08         ` Alexandre Raymond
  1 sibling, 1 reply; 11+ messages in thread
From: malc @ 2011-06-23 14:58 UTC (permalink / raw)
  To: Andreas Färber; +Cc: cerbere, qemu-devel

On Thu, 23 Jun 2011, Andreas F?rber wrote:

> OSStatus type is defined as SInt32. That's signed int on __LP64__ and
> signed long otherwise.
> Since it is an explicit 32-bit-width type, cast to corresponsing POSIX type
> and use PRId32 format specifier. This avoids a warning on ppc64.
> 

[..snip..]

Applied thanks (ditto UInt32 patch).

-- 
mailto:av1474@comtv.ru

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v2 1/2] coreaudio: Fix OSStatus format specifier
  2011-06-23 14:58       ` [Qemu-devel] [PATCH v2 1/2] coreaudio: Fix OSStatus format specifier malc
@ 2011-06-29  3:08         ` Alexandre Raymond
  0 siblings, 0 replies; 11+ messages in thread
From: Alexandre Raymond @ 2011-06-29  3:08 UTC (permalink / raw)
  To: malc, Andreas Färber; +Cc: qemu-devel

Sorry for the delay.

Commit 744d3644181ddb16ef5944a0f9217e46961c8c84 works fine on OSX 10.6.

Alexandre

On Thu, Jun 23, 2011 at 10:58 AM, malc <av1474@comtv.ru> wrote:
> On Thu, 23 Jun 2011, Andreas F?rber wrote:
>
>> OSStatus type is defined as SInt32. That's signed int on __LP64__ and
>> signed long otherwise.
>> Since it is an explicit 32-bit-width type, cast to corresponsing POSIX type
>> and use PRId32 format specifier. This avoids a warning on ppc64.
>>
>
> [..snip..]
>
> Applied thanks (ditto UInt32 patch).
>
> --
> mailto:av1474@comtv.ru
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-06-29  3:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-23 11:43 [Qemu-devel] [PATCH 0/2] Darwin CoreAudio warning fixes Andreas Färber
2011-06-23 11:43 ` [Qemu-devel] [PATCH RFT 1/2] coreaudio: Fix OSStatus format specifier Andreas Färber
2011-06-23 11:43   ` [Qemu-devel] [PATCH 2/2] coreaudio: Fix format for UInt32 type Andreas Färber
2011-06-23 12:54   ` [Qemu-devel] [PATCH RFT 1/2] coreaudio: Fix OSStatus format specifier malc
2011-06-23 14:24     ` [Qemu-devel] [PATCH v2 " Andreas Färber
2011-06-23 14:24       ` [Qemu-devel] [PATCH 2/2] coreaudio: Avoid formatting UInt32 type Andreas Färber
2011-06-23 14:56         ` Andreas Färber
2011-06-23 14:58       ` [Qemu-devel] [PATCH v2 1/2] coreaudio: Fix OSStatus format specifier malc
2011-06-29  3:08         ` Alexandre Raymond
2011-06-23 14:29     ` [Qemu-devel] [PATCH RFT " Andreas Färber
2011-06-23 11:48 ` [Qemu-devel] [PATCH 0/2] Darwin CoreAudio warning fixes Andreas Färber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).