diff options
author | David Robillard <d@drobilla.net> | 2018-09-15 13:25:23 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-09-15 13:25:23 +0200 |
commit | 407d81be137d9d9c9fba8815dcfde92c1600298f (patch) | |
tree | 4041560a856ba072a061349e1567a9e57104cc0c /src | |
parent | 4edc39189e6f2aa21f7b606d3edde77786b3c9a4 (diff) | |
download | machina-407d81be137d9d9c9fba8815dcfde92c1600298f.tar.gz machina-407d81be137d9d9c9fba8815dcfde92c1600298f.tar.bz2 machina-407d81be137d9d9c9fba8815dcfde92c1600298f.zip |
Fix GCC8 warnings
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/JackDriver.cpp | 2 | ||||
-rw-r--r-- | src/engine/SMFDriver.hpp | 2 | ||||
-rw-r--r-- | src/engine/SMFReader.cpp | 6 | ||||
-rw-r--r-- | src/engine/SMFReader.hpp | 10 | ||||
-rw-r--r-- | src/engine/SMFWriter.cpp | 8 | ||||
-rw-r--r-- | src/engine/SMFWriter.hpp | 6 |
6 files changed, 15 insertions, 19 deletions
diff --git a/src/engine/JackDriver.cpp b/src/engine/JackDriver.cpp index 9d9eac8..e7f2e97 100644 --- a/src/engine/JackDriver.cpp +++ b/src/engine/JackDriver.cpp @@ -406,7 +406,7 @@ JackDriver::set_play_state(PlayState state) case PlayState::RECORDING: case PlayState::STEP_RECORDING: finish_record(); - // nobreak + // fallthru case PlayState::PLAYING: _stop_flag = true; _stop.wait(); diff --git a/src/engine/SMFDriver.hpp b/src/engine/SMFDriver.hpp index d22ba53..e8b9a4b 100644 --- a/src/engine/SMFDriver.hpp +++ b/src/engine/SMFDriver.hpp @@ -47,7 +47,7 @@ public: void write_event(Raul::TimeStamp time, size_t ev_size, - const unsigned char* ev) throw (std::logic_error) + const unsigned char* ev) { _writer->write_event(time, ev_size, ev); } SPtr<SMFWriter> writer() { return _writer; } diff --git a/src/engine/SMFReader.cpp b/src/engine/SMFReader.cpp index d71dca4..5976f75 100644 --- a/src/engine/SMFReader.cpp +++ b/src/engine/SMFReader.cpp @@ -89,7 +89,6 @@ SMFReader::~SMFReader() bool SMFReader::open(const std::string& filename) - throw (std::logic_error, UnsupportedTime) { if (_fd) { throw std::logic_error( @@ -146,7 +145,7 @@ SMFReader::open(const std::string& filename) * Returns true if specified track was found. */ bool -SMFReader::seek_to_track(unsigned track) throw (std::logic_error) +SMFReader::seek_to_track(unsigned track) { if (track == 0) { throw std::logic_error("Seek to track 0 out of range (must be >= 1)"); @@ -210,7 +209,6 @@ SMFReader::read_event(size_t buf_len, uint8_t* buf, uint32_t* ev_size, uint32_t* delta_time) - throw (std::logic_error, PrematureEOF, CorruptFile) { if (_track == 0) { throw std::logic_error("Attempt to read from unopened SMF file"); @@ -300,7 +298,7 @@ SMFReader::close() } uint32_t -SMFReader::read_var_len(FILE* fd) throw (PrematureEOF) +SMFReader::read_var_len(FILE* fd) { if (feof(fd)) { throw PrematureEOF(); diff --git a/src/engine/SMFReader.hpp b/src/engine/SMFReader.hpp index d13599e..7147f38 100644 --- a/src/engine/SMFReader.hpp +++ b/src/engine/SMFReader.hpp @@ -52,10 +52,9 @@ public: explicit SMFReader(const std::string filename = ""); ~SMFReader(); - bool open(const std::string& filename) throw (std::logic_error, - UnsupportedTime); + bool open(const std::string& filename); - bool seek_to_track(unsigned track) throw (std::logic_error); + bool seek_to_track(unsigned track); uint16_t type() const { return _type; } uint16_t ppqn() const { return _ppqn; } @@ -64,12 +63,11 @@ public: int read_event(size_t buf_len, uint8_t* buf, uint32_t* ev_size, - uint32_t* ev_delta_time) - throw (std::logic_error, PrematureEOF, CorruptFile); + uint32_t* ev_delta_time); void close(); - static uint32_t read_var_len(FILE* fd) throw (PrematureEOF); + static uint32_t read_var_len(FILE* fd); protected: /** size of SMF header, including MTrk chunk header */ diff --git a/src/engine/SMFWriter.cpp b/src/engine/SMFWriter.cpp index d3f79b6..25d25c9 100644 --- a/src/engine/SMFWriter.cpp +++ b/src/engine/SMFWriter.cpp @@ -65,7 +65,7 @@ SMFWriter::~SMFWriter() */ bool SMFWriter::start(const std::string& filename, - Raul::TimeStamp start_time) throw (std::logic_error) + Raul::TimeStamp start_time) { if (_fd) { throw std::logic_error( @@ -85,7 +85,7 @@ SMFWriter::start(const std::string& filename, write_header(); } - return (_fd == 0) ? -1 : 0; + return (_fd == 0) ? false : true; } /** Write an event at the end of the file. @@ -97,7 +97,7 @@ SMFWriter::start(const std::string& filename, void SMFWriter::write_event(Raul::TimeStamp time, size_t ev_size, - const unsigned char* ev) throw (std::logic_error) + const unsigned char* ev) { if (time < _start_time) { throw std::logic_error("Event time is before file start time"); @@ -145,7 +145,7 @@ SMFWriter::flush() } void -SMFWriter::finish() throw (std::logic_error) +SMFWriter::finish() { if (!_fd) { throw std::logic_error( diff --git a/src/engine/SMFWriter.hpp b/src/engine/SMFWriter.hpp index 93b0611..18bf3ec 100644 --- a/src/engine/SMFWriter.hpp +++ b/src/engine/SMFWriter.hpp @@ -37,17 +37,17 @@ public: ~SMFWriter(); bool start(const std::string& filename, - Raul::TimeStamp start_time) throw (std::logic_error); + Raul::TimeStamp start_time); Raul::TimeUnit unit() const { return _unit; } void write_event(Raul::TimeStamp time, size_t ev_size, - const unsigned char* ev) throw (std::logic_error); + const unsigned char* ev); void flush(); - void finish() throw (std::logic_error); + void finish(); protected: static const uint32_t VAR_LEN_MAX = 0x0FFFFFFF; |