Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys - this file is still used from assembly. protect inl...



details:   https://anonhg.NetBSD.org/src/rev/155d067b6b53
branches:  trunk
changeset: 778058:155d067b6b53
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Mar 15 00:09:08 2012 +0000

description:
- this file is still used from assembly. protect inlines against __ASSEMBLER__
- rename __zero -> __zeroll, __negative -> __negative_p

diffstat:

 sys/sys/cdefs.h |  19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diffs (41 lines):

diff -r b02f362938ee -r 155d067b6b53 sys/sys/cdefs.h
--- a/sys/sys/cdefs.h   Thu Mar 15 00:08:04 2012 +0000
+++ b/sys/sys/cdefs.h   Thu Mar 15 00:09:08 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cdefs.h,v 1.93 2012/03/13 21:07:28 christos Exp $      */
+/*     $NetBSD: cdefs.h,v 1.94 2012/03/15 00:09:08 christos Exp $      */
 
 /*
  * Copyright (c) 1991, 1993
@@ -533,8 +533,13 @@
 #define __type_mask(t) (/*LINTED*/sizeof(t) < sizeof(intmax_t) ? \
     (~((1ULL << (sizeof(t) * NBBY)) - 1)) : 0ULL)
 
-static inline long long __zero(void) { return 0; }
-static __inline int __negative(double x) { return x < 0; }
+#ifndef __ASSEMBLER__
+static inline long long __zeroll(void) { return 0; }
+static inline int __negative_p(double x) { return x < 0; }
+#else
+#define __zeroll() (0LL)
+#define __negative_p(x) ((x) < 0)
+#endif
 
 #define __type_min_s(t) ((t)((1ULL << (sizeof(t) * NBBY - 1))))
 #define __type_max_s(t) ((t)~((1ULL << (sizeof(t) * NBBY - 1))))
@@ -546,11 +551,11 @@
 
 
 #define __type_fit_u(t, a) (/*LINTED*/sizeof(t) < sizeof(intmax_t) ? \
-    (((a) & __type_mask(t)) == 0) : !__negative(a))
+    (((a) & __type_mask(t)) == 0) : !__negative_p(a))
 
-#define __type_fit_s(t, a) (/*LINTED*/__negative(a) ? \
-    ((intmax_t)((a) + __zero()) >= (intmax_t)__type_min_s(t)) : \
-    ((intmax_t)((a) + __zero()) <= (intmax_t)__type_max_s(t)))
+#define __type_fit_s(t, a) (/*LINTED*/__negative_p(a) ? \
+    ((intmax_t)((a) + __zeroll()) >= (intmax_t)__type_min_s(t)) : \
+    ((intmax_t)((a) + __zeroll()) <= (intmax_t)__type_max_s(t)))
 
 /*
  * return true if value 'a' fits in type 't'



Home | Main Index | Thread Index | Old Index