]> git.alsa-project.org Git - alsa-utils.git/commitdiff
aseqdump: fix MIDI 2.0 code - it compiles now
authorJaroslav Kysela <perex@perex.cz>
Wed, 30 Aug 2023 13:55:06 +0000 (15:55 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 30 Aug 2023 13:56:06 +0000 (15:56 +0200)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
seq/aseqdump/aseqdump.c

index 2610b16cc6930f43df5c1cdac74431158b7f70c1..c66f9350b4b92245ef4a82fff280c5209331e03d 100644 (file)
@@ -377,7 +377,7 @@ static int group_number(unsigned char c)
                return c;
 }
 
-static const char *pitchbend_value(u8 msb, u8 lsb)
+static const char *pitchbend_value(uint8_t msb, uint8_t lsb)
 {
        int pb = (msb << 7) | lsb;
 
@@ -415,8 +415,9 @@ static void dump_ump_midi1_event(const unsigned int *ump)
        case SND_UMP_MSG_PROGRAM_CHANGE:
                printf("Program change         %2d, program %d",
                       channel, m->program_change.program);
+               break;
        case SND_UMP_MSG_CHANNEL_PRESSURE:
-               printf("Channel pressure       %2d, value %d",
+               printf("Channel pressure       %2d, value %s",
                       channel, midi1_data(m->channel_pressure.data));
                break;
        case SND_UMP_MSG_PITCHBEND:
@@ -445,7 +446,7 @@ static const char *midi2_velocity(unsigned int v)
                                 ((double)(v - 0x8000) * 63.0) / 0x7fff + 64.0);
                return tmp;
        } else if (view_mode == VIEW_PERCENT) {
-               snprintf(tmp, sizeof(tmp), "%.2f%%", (double)v * 100.0) / 0xffff);
+               snprintf(tmp, sizeof(tmp), "%.2f%%", ((double)v * 100.0) / 0xffff);
                return tmp;
        }
 
@@ -470,7 +471,7 @@ static const char *midi2_data(unsigned int v)
                                 ((double)(v - 0x80000000U) * 63.0) / 0x7fffffffU + 64.0);
                return tmp;
        } else if (view_mode == VIEW_PERCENT) {
-               snprintf(tmp, sizeof(tmp), "%.2f%%", (double)v * 100.0) / 0xffffffffU);
+               snprintf(tmp, sizeof(tmp), "%.2f%%", ((double)v * 100.0) / 0xffffffffU);
                return tmp;
        }
 
@@ -509,7 +510,6 @@ static void dump_ump_midi2_event(const unsigned int *ump)
        unsigned char group = group_number(m->hdr.group);
        unsigned char status = m->hdr.status;
        unsigned char channel = channel_number(m->hdr.channel);
-       unsigned int bank;
 
        printf("Group %2d, ", group);
        switch (status) {