another round of compiler warning fixes
authorRobin Gareus <robin@gareus.org>
Thu, 23 Oct 2014 03:11:10 +0000 (05:11 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 23 Oct 2014 03:31:40 +0000 (05:31 +0200)
gtk2_ardour/ardour_ui.cc
gtk2_ardour/video_monitor.cc
libs/ardour/ardour/midi_buffer.h
libs/ardour/audiofilesource.cc
libs/ardour/lv2_evbuf.c
libs/ardour/midi_port.cc
libs/backends/wavesaudio/waves_midi_device_manager.cc
libs/plugins/reasonablesynth.lv2/lv2.c

index 3b385ef292e8b3d2aadbaf283ba9ffba28a5f567..133e991a06cb29a23aac14968a4a74ccaf60781c 100644 (file)
@@ -3596,7 +3596,7 @@ ARDOUR_UI::start_video_server (Gtk::Window* float_window, bool popup_msg)
                if (icsd_docroot.empty()) {icsd_docroot = X_("/");}
 
                GStatBuf sb;
-               if (!g_lstat (icsd_docroot.c_str(), &sb) == 0 || !S_ISDIR(sb.st_mode)) {
+               if (g_lstat (icsd_docroot.c_str(), &sb) != 0 || !S_ISDIR(sb.st_mode)) {
                        warning << _("Specified docroot is not an existing directory.") << endmsg;
                        continue;
                }
index f15013f57eed2957d94d15bbcdaa7894b21ca17d..be412f6725d33e18dd691c472209f26daa778e79 100644 (file)
@@ -468,7 +468,7 @@ VideoMonitor::get_custom_setting (const std::string k)
        return (xjadeo_settings[k]);
 }
 
-#define NO_OFFSET (1<<63) //< skip setting or modifying offset
+#define NO_OFFSET (ARDOUR::max_framepos) //< skip setting or modifying offset
 void
 VideoMonitor::srsupdate ()
 {
index 6571924bef77d966386bd2abf0ee367cd6a8414f..f0c76ca86c96e527c3ebdabc1e62a4393e5d7a08 100644 (file)
@@ -92,7 +92,7 @@ public:
                }
 
                inline TimeType * timeptr() {
-                       return ((TimeType*)(buffer->_data + offset));
+                       return reinterpret_cast<TimeType*>((uintptr_t)(buffer->_data + offset));
                }
 
                inline iterator_base<BufferType, EventType>& operator++() {
index 9c1b969190c530d8cb2ec95b066b1b02b0c349a1..40c3d2f012757c43371a7a0c0433614fbd8ec45a 100644 (file)
@@ -237,7 +237,10 @@ AudioFileSource::old_peak_path (string audio_path)
 
        char buf[32];
 #ifdef __APPLE__
-       snprintf (buf, sizeof (buf), "%u-%u-%d.peak", stat_mount.st_ino, stat_file.st_ino, _channel);
+       snprintf (buf, sizeof (buf), "%llu-%llu-%d.peak",
+                       (unsigned long long)stat_mount.st_ino,
+                       (unsigned long long)stat_file.st_ino,
+                       _channel);
 #else
        snprintf (buf, sizeof (buf), "%" PRId64 "-%" PRId64 "-%d.peak", (int64_t) stat_mount.st_ino, (int64_t) stat_file.st_ino, _channel);
 #endif
index 2802ab8c816fd14e9274b1b2cc585a7b13da7e8f..ae6d869b5fac0a87726d453086cbb66b5b56cced 100644 (file)
@@ -166,13 +166,13 @@ lv2_evbuf_next(LV2_Evbuf_Iterator iter)
        uint32_t   size;
        switch (evbuf->type) {
        case LV2_EVBUF_EVENT:
-               size    = ((LV2_Event*)(evbuf->buf.event.data + offset))->size;
+               size    = ((LV2_Event*)((uintptr_t)(evbuf->buf.event.data + offset)))->size;
                offset += lv2_evbuf_pad_size(sizeof(LV2_Event) + size);
                break;
        case LV2_EVBUF_ATOM:
-               size = ((LV2_Atom_Event*)
+               size = ((LV2_Atom_Event*)((uintptr_t)
                        ((char*)LV2_ATOM_CONTENTS(LV2_Atom_Sequence, &evbuf->buf.atom)
-                        + offset))->body.size;
+                        + offset)))->body.size;
                offset += lv2_evbuf_pad_size(sizeof(LV2_Atom_Event) + size);
                break;
        }
@@ -203,7 +203,7 @@ lv2_evbuf_get(LV2_Evbuf_Iterator iter,
        switch (iter.evbuf->type) {
        case LV2_EVBUF_EVENT:
                ebuf = &iter.evbuf->buf.event;
-               ev = (LV2_Event*)((char*)ebuf->data + iter.offset);
+               ev = (LV2_Event*)((uintptr_t)((char*)ebuf->data + iter.offset));
                *frames    = ev->frames;
                *subframes = ev->subframes;
                *type      = ev->type;
@@ -212,9 +212,9 @@ lv2_evbuf_get(LV2_Evbuf_Iterator iter,
                break;
        case LV2_EVBUF_ATOM:
                aseq = (LV2_Atom_Sequence*)&iter.evbuf->buf.atom;
-               aev = (LV2_Atom_Event*)(
+               aev = (LV2_Atom_Event*)((uintptr_t)(
                        (char*)LV2_ATOM_CONTENTS(LV2_Atom_Sequence, aseq)
-                       + iter.offset);
+                       + iter.offset));
                *frames    = aev->time.frames;
                *subframes = 0;
                *type      = aev->body.type;
@@ -245,7 +245,7 @@ lv2_evbuf_write(LV2_Evbuf_Iterator* iter,
                        return false;
                }
 
-               ev = (LV2_Event*)(ebuf->data + iter->offset);
+               ev = (LV2_Event*)((uintptr_t)(ebuf->data + iter->offset));
                ev->frames    = frames;
                ev->subframes = subframes;
                ev->type      = type;
@@ -264,9 +264,9 @@ lv2_evbuf_write(LV2_Evbuf_Iterator* iter,
                        return false;
                }
 
-               aev = (LV2_Atom_Event*)(
+               aev = (LV2_Atom_Event*)((uintptr_t)(
                        (char*)LV2_ATOM_CONTENTS(LV2_Atom_Sequence, aseq)
-                       + iter->offset);
+                       + iter->offset));
                aev->time.frames = frames;
                aev->body.type   = type;
                aev->body.size   = size;
index 381441a8d6fdbc8941fba1867e1605619d63d350..82dabc4cba57319bc021482fd1141dae24d1d9db 100644 (file)
@@ -208,7 +208,7 @@ MidiPort::flush_buffers (pframes_t nframes)
                                cerr << "drop flushed event on the floor, time " << ev.time()
                                     << " too early for " << _global_port_buffer_offset
                                     << " + " << _port_buffer_offset;
-                               for (int xx = 0; xx < ev.size(); ++xx) {
+                               for (size_t xx = 0; xx < ev.size(); ++xx) {
                                        cerr << ' ' << hex << (int) ev.buffer()[xx];
                                }
                                cerr << dec << endl;
index ff3404ba72d7b85842c501fe37024405094e5ccc..dc57b0ddc2b94dc9e3d14f2569b42d0b3badd4ce 100644 (file)
@@ -25,7 +25,7 @@
 #include "windows.h"
 #include "mmsystem.h"
 
-#else if defined(__APPLE__)
+#elif defined(__APPLE__)
 
 #include <CoreMIDI/MIDIServices.h>
 
index 87f930b3c4890d99df915de79326685d94148b2b..4698cb9131c795352289004d5be0fb1ac8afeba8 100644 (file)
@@ -147,7 +147,7 @@ run(LV2_Handle handle, uint32_t n_samples)
 
   /* Process incoming MIDI events */
   if (self->midiin) {
-    LV2_Atom_Event const* ev = (LV2_Atom_Event const*)((&(self->midiin)->body) + 1); // lv2_atom_sequence_begin
+    LV2_Atom_Event const* ev = (LV2_Atom_Event const*)((uintptr_t)((&(self->midiin)->body) + 1)); // lv2_atom_sequence_begin
     while( // !lv2_atom_sequence_is_end
         (const uint8_t*)ev < ((const uint8_t*) &(self->midiin)->body + (self->midiin)->atom.size)
         )
@@ -166,7 +166,7 @@ run(LV2_Handle handle, uint32_t n_samples)
         }
       }
       ev = (LV2_Atom_Event const*) // lv2_atom_sequence_next()
-        ((const uint8_t*)ev + sizeof(LV2_Atom_Event) + ((ev->body.size + 7) & ~7));
+             ((uintptr_t)((const uint8_t*)ev + sizeof(LV2_Atom_Event) + ((ev->body.size + 7) & ~7)));
     }
   }