From ba3e966984bc8864bccb247daa9d78d5165e13bf Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 8 Jan 2011 16:05:32 +0000 Subject: Code clean-up (cpplint). git-svn-id: http://svn.drobilla.net/lad/trunk/raul@2796 a436a847-0d15-0410-975c-d299462d15a1 --- src/Configuration.cpp | 6 +++++- src/Path.cpp | 4 +++- src/SMFReader.cpp | 17 ++++++++++------- src/SMFWriter.cpp | 29 +++++++++++++++++------------ src/Symbol.cpp | 4 +++- src/Thread.cpp | 4 +++- src/log.cpp | 2 ++ 7 files changed, 43 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/Configuration.cpp b/src/Configuration.cpp index 624274f..a471441 100644 --- a/src/Configuration.cpp +++ b/src/Configuration.cpp @@ -15,9 +15,13 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include +#include + #include "raul/Configuration.hpp" -using namespace std; +using std::endl; +using std::string; namespace Raul { diff --git a/src/Path.cpp b/src/Path.cpp index de17cdf..9f1bcb7 100644 --- a/src/Path.cpp +++ b/src/Path.cpp @@ -15,9 +15,11 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "raul/Path.hpp" -using namespace std; +using std::string; namespace Raul { diff --git a/src/SMFReader.cpp b/src/SMFReader.cpp index 6fda04a..5a20470 100644 --- a/src/SMFReader.cpp +++ b/src/SMFReader.cpp @@ -15,15 +15,18 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include #include #include -#include +#include + #include "raul/log.hpp" #include "raul/SMFReader.hpp" #include "raul/midi_events.h" -using namespace std; +using std::endl; namespace Raul { @@ -90,10 +93,10 @@ SMFReader::~SMFReader() bool -SMFReader::open(const std::string& filename) throw (logic_error, UnsupportedTime) +SMFReader::open(const std::string& filename) throw (std::logic_error, UnsupportedTime) { if (_fd) - throw logic_error("Attempt to start new read while write in progress."); + throw std::logic_error("Attempt to start new read while write in progress."); info << "Opening SMF file " << filename << " for reading." << endl; @@ -148,10 +151,10 @@ bool SMFReader::seek_to_track(unsigned track) throw (std::logic_error) { if (track == 0) - throw logic_error("Seek to track 0 out of range (must be >= 1)"); + throw std::logic_error("Seek to track 0 out of range (must be >= 1)"); if (!_fd) - throw logic_error("Attempt to seek to track on unopened SMF file."); + throw std::logic_error("Attempt to seek to track on unopened SMF file."); unsigned track_pos = 0; @@ -210,7 +213,7 @@ SMFReader::read_event(size_t buf_len, throw (std::logic_error, PrematureEOF, CorruptFile) { if (_track == 0) - throw logic_error("Attempt to read from unopened SMF file"); + throw std::logic_error("Attempt to read from unopened SMF file"); if (!_fd || feof(_fd)) { return -1; diff --git a/src/SMFWriter.cpp b/src/SMFWriter.cpp index ebb1380..0c343b6 100644 --- a/src/SMFWriter.cpp +++ b/src/SMFWriter.cpp @@ -14,16 +14,21 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include + +#include #include +#include + #include -#include #include -#include +#include +#include +#include + #include "raul/log.hpp" #include "raul/SMFWriter.hpp" -using namespace std; +using std::endl; namespace Raul { @@ -63,10 +68,10 @@ SMFWriter::~SMFWriter() */ bool SMFWriter::start(const std::string& filename, - Raul::TimeStamp start_time) throw (logic_error) + Raul::TimeStamp start_time) throw (std::logic_error) { if (_fd) - throw logic_error("Attempt to start new write while write in progress."); + throw std::logic_error("Attempt to start new write while write in progress."); info << "Opening SMF file " << filename << " for writing." << endl; @@ -94,14 +99,14 @@ SMFWriter::start(const std::string& filename, void SMFWriter::write_event(Raul::TimeStamp time, size_t ev_size, - const unsigned char* ev) throw (logic_error) + const unsigned char* ev) throw (std::logic_error) { if (time < _start_time) - throw logic_error("Event time is before file start time"); + throw std::logic_error("Event time is before file start time"); else if (time < _last_ev_time) - throw logic_error("Event time not monotonically increasing"); + throw std::logic_error("Event time not monotonically increasing"); else if (time.unit() != _unit) - throw logic_error("Event has unexpected time unit"); + throw std::logic_error("Event has unexpected time unit"); Raul::TimeStamp delta_time = time; delta_time -= _start_time; @@ -141,10 +146,10 @@ SMFWriter::flush() void -SMFWriter::finish() throw (logic_error) +SMFWriter::finish() throw (std::logic_error) { if (!_fd) - throw logic_error("Attempt to finish write with no write in progress."); + throw std::logic_error("Attempt to finish write with no write in progress."); write_footer(); fclose(_fd); diff --git a/src/Symbol.cpp b/src/Symbol.cpp index fb6bf7f..2005074 100644 --- a/src/Symbol.cpp +++ b/src/Symbol.cpp @@ -15,10 +15,12 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "raul/Symbol.hpp" #include "raul/Path.hpp" -using namespace std; +using std::string; namespace Raul { diff --git a/src/Thread.cpp b/src/Thread.cpp index 35cb569..d45f363 100644 --- a/src/Thread.cpp +++ b/src/Thread.cpp @@ -16,12 +16,14 @@ */ #include +#include + #include "raul/log.hpp" #include "raul/Thread.hpp" #define LOG(s) s << "[" << _name << "] " -using namespace std; +using std::endl; namespace Raul { diff --git a/src/log.cpp b/src/log.cpp index 01620ee..201f8f1 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -15,6 +15,8 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "raul/log.hpp" #include "raul-config.h" -- cgit v1.2.1