Source-Changes-HG archive

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

[src/trunk]: src/include more casting fixes



details:   https://anonhg.NetBSD.org/src/rev/912c27581740
branches:  trunk
changeset: 344223:912c27581740
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Mar 17 02:25:32 2016 +0000

description:
more casting fixes

diffstat:

 include/bitstring.h |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (25 lines):

diff -r 825132fe3b89 -r 912c27581740 include/bitstring.h
--- a/include/bitstring.h       Thu Mar 17 01:41:54 2016 +0000
+++ b/include/bitstring.h       Thu Mar 17 02:25:32 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bitstring.h,v 1.13 2016/03/17 00:15:27 christos Exp $  */
+/*     $NetBSD: bitstring.h,v 1.14 2016/03/17 02:25:32 christos Exp $  */
 
 /*
  * Copyright (c) 1989, 1993
@@ -82,11 +82,13 @@
                                /* set bit N of bitstring name */
 #define        bit_set(name, bit) \
        /*LINTED bitwise on signed*/ \
-       ((name)[_bit_byte(bit)] = _bit_mask(bit) | (name)[bit_byte(bit))
+       ((name)[_bit_byte(bit)] = \
+       (unsigned char)(_bit_mask(bit) | (name)[_bit_byte(bit)]))
 
                                /* clear bit N of bitstring name */
 #define        bit_clear(name, bit) \
-       /*LINTED bitwise on signed*/((name)[_bit_byte(bit)] &= ~_bit_mask(bit))
+       /*LINTED bitwise on signed*/ \
+       ((name)[_bit_byte(bit)] &= (unsigned char)~_bit_mask(bit))
 
                                /* clear bits start ... stop in bitstring */
 #define        bit_nclear(name, start, stop) do { \



Home | Main Index | Thread Index | Old Index