aboutsummaryrefslogtreecommitdiffstats
path: root/src/filter.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-07-16 16:05:48 +0200
committerMattias Andrée <maandree@kth.se>2016-07-16 16:05:48 +0200
commitc5a454342f78eec4c58b1477d9190a084f40cfac (patch)
tree3f98b7e6412182942bc36d44402790541d91fcea /src/filter.h
parentThe stuff around supportinf SIGRTMIN+0 and SIGRTMIN+1 (diff)
downloadcoopgammad-c5a454342f78eec4c58b1477d9190a084f40cfac.tar.gz
coopgammad-c5a454342f78eec4c58b1477d9190a084f40cfac.tar.bz2
coopgammad-c5a454342f78eec4c58b1477d9190a084f40cfac.tar.xz
attributes
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--src/filter.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/filter.h b/src/filter.h
index 385ec56..5691f6c 100644
--- a/src/filter.h
+++ b/src/filter.h
@@ -20,6 +20,16 @@
+#ifndef GCC_ONLY
+# if defined(__GNUC__) && !defined(__clang__)
+# define GCC_ONLY(...) __VA_ARGS__
+# else
+# define GCC_ONLY(...) /* nothing */
+# endif
+#endif
+
+
+
/**
* The lifespan of a filter
*/
@@ -91,7 +101,8 @@ struct filter
*
* @param this The filter
*/
-void filter_destroy(struct filter* this);
+GCC_ONLY(__attribute__((nonnull)))
+void filter_destroy(struct filter* restrict this);
/**
* Marshal a filter
@@ -103,7 +114,8 @@ void filter_destroy(struct filter* this);
* @param ramps_size The byte-size of `filter->ramps`
* @return The number of marshalled byte
*/
-size_t filter_marshal(const struct filter* this, void* buf, size_t ramps_size);
+GCC_ONLY(__attribute__((nonnull(1))))
+size_t filter_marshal(const struct filter* restrict this, void* restrict buf, size_t ramps_size);
/**
* Unmarshal a filter
@@ -114,5 +126,6 @@ size_t filter_marshal(const struct filter* this, void* buf, size_t ramps_size);
* @param ramps_size The byte-size of `filter->ramps`
* @return The number of unmarshalled bytes, 0 on error
*/
-size_t filter_unmarshal(struct filter* this, const void* buf, size_t ramps_size);
+GCC_ONLY(__attribute__((nonnull)))
+size_t filter_unmarshal(struct filter* restrict this, const void* restrict buf, size_t ramps_size);