aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_utils.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-30 22:53:12 +0100
committerMax Kellermann <max@duempel.org>2013-01-30 22:53:12 +0100
commit5ed9f02c4de0a8ddb7649e0541a8d6f32f61b3f8 (patch)
tree32094f443903b1c128f2336278f120f896091001 /src/pcm_utils.h
parent378ebad1c8d7079b41319600f13c1c884d6c693a (diff)
downloadmpd-5ed9f02c4de0a8ddb7649e0541a8d6f32f61b3f8.tar.gz
mpd-5ed9f02c4de0a8ddb7649e0541a8d6f32f61b3f8.tar.xz
mpd-5ed9f02c4de0a8ddb7649e0541a8d6f32f61b3f8.zip
TagPool, ...: include cleanup
Diffstat (limited to 'src/pcm_utils.h')
-rw-r--r--src/pcm_utils.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/pcm_utils.h b/src/pcm_utils.h
index 4ad896570..21df95e48 100644
--- a/src/pcm_utils.h
+++ b/src/pcm_utils.h
@@ -20,7 +20,7 @@
#ifndef MPD_PCM_UTILS_H
#define MPD_PCM_UTILS_H
-#include <glib.h>
+#include "gcc.h"
#include <stdint.h>
@@ -42,9 +42,9 @@ pcm_end_pointer(const void *p, size_t size)
static inline int32_t
pcm_range(int32_t sample, unsigned bits)
{
- if (G_UNLIKELY(sample < (-1 << (bits - 1))))
+ if (gcc_unlikely(sample < (-1 << (bits - 1))))
return -1 << (bits - 1);
- if (G_UNLIKELY(sample >= (1 << (bits - 1))))
+ if (gcc_unlikely(sample >= (1 << (bits - 1))))
return (1 << (bits - 1)) - 1;
return sample;
}
@@ -56,37 +56,37 @@ pcm_range(int32_t sample, unsigned bits)
static inline int64_t
pcm_range_64(int64_t sample, unsigned bits)
{
- if (G_UNLIKELY(sample < ((int64_t)-1 << (bits - 1))))
+ if (gcc_unlikely(sample < ((int64_t)-1 << (bits - 1))))
return (int64_t)-1 << (bits - 1);
- if (G_UNLIKELY(sample >= ((int64_t)1 << (bits - 1))))
+ if (gcc_unlikely(sample >= ((int64_t)1 << (bits - 1))))
return ((int64_t)1 << (bits - 1)) - 1;
return sample;
}
-G_GNUC_CONST
+gcc_const
static inline int16_t
pcm_clamp_16(int x)
{
- static const int32_t MIN_VALUE = G_MININT16;
- static const int32_t MAX_VALUE = G_MAXINT16;
+ static const int32_t MIN_VALUE = -(1 << 15);
+ static const int32_t MAX_VALUE = (1 << 15) - 1;
- if (G_UNLIKELY(x < MIN_VALUE))
+ if (gcc_unlikely(x < MIN_VALUE))
return MIN_VALUE;
- if (G_UNLIKELY(x > MAX_VALUE))
+ if (gcc_unlikely(x > MAX_VALUE))
return MAX_VALUE;
return x;
}
-G_GNUC_CONST
+gcc_const
static inline int32_t
pcm_clamp_24(int x)
{
static const int32_t MIN_VALUE = -(1 << 23);
static const int32_t MAX_VALUE = (1 << 23) - 1;
- if (G_UNLIKELY(x < MIN_VALUE))
+ if (gcc_unlikely(x < MIN_VALUE))
return MIN_VALUE;
- if (G_UNLIKELY(x > MAX_VALUE))
+ if (gcc_unlikely(x > MAX_VALUE))
return MAX_VALUE;
return x;
}