aboutsummaryrefslogtreecommitdiffstats
path: root/testing/portmidi/50-change_assert.patch
diff options
context:
space:
mode:
authorTaner Tas <taner76@gmail.com>2018-02-21 16:33:34 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2018-02-28 12:53:05 +0000
commit24cdbb59afb3e0141401a09cc98c918283ccdc49 (patch)
treec18c934ec904845e8c95d4f52137960751faeec0 /testing/portmidi/50-change_assert.patch
parent478a4a468ecf31c263b6c76dfab0f2332bc3365f (diff)
downloadaports-24cdbb59afb3e0141401a09cc98c918283ccdc49.tar.bz2
aports-24cdbb59afb3e0141401a09cc98c918283ccdc49.tar.xz
testing/portmidi: new aport
http://portmedia.sourceforge.net/ PortMidi is a platform independent library for MIDI input/output.
Diffstat (limited to 'testing/portmidi/50-change_assert.patch')
-rw-r--r--testing/portmidi/50-change_assert.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/testing/portmidi/50-change_assert.patch b/testing/portmidi/50-change_assert.patch
new file mode 100644
index 0000000000..05a2bf709c
--- /dev/null
+++ b/testing/portmidi/50-change_assert.patch
@@ -0,0 +1,41 @@
+diff --git a/pm_common/portmidi.c b/pm_common/portmidi.c
+index b716170..9a469b1 100755
+--- a/pm_common/portmidi.c
++++ b/pm_common/portmidi.c
+@@ -9,7 +9,6 @@
+ #include "porttime.h"
+ #include "pmutil.h"
+ #include "pminternal.h"
+-#include <assert.h>
+
+ #define MIDI_CLOCK 0xf8
+ #define MIDI_ACTIVE 0xfe
+@@ -293,8 +292,8 @@ PMEXPORT const char *Pm_GetErrorText( PmError errnum ) {
+ * The error will always be in the global pm_hosterror_text.
+ */
+ PMEXPORT void Pm_GetHostErrorText(char * msg, unsigned int len) {
+- assert(msg);
+- assert(len > 0);
++ if (!msg) return;
++ if (len <= 0) return;
+ if (pm_hosterror) {
+ strncpy(msg, (char *) pm_hosterror_text, len);
+ pm_hosterror = FALSE;
+@@ -1016,7 +1015,7 @@ void pm_read_short(PmInternal *midi, PmEvent *event)
+ {
+ int status;
+ /* arg checking */
+- assert(midi != NULL);
++ if (!midi) return;
+ /* midi filtering is applied here */
+ status = Pm_MessageStatus(event->message);
+ if (!pm_status_filtered(status, midi->filters)
+@@ -1058,7 +1057,7 @@ unsigned int pm_read_bytes(PmInternal *midi, const unsigned char *data,
+ int i = 0; /* index into data, must not be unsigned (!) */
+ PmEvent event;
+ event.timestamp = timestamp;
+- assert(midi);
++ if (!midi) return 0;
+ /* note that since buffers may not have multiples of 4 bytes,
+ * pm_read_bytes may be called in the middle of an outgoing
+ * 4-byte PortMidi message. sysex_in_progress indicates that