From 29db6de1bb4937e54521487fa812eda855ba05e9 Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Thu, 23 Apr 2009 20:22:01 +0200 Subject: [PATCH] Fixup prototype for db_enum_fetch_row() Second argument is actually a pointer to a pointer to a struct db_media_file_info, and not a simple pointer. That code sucks. Plain and simple. Will be taken out and shot at the earliest occasion. Someone badly needs to take "Pointers 101", among a lot of other 101 courses. Sigh. --- src/db-generic.c | 4 ++-- src/db-generic.h | 2 +- src/db-sql.c | 2 +- src/db-sql.h | 2 +- src/ff-plugins.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/db-generic.c b/src/db-generic.c index 9170da7d..8cb5211e 100644 --- a/src/db-generic.c +++ b/src/db-generic.c @@ -61,7 +61,7 @@ typedef struct tag_db_functions { int(*dbs_edit_playlist)(char **, int, char*, char*); int(*dbs_playcount_increment)(char **, int); int(*dbs_enum_start)(char **, DBQUERYINFO *); - int(*dbs_enum_fetch_row)(char **, PACKED_MP3FILE *, DBQUERYINFO *); + int(*dbs_enum_fetch_row)(char **, PACKED_MP3FILE **, DBQUERYINFO *); int(*dbs_enum_reset)(char **, DBQUERYINFO *); int(*dbs_enum_end)(char **); int(*dbs_force_rescan)(char **); @@ -438,7 +438,7 @@ int db_enum_start(char **pe, DBQUERYINFO *pinfo) { * fetch the next item int he result set started by the db enum. this * will be in native packed row format */ -int db_enum_fetch_row(char **pe, PACKED_MP3FILE *row, DBQUERYINFO *pinfo) { +int db_enum_fetch_row(char **pe, PACKED_MP3FILE **row, DBQUERYINFO *pinfo) { return db_current->dbs_enum_fetch_row(pe, row, pinfo); } diff --git a/src/db-generic.h b/src/db-generic.h index 2f4919ed..a9f46b7d 100644 --- a/src/db-generic.h +++ b/src/db-generic.h @@ -75,7 +75,7 @@ extern int db_revision(void); extern int db_add(char **pe, MP3FILE *pmp3, int *id); extern int db_enum_start(char **pe, DBQUERYINFO *pinfo); -extern int db_enum_fetch_row(char **pe, PACKED_MP3FILE *row, DBQUERYINFO *pinfo); +extern int db_enum_fetch_row(char **pe, PACKED_MP3FILE **row, DBQUERYINFO *pinfo); extern int db_enum_reset(char **pe, DBQUERYINFO *pinfo); extern int db_enum_end(char **pe); extern int db_start_scan(void); diff --git a/src/db-sql.c b/src/db-sql.c index f73230b3..e183b40f 100644 --- a/src/db-sql.c +++ b/src/db-sql.c @@ -1379,7 +1379,7 @@ int db_sql_enum_start(char **pe, DBQUERYINFO *pinfo) { /** * fetch the next row in raw row format */ -int db_sql_enum_fetch_row(char **pe, PACKED_MP3FILE *row, DBQUERYINFO *pinfo) { +int db_sql_enum_fetch_row(char **pe, PACKED_MP3FILE **row, DBQUERYINFO *pinfo) { int err; err=db_sql_enum_fetch_fn(pe, (char***)row); diff --git a/src/db-sql.h b/src/db-sql.h index 210dc19b..ee88e984 100644 --- a/src/db-sql.h +++ b/src/db-sql.h @@ -35,7 +35,7 @@ extern int db_sql_add(char **pe, MP3FILE *pmp3, int *id); extern int db_sql_enum_start(char **pe, DBQUERYINFO *pinfo); -extern int db_sql_enum_fetch_row(char **pe, PACKED_MP3FILE *row, DBQUERYINFO *pinfo); +extern int db_sql_enum_fetch_row(char **pe, PACKED_MP3FILE **row, DBQUERYINFO *pinfo); extern int db_sql_enum_reset(char **pe, DBQUERYINFO *pinfo); extern int db_sql_enum_end(char **pe); extern int db_sql_force_rescan(char **pe); diff --git a/src/ff-plugins.c b/src/ff-plugins.c index f5b6c47a..e3e336fa 100644 --- a/src/ff-plugins.c +++ b/src/ff-plugins.c @@ -262,7 +262,7 @@ EXPORT int pi_db_enum_start(char **pe, DB_QUERY *pinfo) { } EXPORT int pi_db_enum_fetch_row(char **pe, char ***row, DB_QUERY *pinfo) { - return db_enum_fetch_row(pe, (PACKED_MP3FILE*)row, + return db_enum_fetch_row(pe, (PACKED_MP3FILE**)row, (DBQUERYINFO*)pinfo->priv); }