From b148141200df3ad2cb33bcfc78fb582d0e1c2028 Mon Sep 17 00:00:00 2001 From: Polonkai Gergely Date: Tue, 27 Mar 2012 19:34:04 +0000 Subject: [PATCH] Renamed wmud_db_players_load() to wmud_db_load_players() to follow naming conventions. --- docs/reference/wmud/wmud-sections.txt | 2 +- wmud/db.c | 9 +++++---- wmud/db.h | 2 +- wmud/main.c | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/reference/wmud/wmud-sections.txt b/docs/reference/wmud/wmud-sections.txt index ff42dae..ce587d2 100644 --- a/docs/reference/wmud/wmud-sections.txt +++ b/docs/reference/wmud/wmud-sections.txt @@ -64,7 +64,7 @@ wmud_interpret_game_command WMUD_DB_ERROR wmudDbError wmud_db_init -wmud_db_players_load +wmud_db_load_players wmud_db_save_player diff --git a/wmud/db.c b/wmud/db.c index bc21163..0314ca8 100644 --- a/wmud/db.c +++ b/wmud/db.c @@ -65,13 +65,13 @@ wmud_db_init(GError **err) } /** - * wmud_db_players_load: + * wmud_db_load_players: * @err: a GError to put error messages in it * * Loads all player records from the database */ gboolean -wmud_db_players_load(GError **err) +wmud_db_load_players(GError **err) { sqlite3_stmt *sth = NULL; int sqlite_code; @@ -86,7 +86,7 @@ wmud_db_players_load(GError **err) if ((sqlite_code = sqlite3_prepare_v2(dbh, "SELECT id, login, password, email FROM players", -1, &sth, NULL)) != SQLITE_OK) { - g_set_error(err, WMUD_DB_ERROR, WMUD_DB_ERROR_BADQUERY, "Bad query in wmud_db_players_load(): %s", sqlite3_errmsg(dbh)); + g_set_error(err, WMUD_DB_ERROR, WMUD_DB_ERROR_BADQUERY, "Bad query in wmud_db_load_players(): %s", sqlite3_errmsg(dbh)); return FALSE; } @@ -112,7 +112,8 @@ wmud_db_players_load(GError **err) } else { - g_set_error(err, WMUD_DB_ERROR, WMUD_DB_ERROR_BADQUERY, "Query error in wmud_db_players_load(): %s", sqlite3_errmsg(dbh)); + g_set_error(err, WMUD_DB_ERROR, WMUD_DB_ERROR_BADQUERY, "Query error in wmud_db_load_players(): %s", sqlite3_errmsg(dbh)); + sqlite3_finalize(sth); return FALSE; } } diff --git a/wmud/db.h b/wmud/db.h index 38da5ca..2c8869d 100644 --- a/wmud/db.h +++ b/wmud/db.h @@ -26,7 +26,7 @@ extern GQuark WMUD_DB_ERROR; gboolean wmud_db_init(GError **err); -gboolean wmud_db_players_load(GError **err); +gboolean wmud_db_load_players(GError **err); gboolean wmud_db_save_player(wmudPlayer *player, GError **err); gboolean wmud_db_load_planes(GSList **planes, GError **err); gboolean wmud_db_load_planets(GSList **planets, GError **err); diff --git a/wmud/main.c b/wmud/main.c index 9e97241..9634bf2 100644 --- a/wmud/main.c +++ b/wmud/main.c @@ -175,7 +175,7 @@ main(int argc, char **argv) } g_clear_error(&err); - wmud_db_players_load(&err); + wmud_db_load_players(&err); /* Initialization ends here */