From 730e09ce65860d951d0edd9b5471278125915f0a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 23 Oct 2014 05:11:10 +0200 Subject: another round of compiler warning fixes --- gtk2_ardour/ardour_ui.cc | 2 +- gtk2_ardour/video_monitor.cc | 2 +- libs/ardour/ardour/midi_buffer.h | 2 +- libs/ardour/audiofilesource.cc | 5 ++++- libs/ardour/lv2_evbuf.c | 18 +++++++++--------- libs/ardour/midi_port.cc | 2 +- libs/backends/wavesaudio/waves_midi_device_manager.cc | 2 +- libs/plugins/reasonablesynth.lv2/lv2.c | 4 ++-- 8 files changed, 20 insertions(+), 17 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 3b385ef292..133e991a06 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -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; } diff --git a/gtk2_ardour/video_monitor.cc b/gtk2_ardour/video_monitor.cc index f15013f57e..be412f6725 100644 --- a/gtk2_ardour/video_monitor.cc +++ b/gtk2_ardour/video_monitor.cc @@ -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 () { diff --git a/libs/ardour/ardour/midi_buffer.h b/libs/ardour/ardour/midi_buffer.h index 6571924bef..f0c76ca86c 100644 --- a/libs/ardour/ardour/midi_buffer.h +++ b/libs/ardour/ardour/midi_buffer.h @@ -92,7 +92,7 @@ public: } inline TimeType * timeptr() { - return ((TimeType*)(buffer->_data + offset)); + return reinterpret_cast((uintptr_t)(buffer->_data + offset)); } inline iterator_base& operator++() { diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc index 9c1b969190..40c3d2f012 100644 --- a/libs/ardour/audiofilesource.cc +++ b/libs/ardour/audiofilesource.cc @@ -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 diff --git a/libs/ardour/lv2_evbuf.c b/libs/ardour/lv2_evbuf.c index 2802ab8c81..ae6d869b5f 100644 --- a/libs/ardour/lv2_evbuf.c +++ b/libs/ardour/lv2_evbuf.c @@ -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; diff --git a/libs/ardour/midi_port.cc b/libs/ardour/midi_port.cc index 381441a8d6..82dabc4cba 100644 --- a/libs/ardour/midi_port.cc +++ b/libs/ardour/midi_port.cc @@ -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; diff --git a/libs/backends/wavesaudio/waves_midi_device_manager.cc b/libs/backends/wavesaudio/waves_midi_device_manager.cc index ff3404ba72..dc57b0ddc2 100644 --- a/libs/backends/wavesaudio/waves_midi_device_manager.cc +++ b/libs/backends/wavesaudio/waves_midi_device_manager.cc @@ -25,7 +25,7 @@ #include "windows.h" #include "mmsystem.h" -#else if defined(__APPLE__) +#elif defined(__APPLE__) #include diff --git a/libs/plugins/reasonablesynth.lv2/lv2.c b/libs/plugins/reasonablesynth.lv2/lv2.c index 87f930b3c4..4698cb9131 100644 --- a/libs/plugins/reasonablesynth.lv2/lv2.c +++ b/libs/plugins/reasonablesynth.lv2/lv2.c @@ -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))); } } -- cgit v1.2.3