diff options
author | kleines Filmröllchen <malu.bertsch@gmail.com> | 2021-11-15 22:27:28 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-11-15 23:00:11 +0000 |
commit | 8af97d0ce740b83a261660a69fc3ce7a6e23221c (patch) | |
tree | ffe14bccb0076b3d2e2f8212c269647024d543b1 /Userland/Libraries/LibAudio/FlacLoader.h | |
parent | a757f3f421df252937295ba8f453551682de0bed (diff) | |
download | serenity-8af97d0ce740b83a261660a69fc3ce7a6e23221c.zip |
Audio: Fix code smells and issues found by static analysis
This fixes all current code smells, bugs and issues reported by
SonarCloud static analysis. Other issues are almost exclusively false
positives. This makes much code clearer, and some minor benefits in
performance or bug evasion may be gained.
Diffstat (limited to 'Userland/Libraries/LibAudio/FlacLoader.h')
-rw-r--r-- | Userland/Libraries/LibAudio/FlacLoader.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibAudio/FlacLoader.h b/Userland/Libraries/LibAudio/FlacLoader.h index 9464204d8a..dd7da0e423 100644 --- a/Userland/Libraries/LibAudio/FlacLoader.h +++ b/Userland/Libraries/LibAudio/FlacLoader.h @@ -69,8 +69,8 @@ ALWAYS_INLINE i32 decode_unsigned_exp_golomb(u8 order, InputBitStream& bit_input class FlacLoaderPlugin : public LoaderPlugin { public: - FlacLoaderPlugin(StringView path); - FlacLoaderPlugin(const ByteBuffer& buffer); + explicit FlacLoaderPlugin(StringView path); + explicit FlacLoaderPlugin(const ByteBuffer& buffer); ~FlacLoaderPlugin() { if (m_stream) @@ -87,8 +87,8 @@ public: virtual void reset() override; virtual void seek(const int position) override; - virtual int loaded_samples() override { return m_loaded_samples; } - virtual int total_samples() override { return m_total_samples; } + virtual int loaded_samples() override { return static_cast<int>(m_loaded_samples); } + virtual int total_samples() override { return static_cast<int>(m_total_samples); } virtual u32 sample_rate() override { return m_sample_rate; } virtual u16 num_channels() override { return m_num_channels; } virtual PcmSampleFormat pcm_format() override { return m_sample_format; } |