Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Don't left-shift negative numbers by making them uns...



details:   https://anonhg.NetBSD.org/src/rev/b0857905d961
branches:  trunk
changeset: 810380:b0857905d961
user:      joerg <joerg%NetBSD.org@localhost>
date:      Fri Aug 28 13:04:29 2015 +0000

description:
Don't left-shift negative numbers by making them unsigned.

diffstat:

 sys/dev/midictl.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 173006b7a2d9 -r b0857905d961 sys/dev/midictl.c
--- a/sys/dev/midictl.c Fri Aug 28 13:03:36 2015 +0000
+++ b/sys/dev/midictl.c Fri Aug 28 13:04:29 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: midictl.c,v 1.7 2011/11/23 23:07:31 jmcneill Exp $ */
+/* $NetBSD: midictl.c,v 1.8 2015/08/28 13:04:29 joerg Exp $ */
 
 /*-
  * Copyright (c) 2006, 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: midictl.c,v 1.7 2011/11/23 23:07:31 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: midictl.c,v 1.8 2015/08/28 13:04:29 joerg Exp $");
 
 /*
  * See midictl.h for an overview of the purpose and use of this module.
@@ -260,7 +260,7 @@
                mc->nrpn &= ~PN_SET;
                return;
        case MIDI_CTRL_RPN_MSB:
-               mc-> rpn &= ~0x7f<<7;
+               mc-> rpn &= ~0x7fU<<7;
                mc-> rpn |=  PN_SET | (0x7f & ctlval[1])<<7;
                mc->nrpn &= ~PN_SET;
                return;
@@ -270,7 +270,7 @@
                mc-> rpn &= ~PN_SET;
                return;
        case MIDI_CTRL_NRPN_MSB:
-               mc->nrpn &= ~0x7f<<7;
+               mc->nrpn &= ~0x7fU<<7;
                mc->nrpn |=  PN_SET | (0x7f & ctlval[1])<<7;
                mc-> rpn &= ~PN_SET;
                return;



Home | Main Index | Thread Index | Old Index