Fix more clang-tidy warnings

This commit is contained in:
Tobias Reisinger 2020-11-14 00:34:20 +01:00
parent 5747a65664
commit c7cafa94c4
21 changed files with 178 additions and 208 deletions

View file

@ -90,8 +90,6 @@ database_migrate()
default:
break;
}
return;
}
void
@ -106,7 +104,7 @@ database_transaction_begin(database_transaction_lock *lock)
}
void
database_transaction_commit(database_transaction_lock *lock)
database_transaction_commit(const database_transaction_lock *lock)
{
if(transaction_lock == lock)
{
@ -117,7 +115,7 @@ database_transaction_commit(database_transaction_lock *lock)
}
void
database_transaction_rollback(database_transaction_lock *lock)
database_transaction_rollback(const database_transaction_lock *lock)
{
if(transaction_lock == lock)
{
@ -147,12 +145,10 @@ database_helper_get_id(sqlite3_stmt *stmt)
{
break;
}
else
{
LOGGER_ERR("error selecting id from database: %s\n", sqlite3_errstr(s));
sqlite3_finalize(stmt);
return 0;
}
LOGGER_ERR("error selecting id from database: %s\n", sqlite3_errstr(s));
sqlite3_finalize(stmt);
return 0;
}
}
@ -191,16 +187,14 @@ database_helper_get_ids(sqlite3_stmt *stmt)
{
break;
}
else
if(result)
{
if(result)
{
free(result);
}
LOGGER_ERR("error selecting ids from database: %s\n", sqlite3_errstr(s));
sqlite3_finalize(stmt);
return NULL;
free(result);
}
LOGGER_ERR("error selecting ids from database: %s\n", sqlite3_errstr(s));
sqlite3_finalize(stmt);
return NULL;
}
}
@ -238,16 +232,14 @@ database_helper_get_string(sqlite3_stmt *stmt)
{
break;
}
else
if(result)
{
if(result)
{
free(result);
}
LOGGER_ERR("error selecting string from database: %s\n", sqlite3_errstr(s));
sqlite3_finalize(stmt);
return NULL;
free(result);
}
LOGGER_ERR("error selecting string from database: %s\n", sqlite3_errstr(s));
sqlite3_finalize(stmt);
return NULL;
}
}
@ -284,11 +276,9 @@ database_helper_get_strings(sqlite3_stmt *stmt)
{
break;
}
else
{
LOGGER_ERR("error selecting strings from database: %s\n", sqlite3_errstr(s));
break;
}
LOGGER_ERR("error selecting strings from database: %s\n", sqlite3_errstr(s));
break;
}
}
sqlite3_finalize(stmt);