summaryrefslogtreecommitdiff
path: root/db.c
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-01-04 22:22:11 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2010-01-04 22:22:11 +0100
commit8a31fb62fe129d6ae60810a78a9e201ed5bb6c73 (patch)
tree57406a09e4c20724263f21ba9b6da640bd18019c /db.c
parent3e664405587c5cf44fa05dc4a5864ce08243c1dc (diff)
Added -Wall to CCFLAGS and some code cleanup.
Diffstat (limited to 'db.c')
-rw-r--r--db.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/db.c b/db.c
index 0688d75..29ce639 100644
--- a/db.c
+++ b/db.c
@@ -161,7 +161,7 @@ int db_get_top_level_directories(GArray **array) {
*array = g_array_new(TRUE, FALSE, sizeof(struct directory_t));
while((rc = sqlite3_step(stmt)) == SQLITE_ROW) {
- temp.name = g_strdup(sqlite3_column_text(stmt, 1));
+ temp.name = g_strdup((const gchar*)sqlite3_column_text(stmt, 1));
temp.dirid = sqlite3_column_int64(stmt, 0);
g_array_append_val(*array, temp);
}
@@ -198,7 +198,7 @@ int db_get_directories(sqlite_uint64 parent, GArray **array) {
*array = g_array_new(TRUE, FALSE, sizeof(struct directory_t));
while((rc = sqlite3_step(stmt)) == SQLITE_ROW) {
- temp.name = g_strdup(sqlite3_column_text(stmt, 1));
+ temp.name = g_strdup((const gchar*)sqlite3_column_text(stmt, 1));
temp.dirid = sqlite3_column_int64(stmt, 0);
g_array_append_val(*array, temp);
}
@@ -297,7 +297,6 @@ sqlite_uint64 db_get_wallpaper(const char *path) {
int db_get_wallpaper_data(sqlite_uint64 id, struct wallpaper_t *wall) {
sqlite3_stmt *stmt;
int rc;
- sqlite_uint64 dirid;
rc = sqlite3_prepare_v2(db, "SELECT id, filepath, size, width, height FROM wallpaper WHERE id = ? LIMIT 1", -1, &stmt, NULL);
if(rc != SQLITE_OK) {
@@ -312,7 +311,7 @@ int db_get_wallpaper_data(sqlite_uint64 id, struct wallpaper_t *wall) {
rc = sqlite3_step(stmt);
if(rc == SQLITE_ROW) {
- wall->filepath = g_strdup(sqlite3_column_text(stmt, 1));
+ wall->filepath = g_strdup((const gchar*)sqlite3_column_text(stmt, 1));
wall->id = sqlite3_column_int64(stmt, 0);
wall->size = sqlite3_column_int(stmt, 2);
wall->width = sqlite3_column_int(stmt, 3);
@@ -343,7 +342,7 @@ int db_get_wall_tags(sqlite_uint64 wallid, GArray **array) {
*array = g_array_new(FALSE, FALSE, sizeof(struct tag_t));
while((rc = sqlite3_step(stmt)) == SQLITE_ROW) {
temp.id = sqlite3_column_int64(stmt, 0);
- temp.name = g_strdup(sqlite3_column_text(stmt, 1));
+ temp.name = g_strdup((const gchar*)sqlite3_column_text(stmt, 1));
g_array_append_val(*array, temp);
}
@@ -380,7 +379,7 @@ int db_get_wallpapers(sqlite_uint64 dirid, GArray **array) {
*array = g_array_new(TRUE, FALSE, sizeof(struct wallpaper_t));
while((rc = sqlite3_step(stmt)) == SQLITE_ROW) {
- temp.filepath = g_strdup(sqlite3_column_text(stmt, 1));
+ temp.filepath = g_strdup((const gchar*)sqlite3_column_text(stmt, 1));
temp.id = sqlite3_column_int64(stmt, 0);
temp.size = sqlite3_column_int(stmt, 2);
temp.width = sqlite3_column_int(stmt, 3);
@@ -457,7 +456,7 @@ int db_get_walls_by_tags(GArray *tags, GArray **array) {
*array = g_array_new(FALSE, FALSE, sizeof(struct wallpaper_t));
while((rc = sqlite3_step(stmt)) == SQLITE_ROW) {
- temp.filepath = g_strdup(sqlite3_column_text(stmt, 1));
+ temp.filepath = g_strdup((const gchar*)sqlite3_column_text(stmt, 1));
temp.id = sqlite3_column_int64(stmt, 0);
temp.size = sqlite3_column_int(stmt, 2);
temp.width = sqlite3_column_int(stmt, 3);
@@ -565,7 +564,7 @@ int db_get_tags_all(GArray **array) {
*array = g_array_new(FALSE, FALSE, sizeof(struct tag_t));
while((rc = sqlite3_step(stmt)) == SQLITE_ROW) {
- temp.name = g_strdup(sqlite3_column_text(stmt, 1));
+ temp.name = g_strdup((const gchar*)sqlite3_column_text(stmt, 1));
temp.id = sqlite3_column_int64(stmt, 0);
g_array_append_val(*array, temp);
}