Add some casting and namespace specifiers to keep MSVC happy
authorJohn Emmas <johne53@tiscali.co.uk>
Tue, 6 May 2014 08:20:03 +0000 (09:20 +0100)
committerJohn Emmas <johne53@tiscali.co.uk>
Tue, 6 May 2014 08:20:03 +0000 (09:20 +0100)
libs/ardour/async_midi_port.cc
libs/backends/wavesaudio/portmidi/src/pm_common/portmidi.c
libs/backends/wavesaudio/portmidi/src/pm_win/pmwin.c
libs/backends/wavesaudio/portmidi/src/pm_win/pmwinmm.c

index 21b59dec00241bacfaa3a9b11acba2fb19fb932d..ce32fe2ccc4d7e28a3bd2324c4f3cd42a0b768a9 100644 (file)
@@ -64,7 +64,7 @@ AsyncMIDIPort::~AsyncMIDIPort ()
 }
 
 void
-AsyncMIDIPort::set_timer (boost::function<framecnt_t (void)>& f)
+AsyncMIDIPort::set_timer (boost::function<MIDI::framecnt_t (void)>& f)
 {
        timer = f;
        have_timer = true;
index b7161700d69edea94dd40c3b1ddf483c0da9c657..b262ba5391d90bf70af285a0e314afe3d96a0e2a 100644 (file)
@@ -420,7 +420,7 @@ PMEXPORT PmError Pm_Poll( PortMidiStream *stream )
         return pm_errmsg(err);
     }
 
-    return !Pm_QueueEmpty(midi->queue);
+    return (PmError) !Pm_QueueEmpty(midi->queue);
 }
 
 
index aeed48554dba4ee6b16d043e7386b2f07d8b3e4a..9d36f100a54abf59ae43cad9a10e474baddde45e 100644 (file)
@@ -91,7 +91,7 @@ static PmDeviceID pm_get_default_device_id(int is_input, char *key) {
         ERROR_SUCCESS) {
         return id;
     }
-    if (RegQueryValueEx(hkey, key, NULL, &dwType, pattern, &pattern_max) != 
+    if (RegQueryValueEx(hkey, key, NULL, &dwType, (LPBYTE)pattern, (LPDWORD)&pattern_max) != 
        ERROR_SUCCESS) {
         return id;
     }
@@ -140,4 +140,3 @@ void pm_free(void *ptr) {
     free(ptr); 
 }
 
-
index 2de8109a0a142f1a1efd1413618dc7a2848edb76..5872ee2ad9cf25b31825f162c01ec6ef6e39ec7e 100644 (file)
@@ -2,6 +2,8 @@
 
 #ifdef _MSC_VER
  #pragma warning(disable: 4133) // stop warnings about implicit typecasts
+
+#define max(a,b) __max(a,b)
 #endif
 
 #ifndef _WIN32_WINNT
@@ -209,7 +211,7 @@ static void pm_winmm_general_outputs()
     UINT i;
     DWORD wRtn;
     midi_num_outputs = midiOutGetNumDevs();
-    midi_out_caps = pm_alloc( sizeof(MIDIOUTCAPS) * midi_num_outputs );
+    midi_out_caps = (MIDIOUTCAPS*)pm_alloc( sizeof(MIDIOUTCAPS) * midi_num_outputs );
 
     if (midi_out_caps == NULL) {
         /* no error is reported -- see pm_winmm_general_inputs */
@@ -533,10 +535,10 @@ static PmError allocate_input_buffer(HMIDIIN h, long buffer_len)
     pm_hosterror = midiInPrepareHeader(h, hdr, sizeof(MIDIHDR));
     if (pm_hosterror) {
         pm_free(hdr);
-        return pm_hosterror;
+        return (PmError) pm_hosterror;
     }
     pm_hosterror = midiInAddBuffer(h, hdr, sizeof(MIDIHDR));
-    return pm_hosterror;
+    return (PmError) pm_hosterror;
 }
 
 
@@ -628,7 +630,7 @@ no_memory:
 
 static PmError winmm_in_poll(PmInternal *midi) {
     midiwinmm_type m = (midiwinmm_type) midi->descriptor;
-    return m->error;
+    return (PmError) m->error;
 }
 
 
@@ -1208,7 +1210,7 @@ static PmError winmm_write_byte(PmInternal *midi, unsigned char byte,
         m->hdr = hdr = get_free_output_buffer(midi);
         assert(hdr);
         midi->fill_base = (unsigned char *) m->hdr->lpData;
-        midi->fill_offset_ptr = &(hdr->dwBytesRecorded);
+        midi->fill_offset_ptr = (uint32_t*) &(hdr->dwBytesRecorded);
         /* when buffer fills, Pm_WriteSysEx will revert to calling
          * pmwin_write_byte, which expect to have space, so leave
          * one byte free for pmwin_write_byte. Leave another byte
@@ -1424,7 +1426,7 @@ void pm_winmm_term( void )
     printf("pm_winmm_term called\n");
 #endif
     for (i = 0; i < pm_descriptor_index; i++) {
-        PmInternal * midi = descriptors[i].internalDescriptor;
+        PmInternal * midi = (PmInternal*) descriptors[i].internalDescriptor;
         if (midi) {
             midiwinmm_type m = (midiwinmm_type) midi->descriptor;
             if (m->handle.out) {