Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a16fc964 authored by Colin Cross's avatar Colin Cross
Browse files

Mark functions in headers with static inline

Functions in headers that are not static inline will cause duplicate
symbol errors when linking if the header is ever included twice
into different compilation units of the same module.  It also causes
-Wunused-function warnings if they are not used in the cpp file, which
were hidden by the use of -isystem frameworks/av/include.

Bug: 31751828
Test: m -j checkbuild
Change-Id: I36f258bb4f5c3df54e874280beab344e63c519d5
Merged-In: I36f258bb4f5c3df54e874280beab344e63c519d5
(cherry picked from commit 413adafb)
parent 0bdcf66b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -18,7 +18,8 @@

#include <system/audio.h>

static audio_stream_type_t audio_attributes_to_stream_type(const audio_attributes_t *attr)
static inline
audio_stream_type_t audio_attributes_to_stream_type(const audio_attributes_t *attr)
{
    // flags to stream type mapping
    if ((attr->flags & AUDIO_FLAG_AUDIBILITY_ENFORCED) == AUDIO_FLAG_AUDIBILITY_ENFORCED) {
@@ -61,7 +62,8 @@ static audio_stream_type_t audio_attributes_to_stream_type(const audio_attribute
    }
}

static void stream_type_to_audio_attributes(audio_stream_type_t streamType,
static inline
void stream_type_to_audio_attributes(audio_stream_type_t streamType,
                                     audio_attributes_t *attr) {
    memset(attr, 0, sizeof(audio_attributes_t));