Skip to content

Commit

Permalink
Merge pull request #1019 from staticssleever668/fix/song_insert_excep…
Browse files Browse the repository at this point in the history
…tion

Fix warnings in SongCacheIndex
  • Loading branch information
poco0317 authored Aug 2, 2021
2 parents e1b2451 + 9f321fd commit 50703b1
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 72 deletions.
14 changes: 7 additions & 7 deletions src/Etterna/Models/Misc/DBProfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ DBProfile::LoadDBFromDir(std::string dir)
// Open a database file
db = new SQLite::Database(FILEMAN->ResolvePath(dir) + PROFILE_DB,
SQLite::OPEN_READWRITE);
} catch (std::exception) {
} catch (std::exception&) {
return ProfileLoadResult_FailedNoProfile;
}
try {
Expand All @@ -46,7 +46,7 @@ DBProfile::LoadDBFromDir(std::string dir)
LoadScoreGoals(db);
LoadPlayLists(db);
LoadPlayerScores(db);
} catch (std::exception) {
} catch (std::exception&) {
return ProfileLoadResult_FailedTampered;
}
delete db;
Expand Down Expand Up @@ -469,7 +469,7 @@ DBProfile::SaveDBToDir(string dir,
// Open a database file
db = new SQLite::Database(filename,
SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE);
} catch (std::exception) {
} catch (std::exception&) {
return ProfileLoadResult_FailedNoProfile;
}
try {
Expand Down Expand Up @@ -516,7 +516,7 @@ DBProfile::SaveDBToDir(string dir,
db->exec("CREATE INDEX IF NOT EXISTS idx_songs "
"ON songs(song, pack, id)");
transaction.commit();
} catch (std::exception) {
} catch (std::exception&) {
return ProfileLoadResult_FailedTampered;
}
delete db;
Expand Down Expand Up @@ -1001,7 +1001,7 @@ DBProfile::SavePlayerScores(SQLite::Database* db,
insertOffset.exec();
}
}
} catch (std::exception) { // No replay data for
} catch (std::exception&) { // No replay data for
// this score }
hs->UnloadReplayData();
}
Expand Down Expand Up @@ -1125,7 +1125,7 @@ DBProfile::WriteReplayData(const HighScore* hs)
// Open a database file
db = new SQLite::Database(filename,
SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE);
} catch (std::exception) {
} catch (std::exception&) {
return ProfileLoadResult_FailedNoProfile;
}
try {
Expand All @@ -1146,7 +1146,7 @@ DBProfile::WriteReplayData(const HighScore* hs)
insertOffset.exec();
}
transaction.commit();
} catch (std::exception) {
} catch (std::exception&) {
return ProfileLoadResult_FailedTampered != 0;
}
delete db;
Expand Down
Loading

0 comments on commit 50703b1

Please sign in to comment.