Skip to content

Commit ba7b483

Browse files
committed
clang-tidy: fix all errors
1 parent cc1fe4d commit ba7b483

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/input/input.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,33 +156,28 @@ input::InputManager::InputManager(const std::shared_ptr<Window>& window) {
156156
/* Terminate the app.
157157
Shut everything down before returning from this function.
158158
*/
159-
return true;
160159
case SDL_APP_LOWMEMORY:
161160
/* You will get this when your app is paused and iOS wants more memory.
162161
Release as much memory as possible.
163162
*/
164-
return true;
163+
165164
case SDL_APP_WILLENTERBACKGROUND:
166165
/* Prepare your app to go into the background. Stop loops, etc.
167166
This gets called when the user hits the home button, or gets a call.
168167
*/
169-
return true;
170168
case SDL_APP_DIDENTERBACKGROUND:
171169
/* This will get called if the user accepted whatever sent your app to the background.
172170
If the user got a phone call and canceled it, you'll instead get an SDL_APP_DID_ENTER_FOREGROUND event and restart your loops.
173171
When you get this, you have 5 seconds to save all your state or the app will be terminated.
174172
Your app is NOT active at this point.
175173
*/
176-
return true;
177174
case SDL_APP_WILLENTERFOREGROUND:
178175
/* This call happens when your app is coming back to the foreground.
179176
Restore all your state here.
180177
*/
181-
return true;
182178
case SDL_APP_DIDENTERFOREGROUND:
183-
179+
return true;
184180
default:
185-
186181
break;
187182
}
188183

src/manager/music_manager.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ MusicManager::MusicManager(ServiceProvider* service_provider, u8 channel_size)
4040
}
4141

4242
// retrieve allocated channels
43-
auto allocated_channels = Mix_AllocateChannels(-1);
43+
const auto allocated_channels = Mix_AllocateChannels(-1);
4444

4545
spdlog::debug("SDL_MIX: allocated_channels = {}", allocated_channels);
4646

@@ -76,7 +76,8 @@ MusicManager::~MusicManager() noexcept {
7676
}
7777

7878
// stop sounds and free loaded data
79-
int result = Mix_HaltChannel(-1);
79+
const int result = Mix_HaltChannel(-1);
80+
8081
if (result != 0) {
8182
spdlog::warn("Mix_HaltChannel failed with error: {}", SDL_GetError());
8283
}
@@ -264,7 +265,7 @@ void MusicManager::hook_music_finished() {
264265

265266
[[nodiscard]] std::optional<double> MusicManager::get_volume() const {
266267
#if !defined(NDEBUG)
267-
int result = Mix_VolumeMusic(-1);
268+
const int result = Mix_VolumeMusic(-1);
268269
if (result == 0) {
269270
return std::nullopt;
270271
}

0 commit comments

Comments
 (0)