Module Name: src Committed By: christos Date: Thu Mar 15 00:09:08 UTC 2012
Modified Files: src/sys/sys: cdefs.h Log Message: - this file is still used from assembly. protect inlines against __ASSEMBLER__ - rename __zero -> __zeroll, __negative -> __negative_p To generate a diff of this commit: cvs rdiff -u -r1.93 -r1.94 src/sys/sys/cdefs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/sys/cdefs.h diff -u src/sys/sys/cdefs.h:1.93 src/sys/sys/cdefs.h:1.94 --- src/sys/sys/cdefs.h:1.93 Tue Mar 13 17:07:28 2012 +++ src/sys/sys/cdefs.h Wed Mar 14 20:09:08 2012 @@ -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 @@ static __inline int __negative(double x) #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'