[pulseaudio-discuss] [PATCH RFCv3 35/51] sample: Make pa_channels_valid() inlineable

Peter Meerwald pmeerw at pmeerw.net
Tue Nov 4 15:26:30 PST 2014


Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
---
 src/pulse/sample.c | 4 ----
 src/pulse/sample.h | 4 +++-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/pulse/sample.c b/src/pulse/sample.c
index 0d81a32..52ded48 100644
--- a/src/pulse/sample.c
+++ b/src/pulse/sample.c
@@ -111,10 +111,6 @@ int pa_sample_rate_valid(uint32_t rate) {
     return rate > 0 && rate <= PA_RATE_MAX;
 }
 
-int pa_channels_valid(uint8_t channels) {
-    return channels > 0 && channels <= PA_CHANNELS_MAX;
-}
-
 int pa_sample_spec_valid(const pa_sample_spec *spec) {
     pa_assert(spec);
 
diff --git a/src/pulse/sample.h b/src/pulse/sample.h
index 86973d4..86f65b1 100644
--- a/src/pulse/sample.h
+++ b/src/pulse/sample.h
@@ -297,7 +297,9 @@ int pa_sample_rate_valid(uint32_t rate) PA_GCC_PURE;
 
 /** Return non-zero if the channel count is within the supported range.
  * \since 5.0 */
-int pa_channels_valid(uint8_t channels) PA_GCC_PURE;
+static inline int pa_channels_valid(uint8_t channels) {
+    return channels > 0 && channels <= PA_CHANNELS_MAX;
+}
 
 /** Return non-zero when the sample type specification is valid */
 int pa_sample_spec_valid(const pa_sample_spec *spec) PA_GCC_PURE;
-- 
1.9.1



More information about the pulseaudio-discuss mailing list