aboutsummaryrefslogtreecommitdiffstats
path: root/src/pipe.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-07-20 18:47:56 +0200
committerMax Kellermann <max@duempel.org>2011-07-20 19:05:26 +0200
commitd97c46bcdc60e91d3ac4700bfebc39092d65452e (patch)
treef913239aa44b4b7890972d005b7069725862f9fa /src/pipe.h
parent2b6542467c5b14be21e2319bac3b88f42696ddcb (diff)
downloadmpd-d97c46bcdc60e91d3ac4700bfebc39092d65452e.tar.gz
mpd-d97c46bcdc60e91d3ac4700bfebc39092d65452e.tar.xz
mpd-d97c46bcdc60e91d3ac4700bfebc39092d65452e.zip
pipe: make read-only functions "pure"
Enable gcc optimizations.
Diffstat (limited to '')
-rw-r--r--src/pipe.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pipe.h b/src/pipe.h
index f9540a30e..efa7a84f0 100644
--- a/src/pipe.h
+++ b/src/pipe.h
@@ -20,6 +20,7 @@
#ifndef MPD_PIPE_H
#define MPD_PIPE_H
+#include <glib.h>
#include <stdbool.h>
#ifndef NDEBUG
@@ -38,6 +39,7 @@ struct music_pipe;
/**
* Creates a new #music_pipe object. It is empty.
*/
+G_GNUC_MALLOC
struct music_pipe *
music_pipe_new(void);
@@ -70,6 +72,7 @@ music_pipe_contains(const struct music_pipe *mp,
* Returns the first #music_chunk from the pipe. Returns NULL if the
* pipe is empty.
*/
+G_GNUC_PURE
const struct music_chunk *
music_pipe_peek(const struct music_pipe *mp);
@@ -96,9 +99,11 @@ music_pipe_push(struct music_pipe *mp, struct music_chunk *chunk);
/**
* Returns the number of chunks currently in this pipe.
*/
+G_GNUC_PURE
unsigned
music_pipe_size(const struct music_pipe *mp);
+G_GNUC_PURE
static inline bool
music_pipe_empty(const struct music_pipe *mp)
{