Commit dc923df5 authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] signal.h -W cleanup

Next in line for the -W cleanups is this patch from Willy
which I've been carrying since 2.5.29 or so. Should be no
functional differences, just no more warnings when we compile
with -W
parent 457a03d0
...@@ -70,37 +70,24 @@ static inline int sigfindinword(unsigned long word) ...@@ -70,37 +70,24 @@ static inline int sigfindinword(unsigned long word)
#define _SIG_SET_BINOP(name, op) \ #define _SIG_SET_BINOP(name, op) \
static inline void name(sigset_t *r, const sigset_t *a, const sigset_t *b) \ static inline void name(sigset_t *r, const sigset_t *a, const sigset_t *b) \
{ \ { \
extern void _NSIG_WORDS_is_unsupported_size(void); \
unsigned long a0, a1, a2, a3, b0, b1, b2, b3; \ unsigned long a0, a1, a2, a3, b0, b1, b2, b3; \
unsigned long i; \
\ \
for (i = 0; i < _NSIG_WORDS/4; ++i) { \ switch (_NSIG_WORDS) { \
a0 = a->sig[4*i+0]; a1 = a->sig[4*i+1]; \ case 4: \
a2 = a->sig[4*i+2]; a3 = a->sig[4*i+3]; \ a3 = a->sig[3]; a2 = a->sig[2]; \
b0 = b->sig[4*i+0]; b1 = b->sig[4*i+1]; \ b3 = b->sig[3]; b2 = b->sig[2]; \
b2 = b->sig[4*i+2]; b3 = b->sig[4*i+3]; \ r->sig[3] = op(a3, b3); \
r->sig[4*i+0] = op(a0, b0); \ r->sig[2] = op(a2, b2); \
r->sig[4*i+1] = op(a1, b1); \
r->sig[4*i+2] = op(a2, b2); \
r->sig[4*i+3] = op(a3, b3); \
} \
switch (_NSIG_WORDS % 4) { \
case 3: \
a0 = a->sig[4*i+0]; a1 = a->sig[4*i+1]; a2 = a->sig[4*i+2]; \
b0 = b->sig[4*i+0]; b1 = b->sig[4*i+1]; b2 = b->sig[4*i+2]; \
r->sig[4*i+0] = op(a0, b0); \
r->sig[4*i+1] = op(a1, b1); \
r->sig[4*i+2] = op(a2, b2); \
break; \
case 2: \ case 2: \
a0 = a->sig[4*i+0]; a1 = a->sig[4*i+1]; \ a1 = a->sig[1]; b1 = b->sig[1]; \
b0 = b->sig[4*i+0]; b1 = b->sig[4*i+1]; \ r->sig[1] = op(a1, b1); \
r->sig[4*i+0] = op(a0, b0); \
r->sig[4*i+1] = op(a1, b1); \
break; \
case 1: \ case 1: \
a0 = a->sig[4*i+0]; b0 = b->sig[4*i+0]; \ a0 = a->sig[0]; b0 = b->sig[0]; \
r->sig[4*i+0] = op(a0, b0); \ r->sig[0] = op(a0, b0); \
break; \ break; \
default: \
_NSIG_WORDS_is_unsupported_size(); \
} \ } \
} }
...@@ -121,18 +108,16 @@ _SIG_SET_BINOP(signandsets, _sig_nand) ...@@ -121,18 +108,16 @@ _SIG_SET_BINOP(signandsets, _sig_nand)
#define _SIG_SET_OP(name, op) \ #define _SIG_SET_OP(name, op) \
static inline void name(sigset_t *set) \ static inline void name(sigset_t *set) \
{ \ { \
unsigned long i; \ extern void _NSIG_WORDS_is_unsupported_size(void); \
\ \
for (i = 0; i < _NSIG_WORDS/4; ++i) { \ switch (_NSIG_WORDS) { \
set->sig[4*i+0] = op(set->sig[4*i+0]); \ case 4: set->sig[3] = op(set->sig[3]); \
set->sig[4*i+1] = op(set->sig[4*i+1]); \ set->sig[2] = op(set->sig[2]); \
set->sig[4*i+2] = op(set->sig[4*i+2]); \ case 2: set->sig[1] = op(set->sig[1]); \
set->sig[4*i+3] = op(set->sig[4*i+3]); \ case 1: set->sig[0] = op(set->sig[0]); \
} \ break; \
switch (_NSIG_WORDS % 4) { \ default: \
case 3: set->sig[4*i+2] = op(set->sig[4*i+2]); \ _NSIG_WORDS_is_unsupported_size(); \
case 2: set->sig[4*i+1] = op(set->sig[4*i+1]); \
case 1: set->sig[4*i+0] = op(set->sig[4*i+0]); \
} \ } \
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment