--- a/portmidi/pm_linux/pmlinuxalsa.c
+++ b/portmidi/pm_linux/pmlinuxalsa.c
@@ -9,9 +9,7 @@
 
 #include "stdlib.h"
 #include "portmidi.h"
-#ifdef NEWBUFFER
 #include "pmutil.h"
-#endif
 #include "pminternal.h"
 #include "pmlinuxalsa.h"
 #include "string.h"
@@ -39,7 +37,6 @@
 #define GET_DESCRIPTOR_PORT(info) (((int)(info)) & 0xff)
 
 #define BYTE unsigned char
-#define UINT unsigned long
 
 extern pm_fns_node pm_linuxalsa_in_dictionary;
 extern pm_fns_node pm_linuxalsa_out_dictionary;
@@ -385,12 +382,12 @@
 
 #ifdef GARBAGE
 This is old code here temporarily for reference
-static PmError alsa_write(PmInternal *midi, PmEvent *buffer, long length)
+static PmError alsa_write(PmInternal *midi, PmEvent *buffer, int32_t length)
 {
     alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
     int i, bytes;
     unsigned char byte;
-    long msg;
+    PmMessage msg;
 
     desc->error = 0;
     for (; length > 0; length--, buffer++) {
@@ -423,19 +420,6 @@
     }
     if (desc->error < 0) return pmHostError;
 
-    VERBOSE printf("snd_seq_drain_output: 0x%x\n", seq);
-    desc->error = snd_seq_drain_output(seq);
-    if (desc->error < 0) return pmHostError;
-
-    desc->error = pmNoError;
-    return pmNoError;
-}
-#endif
-
-
-static PmError alsa_write_flush(PmInternal *midi, PmTimestamp timestamp)
-{
-    alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
     VERBOSE printf("snd_seq_drain_output: 0x%x\n", (unsigned int) seq);
     desc->error = snd_seq_drain_output(seq);
     if (desc->error < 0) return pmHostError;
@@ -443,12 +427,25 @@
     desc->error = pmNoError;
     return pmNoError;
 }
+#endif
+
+
+static PmError alsa_write_flush(PmInternal *midi, PmTimestamp timestamp)
+{
+    alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
+    VERBOSE printf("snd_seq_drain_output: 0x%x\n", (unsigned int) seq);
+    desc->error = snd_seq_drain_output(seq);
+    if (desc->error < 0) return pmHostError;
+
+    desc->error = pmNoError;
+    return pmNoError;
+}
 
 
 static PmError alsa_write_short(PmInternal *midi, PmEvent *event)
 {
     int bytes = midi_message_length(event->message);
-    long msg = event->message;
+    PmMessage msg = event->message;
     int i;
     alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
     for (i = 0; i < bytes; i++) {