From 8b4721e51eb36b66a1a80e858639d4dfb537945a Mon Sep 17 00:00:00 2001 From: Paul Adenot Date: Fri, 10 Nov 2023 13:49:50 +0100 Subject: Non functional change: fix unified compilation issue -- make callbacks static --- test/test_devices.cpp | 6 ++++-- test/test_logging.cpp | 6 +++--- test/test_overload_callback.cpp | 6 ++++-- test/test_ring_buffer.cpp | 2 ++ 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/test/test_devices.cpp b/test/test_devices.cpp index 76e9615..a194663 100644 --- a/test/test_devices.cpp +++ b/test/test_devices.cpp @@ -18,13 +18,15 @@ //#define ENABLE_VERBOSE_LOG #include "common.h" -long data_cb_duplex(cubeb_stream * stream, void * user, const void * inputbuffer, void * outputbuffer, long nframes) +static long +data_cb_duplex(cubeb_stream * stream, void * user, const void * inputbuffer, void * outputbuffer, long nframes) { // noop, unused return 0; } -void state_cb_duplex(cubeb_stream * stream, void * /*user*/, cubeb_state state) +static void +state_cb_duplex(cubeb_stream * stream, void * /*user*/, cubeb_state state) { // noop, unused } diff --git a/test/test_logging.cpp b/test/test_logging.cpp index 5d9691d..fef8e20 100644 --- a/test/test_logging.cpp +++ b/test/test_logging.cpp @@ -26,7 +26,7 @@ std::atomic log_statements_received = {0}; std::atomic data_callback_call_count = {0}; -void +static void test_logging_callback(char const * fmt, ...) { log_statements_received++; @@ -40,7 +40,7 @@ test_logging_callback(char const * fmt, ...) #endif // PRINT_LOGS_TO_STDERR } -long +static long data_cb_load(cubeb_stream * stream, void * user, const void * inputbuffer, void * outputbuffer, long nframes) { @@ -48,7 +48,7 @@ data_cb_load(cubeb_stream * stream, void * user, const void * inputbuffer, return nframes; } -void +static void state_cb(cubeb_stream * stream, void * /*user*/, cubeb_state state) { if (stream == NULL) diff --git a/test/test_overload_callback.cpp b/test/test_overload_callback.cpp index c8f4daf..502489c 100644 --- a/test/test_overload_callback.cpp +++ b/test/test_overload_callback.cpp @@ -24,7 +24,8 @@ std::atomic load_callback{ false }; -long data_cb(cubeb_stream * stream, void * user, const void * inputbuffer, void * outputbuffer, long nframes) +static long +data_cb(cubeb_stream * stream, void * user, const void * inputbuffer, void * outputbuffer, long nframes) { if (load_callback) { fprintf(stderr, "Sleeping...\n"); @@ -34,7 +35,8 @@ long data_cb(cubeb_stream * stream, void * user, const void * inputbuffer, void return nframes; } -void state_cb(cubeb_stream * stream, void * /*user*/, cubeb_state state) +static void +state_cb(cubeb_stream * stream, void * /*user*/, cubeb_state state) { ASSERT_TRUE(!!stream); diff --git a/test/test_ring_buffer.cpp b/test/test_ring_buffer.cpp index cfaedd5..203b9f6 100644 --- a/test/test_ring_buffer.cpp +++ b/test/test_ring_buffer.cpp @@ -5,7 +5,9 @@ * accompanying file LICENSE for details. */ +#ifndef NOMINMAX #define NOMINMAX +#endif #include "gtest/gtest.h" #include "cubeb_ringbuffer.h" -- cgit v1.2.3