Module: xenomai-forge
Branch: master
Commit: bb08078a078e546b33df774f710e92a1b5bb8f5c
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=bb08078a078e546b33df774f710e92a1b5bb8f5c

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Nov 17 23:00:11 2011 +0100

copperplate/reference: no direct test of non-zero constant for nullity

---

 include/copperplate/reference.h |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/include/copperplate/reference.h b/include/copperplate/reference.h
index 7c7855d..8fcd6b0 100644
--- a/include/copperplate/reference.h
+++ b/include/copperplate/reference.h
@@ -73,7 +73,11 @@ struct __fnref {
 #define dref_type(t)           memoff_t
 #define fnref_type(t)          int
 #define fnref_null             -1
-#define fnref_put(l, s)                ((s) == NULL ? fnref_null : __refvar(l, 
s))
+static inline int __fnref_nofn(void *fnaddr)
+{
+       return fnaddr == NULL;
+}
+#define fnref_put(l, s)                (__fnref_nofn((void *)(s)) ? fnref_null 
: __refvar(l, s))
 #define fnref_get(v, r)                ((v) = (r) < 0 ? NULL : __refchk(v, r))
 #define fnref_register(l, s)                                           \
        int __refvar(l, s);                                             \


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to