Bug 279534
Summary: | Fix -Wcast-function-type-mismatch in CoreAudioSharedUnit.mm | ||
---|---|---|---|
Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> |
Component: | Media | Assignee: | David Kilzer (:ddkilzer) <ddkilzer> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
David Kilzer (:ddkilzer)
Fix -Wcast-function-type-mismatch in CoreAudioSharedUnit.mm.
The static speechActivityListenerCallback() function has a `void` return type, but `AudioObjectPropertyListenerProc` has an `int` return type.
Source/WebCore/platform/mediastream/mac/CoreAudioSharedUnit.mm:68:92: error: cast from 'void (*)(AudioObjectID, UInt32, const AudioObjectPropertyAddress *, void *)' (aka 'void (*)(unsigned int, unsigned int, const AudioObjectPropertyAddress *, void *)') to 'AudioObjectPropertyListenerProc' (aka 'int (*)(unsigned int, unsigned int, const AudioObjectPropertyAddress * _Nonnull, void * _Nullable)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch]
68 | error = AudioObjectRemovePropertyListener(deviceID, &kVoiceActivityDetectionState, (AudioObjectPropertyListenerProc)speechActivityListenerCallback, NULL);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Source/WebCore/platform/mediastream/mac/CoreAudioSharedUnit.mm:73:85: error: cast from 'void (*)(AudioObjectID, UInt32, const AudioObjectPropertyAddress *, void *)' (aka 'void (*)(unsigned int, unsigned int, const AudioObjectPropertyAddress *, void *)') to 'AudioObjectPropertyListenerProc' (aka 'int (*)(unsigned int, unsigned int, const AudioObjectPropertyAddress * _Nonnull, void * _Nullable)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch]
73 | error = AudioObjectAddPropertyListener(deviceID, &kVoiceActivityDetectionState, (AudioObjectPropertyListenerProc)speechActivityListenerCallback, NULL);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/135818490>
David Kilzer (:ddkilzer)
Pull request: https://github.com/WebKit/WebKit/pull/33483
David Kilzer (:ddkilzer)
Committed 283590@main (28185c7): https://commits.webkit.org/283590@main
Reviewed commits have been landed. Closing PR #33483 and removing active labels.
EWS
Committed 283286.80@safari-7620-branch (5bf73d15c55b): <https://commits.webkit.org/283286.80@safari-7620-branch>
Reviewed commits have been landed. Closing PR #1826 and removing active labels.