Fix -wreturn-type warnings
This commit is contained in:
bovenliggende
ed61003636
commit
017932e673
5
cli.cpp
5
cli.cpp
@ -75,10 +75,7 @@ std::pair<bool, std::string> CLIHandler::user_change_pw([[maybe_unused]] const s
|
||||
|
||||
userDao->save(*user);
|
||||
}
|
||||
else
|
||||
{
|
||||
return {false, "User not found"};
|
||||
}
|
||||
return {false, "User not found"};
|
||||
}
|
||||
|
||||
std::pair<bool, std::string> CLIHandler::user_rename([[maybe_unused]] const std::vector<std::string> &args)
|
||||
|
@ -42,6 +42,7 @@ std::optional<Category> CategoryDaoSqlite::find(std::string name)
|
||||
{
|
||||
throwFrom(e);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
void CategoryDaoSqlite::save(const Category &c)
|
||||
|
@ -22,18 +22,17 @@ SOFTWARE.
|
||||
|
||||
bool SqliteDao::execBool(sqlite::database_binder &binder) const
|
||||
{
|
||||
bool result;
|
||||
bool result = false;
|
||||
try
|
||||
{
|
||||
bool result;
|
||||
binder >> result;
|
||||
return result;
|
||||
}
|
||||
catch(sqlite::sqlite_exception &e)
|
||||
{
|
||||
// TODO: well, we may want to check whether rows have found or not and thus log this here
|
||||
return false;
|
||||
result = false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int SqliteDao::execInt(sqlite::database_binder &binder) const
|
||||
@ -52,4 +51,5 @@ int SqliteDao::execInt(sqlite::database_binder &binder) const
|
||||
{
|
||||
throwFrom(e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -37,7 +37,6 @@ bool UserDaoSqlite::exists(std::string username)
|
||||
|
||||
std::optional<User> UserDaoSqlite::find(std::string username)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
User user;
|
||||
@ -58,6 +57,7 @@ std::optional<User> UserDaoSqlite::find(std::string username)
|
||||
{
|
||||
throwFrom(e);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
std::optional<User> UserDaoSqlite::find(int id)
|
||||
@ -81,6 +81,7 @@ std::optional<User> UserDaoSqlite::find(int id)
|
||||
{
|
||||
throwFrom(e);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<User> UserDaoSqlite::list(QueryOption o)
|
||||
|
Laden…
Verwijs in nieuw issue
Block a user