summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-08-10 15:57:09 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-08-10 15:57:09 +0000
commit760ccbabfbec67d80c3bdac9c0803ecf7d1742b6 (patch)
treea8cbb70fbf1d1aab7eb24310d70be94dee292453 /libs/ardour
parent69ca705286383df96b337cc93428f95bd7623345 (diff)
add -Wpointer-arith -Wcast-qual -Wcast-align and others to compile flags, and fix const cast warnings generated by new flags
git-svn-id: svn://localhost/ardour2/branches/3.0@13124 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/audio_library.cc6
-rw-r--r--libs/ardour/midi_source.cc3
-rw-r--r--libs/ardour/plugin_manager.cc4
-rw-r--r--libs/ardour/route.cc2
-rw-r--r--libs/ardour/smf_source.cc2
-rw-r--r--libs/ardour/sndfilesource.cc2
6 files changed, 10 insertions, 9 deletions
diff --git a/libs/ardour/audio_library.cc b/libs/ardour/audio_library.cc
index 65e8243e52..c2b2f1bff7 100644
--- a/libs/ardour/audio_library.cc
+++ b/libs/ardour/audio_library.cc
@@ -94,7 +94,7 @@ AudioLibrary::get_tags (string member)
lrdf_statement pattern;
pattern.subject = strdup(Glib::filename_to_uri(member).c_str());
- pattern.predicate = (char*)TAG;
+ pattern.predicate = const_cast<char*>(TAG);
pattern.object = 0;
pattern.object_type = lrdf_literal;
@@ -126,8 +126,8 @@ AudioLibrary::search_members_and (vector<string>& members, const vector<string>&
vector<string>::const_iterator i;
for (i = tags.begin(); i != tags.end(); ++i){
pattern = new lrdf_statement;
- pattern->subject = (char*)"?";
- pattern->predicate = (char*)TAG;
+ pattern->subject = const_cast<char*>("?");
+ pattern->predicate = const_cast<char*>(TAG);
pattern->object = strdup((*i).c_str());
pattern->next = old;
diff --git a/libs/ardour/midi_source.cc b/libs/ardour/midi_source.cc
index 92795db4ae..ff3ff55ced 100644
--- a/libs/ardour/midi_source.cc
+++ b/libs/ardour/midi_source.cc
@@ -232,7 +232,8 @@ MidiSource::midi_read (Evoral::EventSink<framepos_t>& dst, framepos_t source_sta
_name, time_frames + source_start, i->event_type(), i->size()));
if (tracker) {
- Evoral::MIDIEvent<Evoral::MusicalTime>& ev (*(Evoral::MIDIEvent<Evoral::MusicalTime>*) (&(*i)));
+ Evoral::MIDIEvent<Evoral::MusicalTime>& ev (*(reinterpret_cast<Evoral::MIDIEvent<Evoral::MusicalTime>*>
+ (const_cast<Evoral::Event<Evoral::MusicalTime>*> (&(*i)))));
if (ev.is_note_on()) {
DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("\t%1 track note on %2 @ %3 velocity %4\n", _name, (int) ev.note(), time_frames, (int) ev.velocity()));
tracker->add (ev.note(), ev.channel());
diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc
index a4be2096de..a749038d7e 100644
--- a/libs/ardour/plugin_manager.cc
+++ b/libs/ardour/plugin_manager.cc
@@ -452,7 +452,7 @@ PluginManager::get_ladspa_category (uint32_t plugin_id)
snprintf(buf, sizeof(buf), "%s%" PRIu32, LADSPA_BASE, plugin_id);
pattern.subject = buf;
- pattern.predicate = (char*)RDF_TYPE;
+ pattern.predicate = const_cast<char*>(RDF_TYPE);
pattern.object = 0;
pattern.object_type = lrdf_uri;
@@ -463,7 +463,7 @@ PluginManager::get_ladspa_category (uint32_t plugin_id)
}
pattern.subject = matches1->object;
- pattern.predicate = (char*)(LADSPA_BASE "hasLabel");
+ pattern.predicate = const_cast<char*>(LADSPA_BASE "hasLabel");
pattern.object = 0;
pattern.object_type = lrdf_literal;
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index a540e0aa93..94530e3890 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -2313,7 +2313,7 @@ Route::set_state_2X (const XMLNode& node, int version)
} else if (keyname == "editor") {
sk = EditorSort;
} else {
- RouteSortOrderKey sk = (RouteSortOrderKey) string_2_enum (remaining.substr (0, equal), sk);
+ sk = (RouteSortOrderKey) string_2_enum (remaining.substr (0, equal), sk);
}
set_order_key (sk, n);
diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc
index 47c653a698..e0462efb08 100644
--- a/libs/ardour/smf_source.cc
+++ b/libs/ardour/smf_source.cc
@@ -361,7 +361,7 @@ SMFSource::append_event_unlocked_frames (const Evoral::Event<framepos_t>& ev, fr
const Evoral::Event<double> beat_ev (ev.event_type(),
ev_time_beats,
ev.size(),
- (uint8_t*)ev.buffer());
+ const_cast<uint8_t*>(ev.buffer()));
_model->append (beat_ev, event_id);
}
diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc
index 0ec318a0ac..ca2544054c 100644
--- a/libs/ardour/sndfilesource.cc
+++ b/libs/ardour/sndfilesource.cc
@@ -858,7 +858,7 @@ SndFileSource::get_soundfile_info (const string& path, SoundFileInfo& info, stri
sf_info.format = 0; // libsndfile says to clear this before sf_open().
- if ((sf = sf_open ((char*) path.c_str(), SFM_READ, &sf_info)) == 0) {
+ if ((sf = sf_open (const_cast<char*>(path.c_str()), SFM_READ, &sf_info)) == 0) {
char errbuf[256];
error_msg = sf_error_str (0, errbuf, sizeof (errbuf) - 1);
return false;