small round of compiler warning fixes
authorRobin Gareus <robin@gareus.org>
Thu, 23 Oct 2014 01:32:14 +0000 (03:32 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 23 Oct 2014 01:43:04 +0000 (03:43 +0200)
gtk2_ardour/ardour_ui.cc
gtk2_ardour/editor_routes.cc
libs/ardour/ardour/audioengine.h
libs/ardour/ardour/midi_buffer.h
libs/ardour/midi_buffer.cc
libs/ardour/midi_ring_buffer.cc
libs/backends/wavesaudio/waves_audiobackend.cc

index 4141bd720bc84cc9e325b8ce72df1d2ef8abccb5..3b385ef292e8b3d2aadbaf283ba9ffba28a5f567 100644 (file)
@@ -3601,13 +3601,13 @@ ARDOUR_UI::start_video_server (Gtk::Window* float_window, bool popup_msg)
                        continue;
                }
 #ifndef PLATFORM_WINDOWS
-               if ( (!g_lstat (icsd_exec.c_str(), &sb) == 0)
+               if ( (g_lstat (icsd_exec.c_str(), &sb) != 0)
                     || (sb.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) == 0 ) {
                        warning << _("Given Video Server is not an executable file.") << endmsg;
                        continue;
                }
 #else
-               if ( (!g_lstat (icsd_exec.c_str(), &sb) == 0)
+               if ( (g_lstat (icsd_exec.c_str(), &sb) != 0)
                     || (sb.st_mode & (S_IXUSR)) == 0 ) {
                        warning << _("Given Video Server is not an executable file.") << endmsg;
                        continue;
index e066e721fef7a3cfc04375ed088fcdf0d2946491..10b1cc894d7b2f2d56a266279ce83b7a1a24c375 100644 (file)
@@ -810,7 +810,7 @@ EditorRoutes::update_visibility ()
        TreeModel::Children rows = _model->children();
        TreeModel::Children::iterator i;
 
-       DisplaySuspender ds ();
+       DisplaySuspender ds;
 
        for (i = rows.begin(); i != rows.end(); ++i) {
                TimeAxisView *tv = (*i)[_columns.tv];
index 181cfd1a97bfbd501cd16b55c148a1f1c8f72db3..3bc95b37be9946a50f3523eff418f60653f3302d 100644 (file)
@@ -55,7 +55,7 @@ class Port;
 class Session;
 class ProcessThread;
 class AudioBackend;
-class AudioBackendInfo;
+struct AudioBackendInfo;
 
 class LIBARDOUR_API AudioEngine : public SessionHandlePtr, public PortManager
 {
index 2e2cbf65042cc958bba8eae9ee5659be78e0ef79..6571924bef77d966386bd2abf0ee367cd6a8414f 100644 (file)
@@ -87,7 +87,7 @@ public:
                        int event_size = Evoral::midi_event_size(ev_start);
                        assert(event_size >= 0);
                        return EventType(EventTypeMap::instance().midi_event_type(*ev_start),
-                                       *((TimeType*)(buffer->_data + offset)),
+                                       *(reinterpret_cast<TimeType*>((uintptr_t)(buffer->_data + offset))),
                                        event_size, ev_start);
                }
 
index 4715be928c18d39c88e68225da959fbbe8527bca..7f79262b2fdd35a5bea3910fe78a767a3fb200cb 100644 (file)
@@ -190,7 +190,7 @@ MidiBuffer::push_back(TimeType time, size_t size, const uint8_t* data)
        }
 
        uint8_t* const write_loc = _data + _size;
-       *((TimeType*)write_loc) = time;
+       *(reinterpret_cast<TimeType*>((uintptr_t)write_loc)) = time;
        memcpy(write_loc + stamp_size, data, size);
 
        _size += stamp_size + size;
@@ -242,7 +242,7 @@ MidiBuffer::insert_event(const Evoral::MIDIEvent<TimeType>& ev)
        }
 
        uint8_t* const write_loc = _data + insert_offset;
-       *((TimeType*)write_loc) = t;
+       *(reinterpret_cast<TimeType*>((uintptr_t)write_loc)) = t;
        memcpy(write_loc + stamp_size, ev.buffer(), ev.size());
 
        _size += bytes_to_merge;
@@ -267,7 +267,7 @@ MidiBuffer::reserve(TimeType time, size_t size)
 
        // write timestamp
        uint8_t* write_loc = _data + _size;
-       *((TimeType*)write_loc) = time;
+       *(reinterpret_cast<TimeType*>((uintptr_t)write_loc)) = time;
 
        // move write_loc to begin of MIDI buffer data to write to
        write_loc += stamp_size;
index e4ae3f3ffe5e9b210f0df544d34b0c6f1e8a66d9..555ac6fb96c6422975655688ee8f9eaf3092d9c0 100644 (file)
@@ -57,8 +57,8 @@ MidiRingBuffer<T>::read(MidiBuffer& dst, framepos_t start, framepos_t end, frame
                */
                this->peek (peekbuf, prefix_size);
 
-               ev_time = *((T*) peekbuf);
-               ev_size = *((uint32_t*)(peekbuf + sizeof(T) + sizeof (Evoral::EventType)));
+               ev_time = *(reinterpret_cast<T*>((uintptr_t)peekbuf));
+               ev_size = *(reinterpret_cast<uint32_t*>((uintptr_t)(peekbuf + sizeof(T) + sizeof (Evoral::EventType))));
 
                if (ev_time >= end) {
                        DEBUG_TRACE (DEBUG::MidiDiskstreamIO, string_compose ("MRB event @ %1 past end @ %2\n", ev_time, end));
@@ -148,13 +148,13 @@ MidiRingBuffer<T>::flush (framepos_t /*start*/, framepos_t end)
                */
                assert (success);
 
-               ev_time = *((T*) peekbuf);
+               ev_time = *(reinterpret_cast<T*>((uintptr_t)peekbuf));
                
                if (ev_time >= end) {
                        break;
                }
 
-               ev_size = *((uint32_t*)(peekbuf + sizeof(T) + sizeof (Evoral::EventType)));
+               ev_size = *(reinterpret_cast<uint32_t*>((uintptr_t)(peekbuf + sizeof(T) + sizeof (Evoral::EventType))));
                this->increment_read_ptr (prefix_size);
                this->increment_read_ptr (ev_size);
        }
index f7f3bee9856baa809ce1abe86842847f8eb9af54..8dbd4fb68c48b48307e618cbeafd0d1817a5d7b1 100644 (file)
@@ -117,8 +117,8 @@ WavesAudioBackend::WavesAudioBackend (AudioEngine& e)
     , _sample_time_at_cycle_start (0)
     , _freewheeling (false)
     , _freewheel_thread_active (false)
-    , _audio_cycle_period_nanos (0)
     , _dsp_load_accumulator (0)
+    , _audio_cycle_period_nanos (0)
     , _dsp_load_history_length(0)
 {
 }