Title: [284988] trunk/Source/WebCore
Revision
284988
Author
mmaxfi...@apple.com
Date
2021-10-28 09:38:53 -0700 (Thu, 28 Oct 2021)

Log Message

[watchOS] Fix logging
https://bugs.webkit.org/show_bug.cgi?id=232423

Reviewed by Eric Carlson.

OSStatus is typedef'ed to an SInt32. On watchOS, SInt32 is typedef'ed to be a signed long.
A signed long on watchOS is 4 bytes long. On non-watchOS, SInt32 is typedef'ed to be a signed int.
So, if we want to use printf formatting strings, we have to cast the OSStatus to an int.

No new tests because there is no behavior change.

* platform/cocoa/MediaUtilities.cpp:
(WebCore::createAudioFormatDescription):
(WebCore::createAudioSampleBuffer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (284987 => 284988)


--- trunk/Source/WebCore/ChangeLog	2021-10-28 16:36:30 UTC (rev 284987)
+++ trunk/Source/WebCore/ChangeLog	2021-10-28 16:38:53 UTC (rev 284988)
@@ -1,3 +1,20 @@
+2021-10-28  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        [watchOS] Fix logging
+        https://bugs.webkit.org/show_bug.cgi?id=232423
+
+        Reviewed by Eric Carlson.
+
+        OSStatus is typedef'ed to an SInt32. On watchOS, SInt32 is typedef'ed to be a signed long.
+        A signed long on watchOS is 4 bytes long. On non-watchOS, SInt32 is typedef'ed to be a signed int.
+        So, if we want to use printf formatting strings, we have to cast the OSStatus to an int.
+
+        No new tests because there is no behavior change.
+
+        * platform/cocoa/MediaUtilities.cpp:
+        (WebCore::createAudioFormatDescription):
+        (WebCore::createAudioSampleBuffer):
+
 2021-10-28  Alan Bujtas  <za...@apple.com>
 
         REGRESSION(r281422): PLT5 regressed by 1% overall

Modified: trunk/Source/WebCore/platform/cocoa/MediaUtilities.cpp (284987 => 284988)


--- trunk/Source/WebCore/platform/cocoa/MediaUtilities.cpp	2021-10-28 16:36:30 UTC (rev 284987)
+++ trunk/Source/WebCore/platform/cocoa/MediaUtilities.cpp	2021-10-28 16:38:53 UTC (rev 284988)
@@ -39,7 +39,7 @@
     CMFormatDescriptionRef format = nullptr;
     auto error = PAL::CMAudioFormatDescriptionCreate(kCFAllocatorDefault, basicDescription, 0, nullptr, magicCookieSize, magicCookie, nullptr, &format);
     if (error) {
-        LOG_ERROR("createAudioFormatDescription failed with %d", error);
+        LOG_ERROR("createAudioFormatDescription failed with %d", static_cast<int>(error));
         return nullptr;
     }
     return adoptCF(format);
@@ -55,7 +55,7 @@
     CMSampleBufferRef sampleBuffer = nullptr;
     auto error = PAL::CMAudioSampleBufferCreateWithPacketDescriptions(kCFAllocatorDefault, nullptr, false, nullptr, nullptr, format.get(), sampleCount, time, nullptr, &sampleBuffer);
     if (error) {
-        LOG_ERROR("createAudioSampleBuffer with packet descriptions failed - %d", error);
+        LOG_ERROR("createAudioSampleBuffer with packet descriptions failed - %d", static_cast<int>(error));
         return nullptr;
     }
     auto buffer = adoptCF(sampleBuffer);
@@ -62,7 +62,7 @@
 
     error = PAL::CMSampleBufferSetDataBufferFromAudioBufferList(buffer.get(), kCFAllocatorDefault, kCFAllocatorDefault, 0, downcast<WebAudioBufferList>(data).list());
     if (error) {
-        LOG_ERROR("createAudioSampleBuffer from audio buffer list failed - %d", error);
+        LOG_ERROR("createAudioSampleBuffer from audio buffer list failed - %d", static_cast<int>(error));
         return nullptr;
     }
     return buffer;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to