mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
Merge windows+cc branch into cairocanvas branch. Not finished, need to now merge windows branch to get changes from there
This commit is contained in:
commit
3020b224fa
466 changed files with 10821 additions and 1674 deletions
|
|
@ -40,7 +40,11 @@
|
|||
#include <math.h>
|
||||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#include "smf.h"
|
||||
#include "smf_private.h"
|
||||
|
||||
|
|
@ -119,7 +123,7 @@ parse_mthd_header(smf_t *smf)
|
|||
return (-1);
|
||||
}
|
||||
|
||||
tmp_mthd = smf->file_buffer;
|
||||
tmp_mthd = (struct chunk_header_struct*)smf->file_buffer;
|
||||
|
||||
if (!chunk_signature_matches(tmp_mthd, "MThd")) {
|
||||
g_critical("SMF error: MThd signature not found, is that a MIDI file?");
|
||||
|
|
@ -409,7 +413,7 @@ extract_sysex_event(const unsigned char *buf, const size_t buffer_length, smf_ev
|
|||
}
|
||||
|
||||
event->midi_buffer_length = message_length;
|
||||
event->midi_buffer = malloc(event->midi_buffer_length);
|
||||
event->midi_buffer = (uint8_t*)malloc(event->midi_buffer_length);
|
||||
if (event->midi_buffer == NULL) {
|
||||
g_critical("Cannot allocate memory in extract_sysex_event(): %s", strerror(errno));
|
||||
return (-4);
|
||||
|
|
@ -452,7 +456,7 @@ extract_escaped_event(const unsigned char *buf, const size_t buffer_length, smf_
|
|||
}
|
||||
|
||||
event->midi_buffer_length = message_length;
|
||||
event->midi_buffer = malloc(event->midi_buffer_length);
|
||||
event->midi_buffer = (uint8_t*)malloc(event->midi_buffer_length);
|
||||
if (event->midi_buffer == NULL) {
|
||||
g_critical("Cannot allocate memory in extract_escaped_event(): %s", strerror(errno));
|
||||
return (-4);
|
||||
|
|
@ -522,7 +526,7 @@ extract_midi_event(const unsigned char *buf, const size_t buffer_length, smf_eve
|
|||
}
|
||||
|
||||
event->midi_buffer_length = message_length;
|
||||
event->midi_buffer = malloc(event->midi_buffer_length);
|
||||
event->midi_buffer = (uint8_t*)malloc(event->midi_buffer_length);
|
||||
if (event->midi_buffer == NULL) {
|
||||
g_critical("Cannot allocate memory in extract_midi_event(): %s", strerror(errno));
|
||||
return (-4);
|
||||
|
|
@ -611,7 +615,7 @@ make_string(const unsigned char *buf, const size_t buffer_length, uint32_t len)
|
|||
len = buffer_length;
|
||||
}
|
||||
|
||||
str = malloc(len + 1);
|
||||
str = (char*)malloc(len + 1);
|
||||
if (str == NULL) {
|
||||
g_critical("Cannot allocate memory in make_string().");
|
||||
return (NULL);
|
||||
|
|
@ -662,14 +666,14 @@ smf_event_extract_text(const smf_event_t *event)
|
|||
return (NULL);
|
||||
}
|
||||
|
||||
smf_extract_vlq((void *)&(event->midi_buffer[2]), event->midi_buffer_length - 2, &string_length, &length_length);
|
||||
smf_extract_vlq((const unsigned char*)(void *)&(event->midi_buffer[2]), event->midi_buffer_length - 2, &string_length, &length_length);
|
||||
|
||||
if (string_length <= 0) {
|
||||
g_critical("smf_event_extract_text: truncated MIDI message.");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
return (make_string((void *)(&event->midi_buffer[2] + length_length), event->midi_buffer_length - 2 - length_length, string_length));
|
||||
return (make_string((const unsigned char*)(void *)(&event->midi_buffer[2] + length_length), event->midi_buffer_length - 2 - length_length, string_length));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue