Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/arch/mips/gen Cast to unsigned int before doing shi...



details:   https://anonhg.NetBSD.org/src/rev/dcae3c4271a2
branches:  trunk
changeset: 778231:dcae3c4271a2
user:      he <he%NetBSD.org@localhost>
date:      Tue Mar 20 10:51:23 2012 +0000

description:
Cast to unsigned int before doing shift operations, to appease lint.

diffstat:

 lib/libc/arch/mips/gen/fpgetmask.c   |  6 +++---
 lib/libc/arch/mips/gen/fpgetsticky.c |  6 +++---
 lib/libc/arch/mips/gen/fpsetmask.c   |  6 +++---
 lib/libc/arch/mips/gen/fpsetsticky.c |  6 +++---
 4 files changed, 12 insertions(+), 12 deletions(-)

diffs (100 lines):

diff -r cbfc19942246 -r dcae3c4271a2 lib/libc/arch/mips/gen/fpgetmask.c
--- a/lib/libc/arch/mips/gen/fpgetmask.c        Tue Mar 20 10:40:48 2012 +0000
+++ b/lib/libc/arch/mips/gen/fpgetmask.c        Tue Mar 20 10:51:23 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpgetmask.c,v 1.6 2012/03/19 22:23:10 matt Exp $       */
+/*     $NetBSD: fpgetmask.c,v 1.7 2012/03/20 10:51:23 he Exp $ */
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpgetmask.c,v 1.6 2012/03/19 22:23:10 matt Exp $");
+__RCSID("$NetBSD: fpgetmask.c,v 1.7 2012/03/20 10:51:23 he Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -24,5 +24,5 @@
        fp_except x;
 
        __asm("cfc1 %0,$31" : "=r" (x));
-       return (x >> 7) & 0x1f;
+       return ((unsigned int)x >> 7) & 0x1f;
 }
diff -r cbfc19942246 -r dcae3c4271a2 lib/libc/arch/mips/gen/fpgetsticky.c
--- a/lib/libc/arch/mips/gen/fpgetsticky.c      Tue Mar 20 10:40:48 2012 +0000
+++ b/lib/libc/arch/mips/gen/fpgetsticky.c      Tue Mar 20 10:51:23 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpgetsticky.c,v 1.6 2012/03/19 22:23:10 matt Exp $     */
+/*     $NetBSD: fpgetsticky.c,v 1.7 2012/03/20 10:51:24 he Exp $       */
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpgetsticky.c,v 1.6 2012/03/19 22:23:10 matt Exp $");
+__RCSID("$NetBSD: fpgetsticky.c,v 1.7 2012/03/20 10:51:24 he Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -24,5 +24,5 @@
        fp_except x;
 
        __asm("cfc1 %0,$31" : "=r" (x));
-       return (x >> 2) & 0x1f;
+       return ((unsigned int)x >> 2) & 0x1f;
 }
diff -r cbfc19942246 -r dcae3c4271a2 lib/libc/arch/mips/gen/fpsetmask.c
--- a/lib/libc/arch/mips/gen/fpsetmask.c        Tue Mar 20 10:40:48 2012 +0000
+++ b/lib/libc/arch/mips/gen/fpsetmask.c        Tue Mar 20 10:51:23 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpsetmask.c,v 1.6 2012/03/19 22:23:10 matt Exp $       */
+/*     $NetBSD: fpsetmask.c,v 1.7 2012/03/20 10:51:24 he Exp $ */
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetmask.c,v 1.6 2012/03/19 22:23:10 matt Exp $");
+__RCSID("$NetBSD: fpsetmask.c,v 1.7 2012/03/20 10:51:24 he Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -31,5 +31,5 @@
 
        __asm("ctc1 %0,$31" : : "r" (new));
 
-       return (old >> 7) & 0x1f;
+       return ((unsigned int)old >> 7) & 0x1f;
 }
diff -r cbfc19942246 -r dcae3c4271a2 lib/libc/arch/mips/gen/fpsetsticky.c
--- a/lib/libc/arch/mips/gen/fpsetsticky.c      Tue Mar 20 10:40:48 2012 +0000
+++ b/lib/libc/arch/mips/gen/fpsetsticky.c      Tue Mar 20 10:51:23 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpsetsticky.c,v 1.6 2012/03/19 22:23:10 matt Exp $     */
+/*     $NetBSD: fpsetsticky.c,v 1.7 2012/03/20 10:51:24 he Exp $       */
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetsticky.c,v 1.6 2012/03/19 22:23:10 matt Exp $");
+__RCSID("$NetBSD: fpsetsticky.c,v 1.7 2012/03/20 10:51:24 he Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -31,5 +31,5 @@
 
        __asm("ctc1 %0,$31" : : "r" (new));
 
-       return (old >> 2) & 0x1f;
+       return ((unsigned int)old >> 2) & 0x1f;
 }



Home | Main Index | Thread Index | Old Index