another round of compiler warning fixes

This commit is contained in:
Robin Gareus 2014-10-23 05:11:10 +02:00
parent ca48fffd72
commit 730e09ce65
8 changed files with 20 additions and 17 deletions

View 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;
}

View 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 ()
{

View 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++() {

View 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

View 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;

View 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;

View File

@ -25,7 +25,7 @@
#include "windows.h"
#include "mmsystem.h"
#else if defined(__APPLE__)
#elif defined(__APPLE__)
#include <CoreMIDI/MIDIServices.h>

View 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)));
}
}