summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-01-08 16:05:32 +0000
committerDavid Robillard <d@drobilla.net>2011-01-08 16:05:32 +0000
commitba3e966984bc8864bccb247daa9d78d5165e13bf (patch)
treef1d4a10a2989772298f6e57ddfdb847b259f54af /src
parenta6a719577de47ad695b568b7bc451b9475104a28 (diff)
downloadraul-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')
-rw-r--r--src/Configuration.cpp6
-rw-r--r--src/Path.cpp4
-rw-r--r--src/SMFReader.cpp17
-rw-r--r--src/SMFWriter.cpp29
-rw-r--r--src/Symbol.cpp4
-rw-r--r--src/Thread.cpp4
-rw-r--r--src/log.cpp2
7 files changed, 43 insertions, 23 deletions
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 <algorithm>
+#include <string>
+
#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 <string>
+
#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 <glib.h>
+
#include <cstdio>
#include <cassert>
#include <cstring>
-#include <glib.h>
+#include <string>
+
#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 <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);
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 <string>
+
#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 <cstring>
+#include <string>
+
#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 <string>
+
#include "raul/log.hpp"
#include "raul-config.h"