From c2ff854c81a19bd5dbe2535a0535039d7e075333 Mon Sep 17 00:00:00 2001 From: christos Date: Wed, 21 Mar 2012 00:38:34 +0000 Subject: [PATCH] c89 prototypes, unsigned int --- lib/libc/arch/sparc/gen/flt_rounds.c | 8 ++++---- lib/libc/arch/sparc/gen/fpgetmask.c | 8 ++++---- lib/libc/arch/sparc/gen/fpgetround.c | 8 ++++---- lib/libc/arch/sparc/gen/fpgetsticky.c | 8 ++++---- lib/libc/arch/sparc/gen/fpsetmask.c | 7 +++---- lib/libc/arch/sparc/gen/fpsetround.c | 9 ++++----- 6 files changed, 23 insertions(+), 25 deletions(-) diff --git a/lib/libc/arch/sparc/gen/flt_rounds.c b/lib/libc/arch/sparc/gen/flt_rounds.c index 7f674836e618..c64b1ff86272 100644 --- a/lib/libc/arch/sparc/gen/flt_rounds.c +++ b/lib/libc/arch/sparc/gen/flt_rounds.c @@ -1,4 +1,4 @@ -/* $NetBSD: flt_rounds.c,v 1.6 2005/12/24 23:10:08 perry Exp $ */ +/* $NetBSD: flt_rounds.c,v 1.7 2012/03/21 00:38:34 christos Exp $ */ /* * Written by J.T. Conklin, Apr 10, 1995 @@ -7,7 +7,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: flt_rounds.c,v 1.6 2005/12/24 23:10:08 perry Exp $"); +__RCSID("$NetBSD: flt_rounds.c,v 1.7 2012/03/21 00:38:34 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -21,9 +21,9 @@ static const int map[] = { }; int -__flt_rounds() +__flt_rounds(void) { - int x; + unsigned int x; __asm("st %%fsr,%0" : "=m" (*&x)); return map[(x >> 30) & 0x03]; diff --git a/lib/libc/arch/sparc/gen/fpgetmask.c b/lib/libc/arch/sparc/gen/fpgetmask.c index 0639cb887e8a..281e2474bab9 100644 --- a/lib/libc/arch/sparc/gen/fpgetmask.c +++ b/lib/libc/arch/sparc/gen/fpgetmask.c @@ -1,4 +1,4 @@ -/* $NetBSD: fpgetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */ +/* $NetBSD: fpgetmask.c,v 1.6 2012/03/21 00:38:34 christos Exp $ */ /* * Written by J.T. Conklin, Apr 10, 1995 @@ -7,7 +7,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: fpgetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $"); +__RCSID("$NetBSD: fpgetmask.c,v 1.6 2012/03/21 00:38:34 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -19,9 +19,9 @@ __weak_alias(fpgetmask,_fpgetmask) #endif fp_except -fpgetmask() +fpgetmask(void) { - int x; + unsigned int x; __asm("st %%fsr,%0" : "=m" (*&x)); return (x >> 23) & 0x1f; diff --git a/lib/libc/arch/sparc/gen/fpgetround.c b/lib/libc/arch/sparc/gen/fpgetround.c index 2dffecfec8b5..eafd21a248e9 100644 --- a/lib/libc/arch/sparc/gen/fpgetround.c +++ b/lib/libc/arch/sparc/gen/fpgetround.c @@ -1,4 +1,4 @@ -/* $NetBSD: fpgetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */ +/* $NetBSD: fpgetround.c,v 1.6 2012/03/21 00:38:34 christos Exp $ */ /* * Written by J.T. Conklin, Apr 10, 1995 @@ -7,7 +7,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: fpgetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $"); +__RCSID("$NetBSD: fpgetround.c,v 1.6 2012/03/21 00:38:34 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -19,9 +19,9 @@ __weak_alias(fpgetround,_fpgetround) #endif fp_rnd -fpgetround() +fpgetround(void) { - int x; + unsigned int x; __asm("st %%fsr,%0" : "=m" (*&x)); return (x >> 30) & 0x03; diff --git a/lib/libc/arch/sparc/gen/fpgetsticky.c b/lib/libc/arch/sparc/gen/fpgetsticky.c index ebff93ff42ad..3184ee1bc66c 100644 --- a/lib/libc/arch/sparc/gen/fpgetsticky.c +++ b/lib/libc/arch/sparc/gen/fpgetsticky.c @@ -1,4 +1,4 @@ -/* $NetBSD: fpgetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */ +/* $NetBSD: fpgetsticky.c,v 1.6 2012/03/21 00:38:34 christos Exp $ */ /* * Written by J.T. Conklin, Apr 10, 1995 @@ -7,7 +7,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: fpgetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $"); +__RCSID("$NetBSD: fpgetsticky.c,v 1.6 2012/03/21 00:38:34 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -19,9 +19,9 @@ __weak_alias(fpgetsticky,_fpgetsticky) #endif fp_except -fpgetsticky() +fpgetsticky(void) { - int x; + unsigned int x; __asm("st %%fsr,%0" : "=m" (*&x)); return (x >> 5) & 0x1f; diff --git a/lib/libc/arch/sparc/gen/fpsetmask.c b/lib/libc/arch/sparc/gen/fpsetmask.c index 99ca472c1840..250761e48d92 100644 --- a/lib/libc/arch/sparc/gen/fpsetmask.c +++ b/lib/libc/arch/sparc/gen/fpsetmask.c @@ -1,4 +1,4 @@ -/* $NetBSD: fpsetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */ +/* $NetBSD: fpsetmask.c,v 1.6 2012/03/21 00:38:34 christos Exp $ */ /* * Written by J.T. Conklin, Apr 10, 1995 @@ -7,7 +7,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: fpsetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $"); +__RCSID("$NetBSD: fpsetmask.c,v 1.6 2012/03/21 00:38:34 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -19,8 +19,7 @@ __weak_alias(fpsetmask,_fpsetmask) #endif fp_except -fpsetmask(mask) - fp_except mask; +fpsetmask(fp_except mask) { fp_except old; fp_except new; diff --git a/lib/libc/arch/sparc/gen/fpsetround.c b/lib/libc/arch/sparc/gen/fpsetround.c index 122feb266c43..4a0700ffafd9 100644 --- a/lib/libc/arch/sparc/gen/fpsetround.c +++ b/lib/libc/arch/sparc/gen/fpsetround.c @@ -1,4 +1,4 @@ -/* $NetBSD: fpsetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */ +/* $NetBSD: fpsetround.c,v 1.6 2012/03/21 00:38:35 christos Exp $ */ /* * Written by J.T. Conklin, Apr 10, 1995 @@ -7,7 +7,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: fpsetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $"); +__RCSID("$NetBSD: fpsetround.c,v 1.6 2012/03/21 00:38:35 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -19,8 +19,7 @@ __weak_alias(fpsetround,_fpsetround) #endif fp_rnd -fpsetround(rnd_dir) - fp_rnd rnd_dir; +fpsetround(fp_rnd rnd_dir) { fp_rnd old; fp_rnd new; @@ -33,5 +32,5 @@ fpsetround(rnd_dir) __asm("ld %0,%%fsr" : : "m" (*&new)); - return (old >> 30) & 0x03; + return ((unsigned int)old >> 30) & 0x03; }