summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-23 20:25:53 +0000
committerDavid Robillard <d@drobilla.net>2010-02-23 20:25:53 +0000
commit650c6d5824222a8879df5c5ba9645c264ed3b84f (patch)
tree7cd5aace00cb23622f07727ae4f7963c03dd05c9 /libs/ardour/ardour
parent0c20d48e7d436725396baf362368f7ce61717151 (diff)
Fix various code quality issues found by cppcheck (e.g. uninitialized members, larger than necessary variable scope, memory leaks, etc).
git-svn-id: svn://localhost/ardour2/branches/3.0@6710 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/audio_library.h2
-rw-r--r--libs/ardour/ardour/audio_unit.h2
-rw-r--r--libs/ardour/ardour/control_protocol_manager.h6
-rw-r--r--libs/ardour/ardour/delivery.h1
-rw-r--r--libs/ardour/ardour/export_graph_builder.h2
-rw-r--r--libs/ardour/ardour/export_handler.h2
-rw-r--r--libs/ardour/ardour/lv2_plugin.h2
-rw-r--r--libs/ardour/ardour/plugin.h2
-rw-r--r--libs/ardour/ardour/rc_configuration.h1
-rw-r--r--libs/ardour/ardour/route_group.h6
-rw-r--r--libs/ardour/ardour/session.h2
-rw-r--r--libs/ardour/ardour/session_event.h23
-rw-r--r--libs/ardour/ardour/types.h17
-rw-r--r--libs/ardour/ardour/vst_plugin.h2
14 files changed, 35 insertions, 35 deletions
diff --git a/libs/ardour/ardour/audio_library.h b/libs/ardour/ardour/audio_library.h
index aada317dbd..2009ec39a7 100644
--- a/libs/ardour/ardour/audio_library.h
+++ b/libs/ardour/ardour/audio_library.h
@@ -35,7 +35,7 @@ class AudioLibrary
void set_tags (std::string member, std::vector<std::string> tags);
std::vector<std::string> get_tags (std::string member);
- void search_members_and (std::vector<std::string>& results, const std::vector<std::string> tags);
+ void search_members_and (std::vector<std::string>& results, const std::vector<std::string>& tags);
void save_changes();
diff --git a/libs/ardour/ardour/audio_unit.h b/libs/ardour/ardour/audio_unit.h
index 9fbc188562..6d2b2410fd 100644
--- a/libs/ardour/ardour/audio_unit.h
+++ b/libs/ardour/ardour/audio_unit.h
@@ -96,7 +96,7 @@ class AUPlugin : public ARDOUR::Plugin
int set_state(const XMLNode& node);
bool save_preset (std::string name);
- bool load_preset (const std::string preset_label);
+ bool load_preset (const std::string& preset_label);
std::vector<std::string> get_presets ();
std::string current_preset() const;
diff --git a/libs/ardour/ardour/control_protocol_manager.h b/libs/ardour/ardour/control_protocol_manager.h
index 6fedc95c6c..ad5bb3166e 100644
--- a/libs/ardour/ardour/control_protocol_manager.h
+++ b/libs/ardour/ardour/control_protocol_manager.h
@@ -45,8 +45,10 @@ struct ControlProtocolInfo {
bool supports_feedback;
XMLNode* state;
- ControlProtocolInfo() : descriptor (0), protocol (0), state (0) {}
- ~ControlProtocolInfo() { if (state) { delete state; } }
+ ControlProtocolInfo() : descriptor (0), protocol (0), requested(false),
+ mandatory(false), supports_feedback(false), state (0)
+ {}
+ ~ControlProtocolInfo() { delete state; }
};
class ControlProtocolManager : public PBD::Stateful, public ARDOUR::SessionHandlePtr
diff --git a/libs/ardour/ardour/delivery.h b/libs/ardour/ardour/delivery.h
index a7ccd96a2d..b2bd283ef8 100644
--- a/libs/ardour/ardour/delivery.h
+++ b/libs/ardour/ardour/delivery.h
@@ -59,6 +59,7 @@ public:
Delivery (Session& s, boost::shared_ptr<MuteMaster> mm, const std::string& name, Role);
Delivery (Session&, boost::shared_ptr<MuteMaster> mm, const XMLNode&);
+ ~Delivery ();
bool set_name (const std::string& name);
std::string display_name() const;
diff --git a/libs/ardour/ardour/export_graph_builder.h b/libs/ardour/ardour/export_graph_builder.h
index 2f57aaf583..f98ffeb8eb 100644
--- a/libs/ardour/ardour/export_graph_builder.h
+++ b/libs/ardour/ardour/export_graph_builder.h
@@ -98,7 +98,7 @@ class ExportGraphBuilder
class SFC {
public:
// This constructor so that this can be constructed like a Normalizer
- SFC (ExportGraphBuilder &) {}
+ SFC (ExportGraphBuilder &) : data_width(0) {}
FloatSinkPtr init (FileSpec const & new_config, nframes_t max_frames);
void add_child (FileSpec const & new_config);
bool operator== (FileSpec const & other_config) const;
diff --git a/libs/ardour/ardour/export_handler.h b/libs/ardour/ardour/export_handler.h
index 971c0c4940..05fbddecf5 100644
--- a/libs/ardour/ardour/export_handler.h
+++ b/libs/ardour/ardour/export_handler.h
@@ -140,7 +140,7 @@ class ExportHandler : public ExportElementFactory
struct CDMarkerStatus {
CDMarkerStatus (std::string out_file, TimespanPtr timespan, FormatPtr format, std::string filename) :
- out (out_file.c_str()), timespan (timespan), format (format), filename (filename),
+ out (out_file.c_str()), timespan (timespan), format (format), filename (filename), marker(0),
track_number (1), track_position (0), track_duration (0), track_start_frame (0),
index_number (1), index_position (0)
{}
diff --git a/libs/ardour/ardour/lv2_plugin.h b/libs/ardour/ardour/lv2_plugin.h
index 157d9144b8..d42c34a546 100644
--- a/libs/ardour/ardour/lv2_plugin.h
+++ b/libs/ardour/ardour/lv2_plugin.h
@@ -116,7 +116,7 @@ class LV2Plugin : public ARDOUR::Plugin
XMLNode& get_state();
int set_state(const XMLNode& node, int version);
bool save_preset(std::string uri);
- bool load_preset(const std::string uri);
+ bool load_preset(const std::string& uri);
virtual std::vector<Plugin::PresetRecord> get_presets();
bool has_editor() const;
diff --git a/libs/ardour/ardour/plugin.h b/libs/ardour/ardour/plugin.h
index 4770c43511..8731697906 100644
--- a/libs/ardour/ardour/plugin.h
+++ b/libs/ardour/ardour/plugin.h
@@ -127,7 +127,7 @@ class Plugin : public PBD::StatefulDestructible, public Latent
virtual bool parameter_is_output(uint32_t) const = 0;
virtual bool save_preset (std::string) = 0;
- virtual bool load_preset (const std::string uri);
+ virtual bool load_preset (const std::string& uri);
struct PresetRecord {
PresetRecord(const std::string& u, const std::string& l) : uri(u), label(l) {}
diff --git a/libs/ardour/ardour/rc_configuration.h b/libs/ardour/ardour/rc_configuration.h
index ad31aac44e..35b22106dd 100644
--- a/libs/ardour/ardour/rc_configuration.h
+++ b/libs/ardour/ardour/rc_configuration.h
@@ -35,6 +35,7 @@ class RCConfiguration : public Configuration
{
public:
RCConfiguration();
+ ~RCConfiguration();
void map_parameters (boost::function<void (std::string)>&);
int set_state (XMLNode const &, int version);
diff --git a/libs/ardour/ardour/route_group.h b/libs/ardour/ardour/route_group.h
index f3109a707d..7f3d25454a 100644
--- a/libs/ardour/ardour/route_group.h
+++ b/libs/ardour/ardour/route_group.h
@@ -93,19 +93,19 @@ class RouteGroup : public SessionObject
int remove (boost::shared_ptr<Route>);
void apply (void (Route::*func)(void *), void *src) {
- for (RouteList::iterator i = routes->begin(); i != routes->end(); i++) {
+ for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
((*i).get()->*func)(src);
}
}
template<class T> void apply (void (Route::*func)(T, void *), T val, void *src) {
- for (RouteList::iterator i = routes->begin(); i != routes->end(); i++) {
+ for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
((*i).get()->*func)(val, src);
}
}
template<class T> void foreach_route (T *obj, void (T::*func)(Route&)) {
- for (RouteList::iterator i = routes->begin(); i != routes->end(); i++) {
+ for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
(obj->*func)(**i);
}
}
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 9294d56fcc..02c5cc2391 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -411,7 +411,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
PBD::Signal0<void> route_group_removed;
void foreach_route_group (boost::function<void(RouteGroup*)> f) {
- for (std::list<RouteGroup *>::iterator i = _route_groups.begin(); i != _route_groups.end(); i++) {
+ for (std::list<RouteGroup *>::iterator i = _route_groups.begin(); i != _route_groups.end(); ++i) {
f (*i);
}
}
diff --git a/libs/ardour/ardour/session_event.h b/libs/ardour/ardour/session_event.h
index 2ce2d5225a..882142c68d 100644
--- a/libs/ardour/ardour/session_event.h
+++ b/libs/ardour/ardour/session_event.h
@@ -120,15 +120,16 @@ private:
};
class SessionEventManager {
- public:
- SessionEventManager () : pending_events (2048){}
- virtual ~SessionEventManager() {}
+public:
+ SessionEventManager () : pending_events (2048),
+ auto_loop_event(0), punch_out_event(0), punch_in_event(0) {}
+ virtual ~SessionEventManager() {}
- virtual void queue_event (SessionEvent *ev) = 0;
+ virtual void queue_event (SessionEvent *ev) = 0;
void clear_events (SessionEvent::Type type);
-
- protected:
- RingBuffer<SessionEvent*> pending_events;
+
+protected:
+ RingBuffer<SessionEvent*> pending_events;
typedef std::list<SessionEvent *> Events;
Events events;
Events immediate_events;
@@ -138,8 +139,8 @@ class SessionEventManager {
SessionEvent *auto_loop_event;
SessionEvent *punch_out_event;
- SessionEvent *punch_in_event;
-
+ SessionEvent *punch_in_event;
+
void dump_events () const;
void merge_event (SessionEvent*);
void replace_event (SessionEvent::Type, nframes64_t action_frame, nframes64_t target = 0);
@@ -150,8 +151,8 @@ class SessionEventManager {
void add_event (nframes64_t action_frame, SessionEvent::Type type, nframes64_t target_frame = 0);
void remove_event (nframes64_t frame, SessionEvent::Type type);
- virtual void process_event(SessionEvent*) = 0;
- virtual void set_next_event () = 0;
+ virtual void process_event(SessionEvent*) = 0;
+ virtual void set_next_event () = 0;
};
} /* namespace */
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index 4380662540..54c965ce67 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -438,19 +438,14 @@ namespace ARDOUR {
MeterPointChange = 0x1
};
- RouteProcessorChange () {
- type = GeneralChange;
- }
+ RouteProcessorChange () : type (GeneralChange), meter_visibly_changed (true)
+ {}
- RouteProcessorChange (Type t) {
- type = t;
- meter_visibly_changed = true;
- }
+ RouteProcessorChange (Type t) : type (t), meter_visibly_changed (true)
+ {}
- RouteProcessorChange (Type t, bool m) {
- type = t;
- meter_visibly_changed = m;
- }
+ RouteProcessorChange (Type t, bool m) : type (t), meter_visibly_changed (m)
+ {}
/** type of change; "GeneralChange" means anything could have changed */
Type type;
diff --git a/libs/ardour/ardour/vst_plugin.h b/libs/ardour/ardour/vst_plugin.h
index 753d94294f..513f24d493 100644
--- a/libs/ardour/ardour/vst_plugin.h
+++ b/libs/ardour/ardour/vst_plugin.h
@@ -79,7 +79,7 @@ class VSTPlugin : public ARDOUR::Plugin
bool parameter_is_input(uint32_t i) const { return true; }
bool parameter_is_output(uint32_t i) const { return false; }
- bool load_preset (const std::string preset_label );
+ bool load_preset (const std::string& preset_label);
bool save_preset (std::string name);
bool has_editor () const;