All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: "Gerd Hoffmann" <kraxel@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"BALATON Zoltan" <balaton@eik.bme.hu>,
	qemu-devel@nongnu.org
Cc: devel@daynix.com, Akihiko Odaki <akihiko.odaki@daynix.com>
Subject: Re: [PATCH v7 2/6] coreaudio: Remove extra whitespaces
Date: Fri, 24 Jan 2025 10:44:21 +0100	[thread overview]
Message-ID: <16872466.hJq5qvgIpt@silver> (raw)
In-Reply-To: <20250124-coreaudio-v7-2-9d9a4d91db37@daynix.com>

On Friday, January 24, 2025 6:12:05 AM CET Akihiko Odaki wrote:
> Remove extra whitespaces around parentheses.
> 
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
>  audio/coreaudio.m | 108 +++++++++++++++++++++++++++---------------------------
>  1 file changed, 54 insertions(+), 54 deletions(-)
> 
> diff --git a/audio/coreaudio.m b/audio/coreaudio.m
> index 0b67347ad7e8c43a77af308a1a3a654dd7084083..04e8ac59f4572c1e5fb7dc4f04f5e21520507ab5 100644
> --- a/audio/coreaudio.m
> +++ b/audio/coreaudio.m
> @@ -149,7 +149,7 @@ static OSStatus coreaudio_get_isrunning(AudioDeviceID id, UInt32 *result)
>                                        result);
>  }
>  
> -static void coreaudio_logstatus (OSStatus status)
> +static void coreaudio_logstatus(OSStatus status)
>  {
>      const char *str = "BUG";
>  
> @@ -199,14 +199,14 @@ static void coreaudio_logstatus (OSStatus status)
>          break;
>  
>      default:
> -        AUD_log (AUDIO_CAP, "Reason: status code %" PRId32 "\n", (int32_t)status);
> +        AUD_log(AUDIO_CAP, "Reason: status code %" PRId32 "\n", (int32_t)status);
>          return;
>      }
>  
> -    AUD_log (AUDIO_CAP, "Reason: %s\n", str);
> +    AUD_log(AUDIO_CAP, "Reason: %s\n", str);
>  }
>  
> -static void G_GNUC_PRINTF (2, 3) coreaudio_logerr (
> +static void G_GNUC_PRINTF(2, 3) coreaudio_logerr(
>      OSStatus status,
>      const char *fmt,
>      ...
> @@ -214,14 +214,14 @@ static void G_GNUC_PRINTF (2, 3) coreaudio_logerr (
>  {
>      va_list ap;
>  
> -    va_start (ap, fmt);
> -    AUD_log (AUDIO_CAP, fmt, ap);
> -    va_end (ap);
> +    va_start(ap, fmt);
> +    AUD_log(AUDIO_CAP, fmt, ap);
> +    va_end(ap);
>  
> -    coreaudio_logstatus (status);
> +    coreaudio_logstatus(status);
>  }
>  
> -static void G_GNUC_PRINTF (3, 4) coreaudio_logerr2 (
> +static void G_GNUC_PRINTF(3, 4) coreaudio_logerr2(
>      OSStatus status,
>      const char *typ,
>      const char *fmt,
> @@ -230,39 +230,39 @@ static void G_GNUC_PRINTF (3, 4) coreaudio_logerr2 (
>  {
>      va_list ap;
>  
> -    AUD_log (AUDIO_CAP, "Could not initialize %s\n", typ);
> +    AUD_log(AUDIO_CAP, "Could not initialize %s\n", typ);
>  
> -    va_start (ap, fmt);
> -    AUD_vlog (AUDIO_CAP, fmt, ap);
> -    va_end (ap);
> +    va_start(ap, fmt);
> +    AUD_vlog(AUDIO_CAP, fmt, ap);
> +    va_end(ap);
>  
> -    coreaudio_logstatus (status);
> +    coreaudio_logstatus(status);
>  }
>  
>  #define coreaudio_playback_logerr(status, ...) \
>      coreaudio_logerr2(status, "playback", __VA_ARGS__)
>  
> -static int coreaudio_buf_lock (coreaudioVoiceOut *core, const char *fn_name)
> +static int coreaudio_buf_lock(coreaudioVoiceOut *core, const char *fn_name)
>  {
>      int err;
>  
> -    err = pthread_mutex_lock (&core->buf_mutex);
> +    err = pthread_mutex_lock(&core->buf_mutex);
>      if (err) {
> -        dolog ("Could not lock voice for %s\nReason: %s\n",
> -               fn_name, strerror (err));
> +        dolog("Could not lock voice for %s\nReason: %s\n",
> +              fn_name, strerror(err));
>          return -1;
>      }
>      return 0;
>  }
>  
> -static int coreaudio_buf_unlock (coreaudioVoiceOut *core, const char *fn_name)
> +static int coreaudio_buf_unlock(coreaudioVoiceOut *core, const char *fn_name)
>  {
>      int err;
>  
> -    err = pthread_mutex_unlock (&core->buf_mutex);
> +    err = pthread_mutex_unlock(&core->buf_mutex);
>      if (err) {
> -        dolog ("Could not unlock voice for %s\nReason: %s\n",
> -               fn_name, strerror (err));
> +        dolog("Could not unlock voice for %s\nReason: %s\n",
> +               fn_name, strerror(err));

Nit: this last line should be unindented left by one character. Except of
that:

Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>

/Christian

>          return -1;
>      }
>      return 0;
> @@ -271,7 +271,7 @@ static int coreaudio_buf_unlock (coreaudioVoiceOut *core, const char *fn_name)
>  #define COREAUDIO_WRAPPER_FUNC(name, ret_type, args_decl, args) \
>      static ret_type glue(coreaudio_, name)args_decl             \
>      {                                                           \
> -        coreaudioVoiceOut *core = (coreaudioVoiceOut *) hw;     \
> +        coreaudioVoiceOut *core = (coreaudioVoiceOut *)hw;      \
>          ret_type ret;                                           \
>                                                                  \
>          if (coreaudio_buf_lock(core, "coreaudio_" #name)) {         \
> @@ -312,13 +312,13 @@ static OSStatus audioDeviceIOProc(
>      coreaudioVoiceOut *core = hwptr;
>      size_t len;
>  
> -    if (coreaudio_buf_lock (core, "audioDeviceIOProc")) {
> +    if (coreaudio_buf_lock(core, "audioDeviceIOProc")) {
>          inInputTime = 0;
>          return 0;
>      }
>  
>      if (inDevice != core->outputDeviceID) {
> -        coreaudio_buf_unlock (core, "audioDeviceIOProc(old device)");
> +        coreaudio_buf_unlock(core, "audioDeviceIOProc(old device)");
>          return 0;
>      }
>  
> @@ -328,7 +328,7 @@ static OSStatus audioDeviceIOProc(
>      /* if there are not enough samples, set signal and return */
>      if (pending_frames < frameCount) {
>          inInputTime = 0;
> -        coreaudio_buf_unlock (core, "audioDeviceIOProc(empty)");
> +        coreaudio_buf_unlock(core, "audioDeviceIOProc(empty)");
>          return 0;
>      }
>  
> @@ -348,7 +348,7 @@ static OSStatus audioDeviceIOProc(
>          out += write_len;
>      }
>  
> -    coreaudio_buf_unlock (core, "audioDeviceIOProc");
> +    coreaudio_buf_unlock(core, "audioDeviceIOProc");
>      return 0;
>  }
>  
> @@ -370,12 +370,12 @@ static OSStatus init_out_device(coreaudioVoiceOut *core)
>  
>      status = coreaudio_get_voice(&core->outputDeviceID);
>      if (status != kAudioHardwareNoError) {
> -        coreaudio_playback_logerr (status,
> -                                   "Could not get default output Device\n");
> +        coreaudio_playback_logerr(status,
> +                                  "Could not get default output Device\n");
>          return status;
>      }
>      if (core->outputDeviceID == kAudioDeviceUnknown) {
> -        dolog ("Could not initialize playback - Unknown Audiodevice\n");
> +        dolog("Could not initialize playback - Unknown Audiodevice\n");
>          return status;
>      }
>  
> @@ -386,17 +386,17 @@ static OSStatus init_out_device(coreaudioVoiceOut *core)
>          return 0;
>      }
>      if (status != kAudioHardwareNoError) {
> -        coreaudio_playback_logerr (status,
> -                                    "Could not get device buffer frame range\n");
> +        coreaudio_playback_logerr(status,
> +                                  "Could not get device buffer frame range\n");
>          return status;
>      }
>  
>      if (frameRange.mMinimum > core->frameSizeSetting) {
>          core->audioDevicePropertyBufferFrameSize = frameRange.mMinimum;
> -        dolog ("warning: Upsizing Buffer Frames to %f\n", frameRange.mMinimum);
> +        dolog("warning: Upsizing Buffer Frames to %f\n", frameRange.mMinimum);
>      } else if (frameRange.mMaximum < core->frameSizeSetting) {
>          core->audioDevicePropertyBufferFrameSize = frameRange.mMaximum;
> -        dolog ("warning: Downsizing Buffer Frames to %f\n", frameRange.mMaximum);
> +        dolog("warning: Downsizing Buffer Frames to %f\n", frameRange.mMaximum);
>      } else {
>          core->audioDevicePropertyBufferFrameSize = core->frameSizeSetting;
>      }
> @@ -408,9 +408,9 @@ static OSStatus init_out_device(coreaudioVoiceOut *core)
>          return 0;
>      }
>      if (status != kAudioHardwareNoError) {
> -        coreaudio_playback_logerr (status,
> -                                    "Could not set device buffer frame size %" PRIu32 "\n",
> -                                    (uint32_t)core->audioDevicePropertyBufferFrameSize);
> +        coreaudio_playback_logerr(status,
> +                                  "Could not set device buffer frame size %" PRIu32 "\n",
> +                                  (uint32_t)core->audioDevicePropertyBufferFrameSize);
>          return status;
>      }
>  
> @@ -421,8 +421,8 @@ static OSStatus init_out_device(coreaudioVoiceOut *core)
>          return 0;
>      }
>      if (status != kAudioHardwareNoError) {
> -        coreaudio_playback_logerr (status,
> -                                    "Could not get device buffer frame size\n");
> +        coreaudio_playback_logerr(status,
> +                                  "Could not get device buffer frame size\n");
>          return status;
>      }
>      core->hw.samples = core->bufferCount * core->audioDevicePropertyBufferFrameSize;
> @@ -434,9 +434,9 @@ static OSStatus init_out_device(coreaudioVoiceOut *core)
>          return 0;
>      }
>      if (status != kAudioHardwareNoError) {
> -        coreaudio_playback_logerr (status,
> -                                   "Could not set samplerate %lf\n",
> -                                   streamBasicDescription.mSampleRate);
> +        coreaudio_playback_logerr(status,
> +                                  "Could not set samplerate %lf\n",
> +                                  streamBasicDescription.mSampleRate);
>          core->outputDeviceID = kAudioDeviceUnknown;
>          return status;
>      }
> @@ -460,7 +460,7 @@ static OSStatus init_out_device(coreaudioVoiceOut *core)
>          return 0;
>      }
>      if (status != kAudioHardwareNoError || core->ioprocid == NULL) {
> -        coreaudio_playback_logerr (status, "Could not set IOProc\n");
> +        coreaudio_playback_logerr(status, "Could not set IOProc\n");
>          core->outputDeviceID = kAudioDeviceUnknown;
>          return status;
>      }
> @@ -518,7 +518,7 @@ static void update_device_playback_state(coreaudioVoiceOut *core)
>          if (!isrunning) {
>              status = AudioDeviceStart(core->outputDeviceID, core->ioprocid);
>              if (status != kAudioHardwareBadDeviceError && status != kAudioHardwareNoError) {
> -                coreaudio_logerr (status, "Could not resume playback\n");
> +                coreaudio_logerr(status, "Could not resume playback\n");
>              }
>          }
>      } else {
> @@ -560,7 +560,7 @@ static int coreaudio_init_out(HWVoiceOut *hw, struct audsettings *as,
>                                void *drv_opaque)
>  {
>      OSStatus status;
> -    coreaudioVoiceOut *core = (coreaudioVoiceOut *) hw;
> +    coreaudioVoiceOut *core = (coreaudioVoiceOut *)hw;
>      int err;
>      Audiodev *dev = drv_opaque;
>      AudiodevCoreaudioPerDirectionOptions *cpdo = dev->u.coreaudio.out;
> @@ -569,14 +569,14 @@ static int coreaudio_init_out(HWVoiceOut *hw, struct audsettings *as,
>      /* create mutex */
>      err = pthread_mutex_init(&core->buf_mutex, NULL);
>      if (err) {
> -        dolog("Could not create mutex\nReason: %s\n", strerror (err));
> +        dolog("Could not create mutex\nReason: %s\n", strerror(err));
>          return -1;
>      }
>  
>      obt_as = *as;
>      as = &obt_as;
>      as->fmt = AUDIO_FORMAT_F32;
> -    audio_pcm_init_info (&hw->info, as);
> +    audio_pcm_init_info(&hw->info, as);
>  
>      core->frameSizeSetting = audio_buffer_frames(
>          qapi_AudiodevCoreaudioPerDirectionOptions_base(cpdo), as, 11610);
> @@ -587,8 +587,8 @@ static int coreaudio_init_out(HWVoiceOut *hw, struct audsettings *as,
>                                              &voice_addr, handle_voice_change,
>                                              core);
>      if (status != kAudioHardwareNoError) {
> -        coreaudio_playback_logerr (status,
> -                                   "Could not listen to voice property change\n");
> +        coreaudio_playback_logerr(status,
> +                                  "Could not listen to voice property change\n");
>          return -1;
>      }
>  
> @@ -612,7 +612,7 @@ static void coreaudio_fini_out (HWVoiceOut *hw)
>  {
>      OSStatus status;
>      int err;
> -    coreaudioVoiceOut *core = (coreaudioVoiceOut *) hw;
> +    coreaudioVoiceOut *core = (coreaudioVoiceOut *)hw;
>  
>      status = AudioObjectRemovePropertyListener(kAudioObjectSystemObject,
>                                                 &voice_addr,
> @@ -627,13 +627,13 @@ static void coreaudio_fini_out (HWVoiceOut *hw)
>      /* destroy mutex */
>      err = pthread_mutex_destroy(&core->buf_mutex);
>      if (err) {
> -        dolog("Could not destroy mutex\nReason: %s\n", strerror (err));
> +        dolog("Could not destroy mutex\nReason: %s\n", strerror(err));
>      }
>  }
>  
>  static void coreaudio_enable_out(HWVoiceOut *hw, bool enable)
>  {
> -    coreaudioVoiceOut *core = (coreaudioVoiceOut *) hw;
> +    coreaudioVoiceOut *core = (coreaudioVoiceOut *)hw;
>  
>      core->enabled = enable;
>      update_device_playback_state(core);
> @@ -644,7 +644,7 @@ static void coreaudio_enable_out(HWVoiceOut *hw, bool enable)
>      return dev;
>  }
>  
> -static void coreaudio_audio_fini (void *opaque)
> +static void coreaudio_audio_fini(void *opaque)
>  {
>  }
>  
> @@ -670,7 +670,7 @@ static void coreaudio_audio_fini (void *opaque)
>      .pcm_ops        = &coreaudio_pcm_ops,
>      .max_voices_out = 1,
>      .max_voices_in  = 0,
> -    .voice_size_out = sizeof (coreaudioVoiceOut),
> +    .voice_size_out = sizeof(coreaudioVoiceOut),
>      .voice_size_in  = 0
>  };
>  
> 
> 




  reply	other threads:[~2025-01-24  9:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-24  5:12 [PATCH v7 0/6] coreaudio fixes Akihiko Odaki
2025-01-24  5:12 ` [PATCH v7 1/6] coreaudio: Remove unnecessary explicit casts Akihiko Odaki
2025-01-24  9:39   ` Christian Schoenebeck
2025-01-25  5:58     ` Akihiko Odaki
2025-01-25 10:41       ` Christian Schoenebeck
2025-01-26  4:00         ` Akihiko Odaki
2025-01-24  5:12 ` [PATCH v7 2/6] coreaudio: Remove extra whitespaces Akihiko Odaki
2025-01-24  9:44   ` Christian Schoenebeck [this message]
2025-01-24  5:12 ` [PATCH v7 3/6] coreaudio: Improve naming Akihiko Odaki
2025-01-24 10:01   ` Christian Schoenebeck
2025-01-25  6:05     ` Akihiko Odaki
2025-01-24  5:12 ` [PATCH v7 4/6] coreaudio: Commit the result of init in the end Akihiko Odaki
2025-01-24  5:12 ` [PATCH v7 5/6] audio: Add functions to initialize buffers Akihiko Odaki
2025-01-24  5:12 ` [PATCH v7 6/6] coreaudio: Initialize the buffer for device change Akihiko Odaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16872466.hJq5qvgIpt@silver \
    --to=qemu_oss@crudebyte.com \
    --cc=akihiko.odaki@daynix.com \
    --cc=balaton@eik.bme.hu \
    --cc=devel@daynix.com \
    --cc=kraxel@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.