diff options
author | David Robillard <d@drobilla.net> | 2011-01-08 16:05:32 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-01-08 16:05:32 +0000 |
commit | ba3e966984bc8864bccb247daa9d78d5165e13bf (patch) | |
tree | f1d4a10a2989772298f6e57ddfdb847b259f54af /src/SMFWriter.cpp | |
parent | a6a719577de47ad695b568b7bc451b9475104a28 (diff) | |
download | raul-ba3e966984bc8864bccb247daa9d78d5165e13bf.tar.gz raul-ba3e966984bc8864bccb247daa9d78d5165e13bf.tar.bz2 raul-ba3e966984bc8864bccb247daa9d78d5165e13bf.zip |
Code clean-up (cpplint).
git-svn-id: http://svn.drobilla.net/lad/trunk/raul@2796 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/SMFWriter.cpp')
-rw-r--r-- | src/SMFWriter.cpp | 29 |
1 files changed, 17 insertions, 12 deletions
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 <stdio.h> + +#include <glib.h> #include <stdint.h> +#include <stdio.h> + #include <cassert> -#include <cstring> #include <cstdio> -#include <glib.h> +#include <cstring> +#include <limits> +#include <string> + #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); |