Skip to content

Commit

Permalink
Fix clang-tidy error in SoundFile
Browse files Browse the repository at this point in the history
  • Loading branch information
jhasse committed Nov 29, 2023
1 parent 710ea5b commit e704b34
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/jngl/SoundFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

#include "SoundFile.hpp"

#include "../Sound.hpp"
#include "../audio.hpp"
#include "../audio/effect/pitch.hpp"
#include "../audio/effect/volume.hpp"
#include "../audio/engine.hpp"
#include "../audio/mixer.hpp"
#include "../Sound.hpp"
#include "../audio.hpp"
#include "../main.hpp"
#include "debug.hpp"

Expand Down Expand Up @@ -80,7 +80,7 @@ class Audio {
audio::engine engine;
};

SoundFile::SoundFile(std::string filename, std::launch) {
SoundFile::SoundFile(const std::string& filename, std::launch) {
debug("Decoding ");
debug(filename);
debug(" ... ");
Expand Down Expand Up @@ -135,7 +135,7 @@ SoundFile::SoundFile(std::string filename, std::launch) {
}

SoundFile::~SoundFile() = default;
SoundFile::SoundFile(SoundFile&& other) noexcept : frequency(-1) {
SoundFile::SoundFile(SoundFile&& other) noexcept {
other.load();
*this = std::move(other);
}
Expand Down
4 changes: 2 additions & 2 deletions src/jngl/SoundFile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SoundFile {
/// \note
/// If the file doesn't exist this will not throw, but calling SoundFile::play, SoundFile::loop
/// or SoundFile::load will.
explicit SoundFile(std::string filename, std::launch policy = std::launch::async);
explicit SoundFile(const std::string& filename, std::launch policy = std::launch::async);
~SoundFile();
SoundFile(const SoundFile&) = delete;
SoundFile& operator=(const SoundFile&) = delete;
Expand Down Expand Up @@ -65,7 +65,7 @@ class SoundFile {
private:
std::shared_ptr<Sound> sound_;
std::vector<float> buffer_;
long frequency;
long frequency = -1;
};

} // namespace jngl

0 comments on commit e704b34

Please sign in to comment.