Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/midirecord only prev_div needs to be static.



details:   https://anonhg.NetBSD.org/src/rev/ed204b22d76d
branches:  trunk
changeset: 335212:ed204b22d76d
user:      mrg <mrg%NetBSD.org@localhost>
date:      Tue Dec 30 06:08:14 2014 +0000

description:
only prev_div needs to be static.
add channel to some log messages.

diffstat:

 usr.bin/midirecord/midirecord.c |  17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diffs (59 lines):

diff -r 5a85ec588477 -r ed204b22d76d usr.bin/midirecord/midirecord.c
--- a/usr.bin/midirecord/midirecord.c   Tue Dec 30 04:22:18 2014 +0000
+++ b/usr.bin/midirecord/midirecord.c   Tue Dec 30 06:08:14 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: midirecord.c,v 1.1 2014/12/30 04:14:25 mrg Exp $       */
+/*     $NetBSD: midirecord.c,v 1.2 2014/12/30 06:08:14 mrg Exp $       */
 
 /*
  * Copyright (c) 2014 Matthew R. Green
@@ -33,7 +33,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: midirecord.c,v 1.1 2014/12/30 04:14:25 mrg Exp $");
+__RCSID("$NetBSD: midirecord.c,v 1.2 2014/12/30 06:08:14 mrg Exp $");
 #endif
 
 #include <sys/param.h>
@@ -311,7 +311,8 @@
        u_char *buffer,
        size_t bufsize)
 {
-       static uint32_t prev_div, cur_div;
+       static unsigned prev_div;
+       unsigned cur_div;
        unsigned val = 0, div;
        int vallen = 0, i;
 
@@ -330,7 +331,7 @@
                        vallen++;
                }
        } else
-               val = 0, vallen = 1;
+               vallen = 1;
 
        for (i = 0; i < vallen; i++) {
                buffer[i] = val & 0xff;
@@ -466,8 +467,8 @@
                buffer[1] = e.c_NOTEOFF.key;
                buffer[2] = e.c_NOTEOFF.velocity;
 
-               LOG("MIDI_NOTEOFF: key %x velocity %x",
-                   e.c_NOTEOFF.key, e.c_NOTEOFF.velocity);
+               LOG("MIDI_NOTEOFF: channel %x key %x velocity %x",
+                   e.c_NOTEOFF.channel, e.c_NOTEOFF.key, e.c_NOTEOFF.velocity);
                size = 3;
                break;
 
@@ -476,8 +477,8 @@
                buffer[1] = e.c_NOTEON.key;
                buffer[2] = e.c_NOTEON.velocity;
 
-               LOG("MIDI_NOTEON: key %x velocity %x",
-                   e.c_NOTEON.key, e.c_NOTEON.velocity);
+               LOG("MIDI_NOTEON: channel %x key %x velocity %x",
+                   e.c_NOTEON.channel, e.c_NOTEON.key, e.c_NOTEON.velocity);
                size = 3;
                break;
 



Home | Main Index | Thread Index | Old Index