From 482de2f109d274142d818ac890370f47c8949ab6 Mon Sep 17 00:00:00 2001 From: mini Date: Sat, 21 Sep 2002 23:54:32 +0000 Subject: Style cleanup: - Sort local variable declarations. - Protect a hand-formatted comment from indent(1). - Use portable casts, even though this is machine-dependant code. - Remove extraneous blank lines. - Remove trailing newline. - Use sigdelset(3), not SIGDELSET(9). Requested by: bde --- lib/libc/i386/gen/signalcontext.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'lib/libc/i386') diff --git a/lib/libc/i386/gen/signalcontext.c b/lib/libc/i386/gen/signalcontext.c index c8474db5..9d51b73 100644 --- a/lib/libc/i386/gen/signalcontext.c +++ b/lib/libc/i386/gen/signalcontext.c @@ -30,11 +30,10 @@ __FBSDID("$FreeBSD"); #include -#include -#include #include #include #include +#include __weak_reference(__signalcontext, signalcontext); @@ -43,10 +42,10 @@ extern void _ctx_start(ucontext_t *, int argc, ...); int __signalcontext(ucontext_t *ucp, int sig, __sighandler_t *func) { + register_t *p; struct sigframe *sfp; - int *p; - /* + /*- * Set up stack. * (n = sizeof(int)) * 2n+sizeof(struct sigframe) ucp @@ -54,29 +53,27 @@ __signalcontext(ucontext_t *ucp, int sig, __sighandler_t *func) * 1n &func * 0n &_ctx_start */ - p = (int *)ucp->uc_mcontext.mc_esp; - *--p = (int)ucp; + p = (register_t *)(void *)(intptr_t)ucp->uc_mcontext.mc_esp; + *--p = (register_t)(intptr_t)ucp; p -= sizeof(struct sigframe); sfp = (struct sigframe *)p; bzero(sfp, sizeof(struct sigframe)); sfp->sf_signum = sig; - sfp->sf_siginfo = (int)&sfp->sf_si; - sfp->sf_ucontext = (int)&sfp->sf_uc; + sfp->sf_siginfo = (register_t)(intptr_t)&sfp->sf_si; + sfp->sf_ucontext = (register_t)(intptr_t)&sfp->sf_uc; sfp->sf_ahu.sf_action = (__siginfohandler_t *)func; bcopy(ucp, &sfp->sf_uc, sizeof(ucontext_t)); sfp->sf_si.si_signo = sig; - - *--p = (int)func; + *--p = (register_t)(intptr_t)func; /* * Set up ucontext_t. */ ucp->uc_mcontext.mc_ebp = ucp->uc_mcontext.mc_esp - sizeof(int); - ucp->uc_mcontext.mc_esp = (int)p; - ucp->uc_mcontext.mc_eip = (int)_ctx_start; + ucp->uc_mcontext.mc_esp = (register_t)(intptr_t)p; + ucp->uc_mcontext.mc_eip = (register_t)(intptr_t)_ctx_start; ucp->uc_mcontext.mc_eflags &= ~PSL_T; ucp->uc_link = &sfp->sf_uc; - SIGDELSET(ucp->uc_sigmask, sig); + sigdelset(&ucp->uc_sigmask, sig); return (0); } - -- cgit v1.1