From nobody Wed Feb 5 18:01:24 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1737695644; cv=none; d=zohomail.com; s=zohoarc; b=jk1gUgopviy1V0ENetcs7vM9D+spnBUuPzJmZJPp2ugVQXsphSAbeOzc2CqS6ODT15//XmBTv1zgQfirqiRINOmEmCAm2bNSxpyFvgsuSrgj5Jf871gwq/+ldm3rW4bO3eBuekVGruQQwaZjnS9UbUJU7Y3ncd360V2snIX7Erc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737695644; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=s7r/m+Ynal1Hau8iDW2vBlCw59o8z1y0oQ4nfOltvLo=; b=jZREU8Qad7epZyIOKBj6KtRu784luF0wxnuDUPyEkdoS+dmfhy270pe4ccLMcYG0zYDgOvIiYuVd4vQV2JKctvrDe/c/ky+ZW72LI5uPZU5CguMvrDlgWaUFNt+8ivvTc75J4tEdaH4IFDU9tiQoLsYSrjgz40xz9FjhB0yGgOI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1737695644053165.28450061856552; Thu, 23 Jan 2025 21:14:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbBzZ-0003Lc-45; Fri, 24 Jan 2025 00:12:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbBzU-0003Kn-CW for qemu-devel@nongnu.org; Fri, 24 Jan 2025 00:12:24 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbBzS-0000Ge-9o for qemu-devel@nongnu.org; Fri, 24 Jan 2025 00:12:24 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-216426b0865so27595795ad.0 for ; Thu, 23 Jan 2025 21:12:21 -0800 (PST) Received: from localhost ([157.82.207.107]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-21da555a428sm5428055ad.84.2025.01.23.21.12.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Jan 2025 21:12:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1737695541; x=1738300341; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=s7r/m+Ynal1Hau8iDW2vBlCw59o8z1y0oQ4nfOltvLo=; b=Qjjy0zFi9EtoK2sTQXqU5OqCvYh5Zo1RtpBg6+Cyl8rUgkkzdhbnSEiNDw+gmOUn8Z Gbgyh8NJU/k93At5qZ9Wygglk2Tx/+N/7VDb+Cg3PxEYcAoWmwbGjyIF6PPPtT3KIuE0 agNZ4OOT5eGeb9GrJ1CddUrz+lXrLxjRjYAE7n8u2f4nDVU2Q3r75/h073sTuiFN/0V2 u5HxqzLiuWMUlmHruYFEiJtqFzat5x26ix/H4kKq75Dv9QeDre885M8nQ+nTrLZm4AEc p38kEbu5zcMvF3T0nXXwFH3ZcgYaiWJK2HgqEglLeXma1oLQakRQSrUDHDSrDxy+38Fd KETA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737695541; x=1738300341; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s7r/m+Ynal1Hau8iDW2vBlCw59o8z1y0oQ4nfOltvLo=; b=jCJJBgS+HN8vrpXTNTZkMEdLy4y7/HRelDOsbJ23IVXH73YVsD/tAvhF9j7q24cApv TjynGY1DHEPKrnTndIFRshhykMDR8yB7Nbg0VsT340uAC9K4LNfpA8Rghu09pyhPyQYU OQgkvpfKMOwOg6ALh6CC3d/OSWUM+K3J8AZALObOHcPuJ9f/T2noPEE8puBRPUDd18eH kVCf0R7MKtuUwBBQkByEzs1ji0xiWokGTVpYQQz6iWeQgtbgV9KAs23b1ioBLQVvRDM3 92lvOdpo7gMpShQOvQv/IgEHHDEKOoCL2OOAXb4qLcPFUCCqq3dJbvhd11DIbPdtNqqm B2cA== X-Gm-Message-State: AOJu0Yx8velGWdVIMxC4A7DQMgqwj/4DggOyMeoeEqLNFoiPMbjEPBkq HCEM/QkqfQugr1htZvq3oS7woW3Fs9VpGec/1BN2xrTh9yaIt8Mt3Db2UGJzBa35oy7d5vaIdCd pVrM= X-Gm-Gg: ASbGncsLjWXwtsz6MPzZa75YZ3X2fAxQu0RXJDkgqLzZ3f3c+Yd/t7qMaRq6jrcDGsf a/SWW1R7RbXsLRScFDEahr++qNtLwbcgSEC2uEFT60mCP4Q5ZiJLnpJV8qdS0jzMETAld7czQ3H Ylu0X+elQm+pIzGdaY3Tuwv3cX7VQWm3PWBbhlXTIPIeEL1EFsO/xTe1xw41k34ejr09aX2RkgR /3RVLgkWbF7Lazs0dbdZUAAWSWeF7sND4pHS03iMD/5UYTFah9JZHefRFUB2FAzY15Uzx6WU1KR J3jPAWpyvHTOwkoKozU= X-Google-Smtp-Source: AGHT+IFmD6tR92H7g1qTfwFHwuCyokARPnkLLWIX8jC8F17hnI4A31uXhHcWglYXwrM7HyHgVu++xg== X-Received: by 2002:a17:903:2286:b0:21b:b3c9:3908 with SMTP id d9443c01a7336-21c35577cb7mr468067785ad.34.1737695540639; Thu, 23 Jan 2025 21:12:20 -0800 (PST) From: Akihiko Odaki Date: Fri, 24 Jan 2025 14:12:05 +0900 Subject: [PATCH v7 2/6] coreaudio: Remove extra whitespaces MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250124-coreaudio-v7-2-9d9a4d91db37@daynix.com> References: <20250124-coreaudio-v7-0-9d9a4d91db37@daynix.com> In-Reply-To: <20250124-coreaudio-v7-0-9d9a4d91db37@daynix.com> To: Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Christian Schoenebeck , BALATON Zoltan Cc: qemu-devel@nongnu.org, devel@daynix.com, Akihiko Odaki X-Mailer: b4 0.14.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x634.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1737695646726019100 Remove extra whitespaces around parentheses. Signed-off-by: Akihiko Odaki Reviewed-by: Christian Schoenebeck --- audio/coreaudio.m | 108 +++++++++++++++++++++++++++-----------------------= ---- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/audio/coreaudio.m b/audio/coreaudio.m index 0b67347ad7e8c43a77af308a1a3a654dd7084083..04e8ac59f4572c1e5fb7dc4f04f= 5e21520507ab5 100644 --- a/audio/coreaudio.m +++ b/audio/coreaudio.m @@ -149,7 +149,7 @@ static OSStatus coreaudio_get_isrunning(AudioDeviceID i= d, UInt32 *result) result); } =20 -static void coreaudio_logstatus (OSStatus status) +static void coreaudio_logstatus(OSStatus status) { const char *str =3D "BUG"; =20 @@ -199,14 +199,14 @@ static void coreaudio_logstatus (OSStatus status) break; =20 default: - AUD_log (AUDIO_CAP, "Reason: status code %" PRId32 "\n", (int32_t)= status); + AUD_log(AUDIO_CAP, "Reason: status code %" PRId32 "\n", (int32_t)s= tatus); return; } =20 - AUD_log (AUDIO_CAP, "Reason: %s\n", str); + AUD_log(AUDIO_CAP, "Reason: %s\n", str); } =20 -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; =20 - 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); =20 - coreaudio_logstatus (status); + coreaudio_logstatus(status); } =20 -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; =20 - AUD_log (AUDIO_CAP, "Could not initialize %s\n", typ); + AUD_log(AUDIO_CAP, "Could not initialize %s\n", typ); =20 - 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); =20 - coreaudio_logstatus (status); + coreaudio_logstatus(status); } =20 #define coreaudio_playback_logerr(status, ...) \ coreaudio_logerr2(status, "playback", __VA_ARGS__) =20 -static int coreaudio_buf_lock (coreaudioVoiceOut *core, const char *fn_nam= e) +static int coreaudio_buf_lock(coreaudioVoiceOut *core, const char *fn_name) { int err; =20 - err =3D pthread_mutex_lock (&core->buf_mutex); + err =3D 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; } =20 -static int coreaudio_buf_unlock (coreaudioVoiceOut *core, const char *fn_n= ame) +static int coreaudio_buf_unlock(coreaudioVoiceOut *core, const char *fn_na= me) { int err; =20 - err =3D pthread_mutex_unlock (&core->buf_mutex); + err =3D 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)); return -1; } return 0; @@ -271,7 +271,7 @@ static int coreaudio_buf_unlock (coreaudioVoiceOut *cor= e, const char *fn_name) #define COREAUDIO_WRAPPER_FUNC(name, ret_type, args_decl, args) \ static ret_type glue(coreaudio_, name)args_decl \ { \ - coreaudioVoiceOut *core =3D (coreaudioVoiceOut *) hw; \ + coreaudioVoiceOut *core =3D (coreaudioVoiceOut *)hw; \ ret_type ret; \ \ if (coreaudio_buf_lock(core, "coreaudio_" #name)) { \ @@ -312,13 +312,13 @@ static OSStatus audioDeviceIOProc( coreaudioVoiceOut *core =3D hwptr; size_t len; =20 - if (coreaudio_buf_lock (core, "audioDeviceIOProc")) { + if (coreaudio_buf_lock(core, "audioDeviceIOProc")) { inInputTime =3D 0; return 0; } =20 if (inDevice !=3D core->outputDeviceID) { - coreaudio_buf_unlock (core, "audioDeviceIOProc(old device)"); + coreaudio_buf_unlock(core, "audioDeviceIOProc(old device)"); return 0; } =20 @@ -328,7 +328,7 @@ static OSStatus audioDeviceIOProc( /* if there are not enough samples, set signal and return */ if (pending_frames < frameCount) { inInputTime =3D 0; - coreaudio_buf_unlock (core, "audioDeviceIOProc(empty)"); + coreaudio_buf_unlock(core, "audioDeviceIOProc(empty)"); return 0; } =20 @@ -348,7 +348,7 @@ static OSStatus audioDeviceIOProc( out +=3D write_len; } =20 - coreaudio_buf_unlock (core, "audioDeviceIOProc"); + coreaudio_buf_unlock(core, "audioDeviceIOProc"); return 0; } =20 @@ -370,12 +370,12 @@ static OSStatus init_out_device(coreaudioVoiceOut *co= re) =20 status =3D coreaudio_get_voice(&core->outputDeviceID); if (status !=3D 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 =3D=3D kAudioDeviceUnknown) { - dolog ("Could not initialize playback - Unknown Audiodevice\n"); + dolog("Could not initialize playback - Unknown Audiodevice\n"); return status; } =20 @@ -386,17 +386,17 @@ static OSStatus init_out_device(coreaudioVoiceOut *co= re) return 0; } if (status !=3D kAudioHardwareNoError) { - coreaudio_playback_logerr (status, - "Could not get device buffer frame ran= ge\n"); + coreaudio_playback_logerr(status, + "Could not get device buffer frame range= \n"); return status; } =20 if (frameRange.mMinimum > core->frameSizeSetting) { core->audioDevicePropertyBufferFrameSize =3D frameRange.mMinimum; - dolog ("warning: Upsizing Buffer Frames to %f\n", frameRange.mMini= mum); + dolog("warning: Upsizing Buffer Frames to %f\n", frameRange.mMinim= um); } else if (frameRange.mMaximum < core->frameSizeSetting) { core->audioDevicePropertyBufferFrameSize =3D frameRange.mMaximum; - dolog ("warning: Downsizing Buffer Frames to %f\n", frameRange.mMa= ximum); + dolog("warning: Downsizing Buffer Frames to %f\n", frameRange.mMax= imum); } else { core->audioDevicePropertyBufferFrameSize =3D core->frameSizeSettin= g; } @@ -408,9 +408,9 @@ static OSStatus init_out_device(coreaudioVoiceOut *core) return 0; } if (status !=3D kAudioHardwareNoError) { - coreaudio_playback_logerr (status, - "Could not set device buffer frame siz= e %" PRIu32 "\n", - (uint32_t)core->audioDevicePropertyBuf= ferFrameSize); + coreaudio_playback_logerr(status, + "Could not set device buffer frame size = %" PRIu32 "\n", + (uint32_t)core->audioDevicePropertyBuffe= rFrameSize); return status; } =20 @@ -421,8 +421,8 @@ static OSStatus init_out_device(coreaudioVoiceOut *core) return 0; } if (status !=3D kAudioHardwareNoError) { - coreaudio_playback_logerr (status, - "Could not get device buffer frame siz= e\n"); + coreaudio_playback_logerr(status, + "Could not get device buffer frame size\= n"); return status; } core->hw.samples =3D core->bufferCount * core->audioDevicePropertyBuff= erFrameSize; @@ -434,9 +434,9 @@ static OSStatus init_out_device(coreaudioVoiceOut *core) return 0; } if (status !=3D 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 =3D kAudioDeviceUnknown; return status; } @@ -460,7 +460,7 @@ static OSStatus init_out_device(coreaudioVoiceOut *core) return 0; } if (status !=3D kAudioHardwareNoError || core->ioprocid =3D=3D NULL) { - coreaudio_playback_logerr (status, "Could not set IOProc\n"); + coreaudio_playback_logerr(status, "Could not set IOProc\n"); core->outputDeviceID =3D kAudioDeviceUnknown; return status; } @@ -518,7 +518,7 @@ static void update_device_playback_state(coreaudioVoice= Out *core) if (!isrunning) { status =3D AudioDeviceStart(core->outputDeviceID, core->ioproc= id); if (status !=3D kAudioHardwareBadDeviceError && status !=3D kA= udioHardwareNoError) { - 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 au= dsettings *as, void *drv_opaque) { OSStatus status; - coreaudioVoiceOut *core =3D (coreaudioVoiceOut *) hw; + coreaudioVoiceOut *core =3D (coreaudioVoiceOut *)hw; int err; Audiodev *dev =3D drv_opaque; AudiodevCoreaudioPerDirectionOptions *cpdo =3D dev->u.coreaudio.out; @@ -569,14 +569,14 @@ static int coreaudio_init_out(HWVoiceOut *hw, struct = audsettings *as, /* create mutex */ err =3D 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; } =20 obt_as =3D *as; as =3D &obt_as; as->fmt =3D AUDIO_FORMAT_F32; - audio_pcm_init_info (&hw->info, as); + audio_pcm_init_info(&hw->info, as); =20 core->frameSizeSetting =3D audio_buffer_frames( qapi_AudiodevCoreaudioPerDirectionOptions_base(cpdo), as, 11610); @@ -587,8 +587,8 @@ static int coreaudio_init_out(HWVoiceOut *hw, struct au= dsettings *as, &voice_addr, handle_voice_chan= ge, core); if (status !=3D kAudioHardwareNoError) { - coreaudio_playback_logerr (status, - "Could not listen to voice property cha= nge\n"); + coreaudio_playback_logerr(status, + "Could not listen to voice property chan= ge\n"); return -1; } =20 @@ -612,7 +612,7 @@ static void coreaudio_fini_out (HWVoiceOut *hw) { OSStatus status; int err; - coreaudioVoiceOut *core =3D (coreaudioVoiceOut *) hw; + coreaudioVoiceOut *core =3D (coreaudioVoiceOut *)hw; =20 status =3D AudioObjectRemovePropertyListener(kAudioObjectSystemObject, &voice_addr, @@ -627,13 +627,13 @@ static void coreaudio_fini_out (HWVoiceOut *hw) /* destroy mutex */ err =3D 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)); } } =20 static void coreaudio_enable_out(HWVoiceOut *hw, bool enable) { - coreaudioVoiceOut *core =3D (coreaudioVoiceOut *) hw; + coreaudioVoiceOut *core =3D (coreaudioVoiceOut *)hw; =20 core->enabled =3D enable; update_device_playback_state(core); @@ -644,7 +644,7 @@ static void coreaudio_enable_out(HWVoiceOut *hw, bool e= nable) return dev; } =20 -static void coreaudio_audio_fini (void *opaque) +static void coreaudio_audio_fini(void *opaque) { } =20 @@ -670,7 +670,7 @@ static void coreaudio_audio_fini (void *opaque) .pcm_ops =3D &coreaudio_pcm_ops, .max_voices_out =3D 1, .max_voices_in =3D 0, - .voice_size_out =3D sizeof (coreaudioVoiceOut), + .voice_size_out =3D sizeof(coreaudioVoiceOut), .voice_size_in =3D 0 }; =20 --=20 2.48.1