Skip to content

Commit 63789c2

Browse files
afq984Chromeos LUCI
authored andcommitted
Explicitly define on_output_devices_changed with void
For some reason this makes -fsanitize=function happy and gets rid of: cras/src/tests/stream_apm_unittest.cc:438:3: runtime error: call to function (unknown) through pointer to incorrect function type 'void (*)()' (/var/cache/portage/media-sound/adhd/06f28d5772d1404a84774cbe385179a7/execroot/adhd/bazel-out/amd64-dbg/bin/cras/src/tests/stream_apm_unittest+0xef248): note: (unknown) defined here SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior cras/src/tests/stream_apm_unittest.cc:438:3 Error: cras/src/tests/stream_apm_unittest: failed with exit code 1 BUG=b:445167544 TEST=FEATURES='-usersandbox test' emerge-amd64-generic adhd Change-Id: I6d4746210063f26c940f39e05bb3570781bb1f3f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/6968558 Tested-by: chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com <chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com> Reviewed-by: Hsinyu Chao <hychao@chromium.org> Commit-Queue: Li-Yu Yu <aaronyu@google.com>
1 parent a00a8ce commit 63789c2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cras/src/server/cras_apm_reverse.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ typedef int (*process_reverse_needed_t)(bool default_reverse,
4444
/* Function to be triggered when the output devices has changed and
4545
* cause APM reverse modules state changes. Called in main thread.
4646
*/
47-
typedef void (*output_devices_changed_t)();
47+
typedef void (*output_devices_changed_t)(void);
4848

4949
/* Initializes APM reverse module with utility functions passed in. Called
5050
* in main thread.

cras/src/server/cras_stream_apm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ static int send_apm_message(enum APM_THREAD_CMD cmd) {
11071107

11081108
/* Triggered in main thread when devices state has changed in APM
11091109
* reverse modules. */
1110-
static void on_output_devices_changed() {
1110+
static void on_output_devices_changed(void) {
11111111
int rc;
11121112
/* Send a message to audio thread because we need to access
11131113
* |active_apms|. */

0 commit comments

Comments
 (0)