diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 3ade6b9..a31b77d 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -15,7 +15,7 @@ ephoto_SOURCES = ephoto.c \ ephoto_normal_view.c \ ephoto_utils.c -ephoto_CFLAGS = @ewl_cflags@ +ephoto_CFLAGS = @ewl_cflags@ -Wall -Werror ephoto_LDADD = @ewl_libs@ -lsqlite3 -lexif diff --git a/src/bin/ephoto.c b/src/bin/ephoto.c index d1253fc..7964568 100644 --- a/src/bin/ephoto.c +++ b/src/bin/ephoto.c @@ -2,7 +2,7 @@ int main(int argc, char **argv) { - char *album, *name, *description, *path, input[2]; + char *album, *name, *description, *path, input; int i; Ecore_List *albums, *images; sqlite3 *db; @@ -72,7 +72,7 @@ int main(int argc, char **argv) "the name %s and the description %s? ", name, description); scanf("%c", &input); - if(!strncasecmp(input, "y", 1)) + if(input == 'y' || input == 'Y') { db = ephoto_db_init(); ephoto_db_add_album(db, name, description); @@ -113,7 +113,7 @@ int main(int argc, char **argv) "to album %s with a name %s and path %s? ", album, name, path); scanf("%c", &input); - if(!strncasecmp(input, "y", 1)) + if(input == 'y' || input == 'Y') { db = ephoto_db_init(); ephoto_db_add_image(db, album, name, path); @@ -146,7 +146,7 @@ int main(int argc, char **argv) "from the directory %s to the album %s? ", path, album); scanf("%c", &input); - if(!strncasecmp(input, "y", 1)) + if(input == 'y' || input == 'Y') { db = ephoto_db_init(); images = ecore_list_new(); @@ -212,7 +212,7 @@ int main(int argc, char **argv) printf("Are you sure you want to remove the album %s? ", name); scanf("%c", &input); - if(!strncasecmp(input, "y", 1)) + if(input == 'y' || input == 'Y') { db = ephoto_db_init(); ephoto_db_delete_album(db, name); @@ -246,7 +246,7 @@ int main(int argc, char **argv) "from the album %s? ", path, album); scanf("%c", &input); - if(!strncasecmp(input, "y", 1)) + if(input == 'y' || input == 'Y') { db = ephoto_db_init(); ephoto_db_delete_image(db, album, path); diff --git a/src/bin/ephoto_database.c b/src/bin/ephoto_database.c index 8f028bf..018a0c7 100644 --- a/src/bin/ephoto_database.c +++ b/src/bin/ephoto_database.c @@ -97,7 +97,7 @@ void ephoto_db_delete_album(sqlite3 *db, const char *name) sqlite3_exec(db, command, 0, 0, 0); snprintf(command, PATH_MAX, "SELECT id FROM albums WHERE name = '%s';", name); sqlite3_exec(db, command, get_album_id, 0, 0); - snprintf(command, PATH_MAX, "DELETE FROM album_images WHERE album_id = '%s';", album_id); + snprintf(command, PATH_MAX, "DELETE FROM album_images WHERE album_id = '%d';", album_id); sqlite3_exec(db, command, 0, 0, 0); return; @@ -190,7 +190,6 @@ static int list_images(void *notused, int argc, char **argv, char **col) /*Populate a list of the id's of images belonging to a certain album*/ static int list_image_ids(void *notused, int argc, char **argv, char **col) { - char command[PATH_MAX]; int i; notused = 0; diff --git a/src/bin/ephoto_exif.c b/src/bin/ephoto_exif.c index 4be0379..6e6a27c 100644 --- a/src/bin/ephoto_exif.c +++ b/src/bin/ephoto_exif.c @@ -136,7 +136,6 @@ static void add_exif_to_container(Ewl_Widget *w, void *event, void *data) void display_exif_dialog(Ewl_Widget *w, void *event, void *data) { const char *img; - Ecore_Hash *exif_info; Ewl_Widget *win, *vbox, *image, *sp, *list, *label; Ewl_Model *model; Ewl_View *view; diff --git a/src/bin/ephoto_list_view.c b/src/bin/ephoto_list_view.c index 2611137..8835f60 100644 --- a/src/bin/ephoto_list_view.c +++ b/src/bin/ephoto_list_view.c @@ -141,7 +141,7 @@ static void *list_data_fetch(void *data, unsigned int row, unsigned int column) image = ecore_list_goto_index(em->images, row); if (image) { - val = image; + val = (void *)image; } return val; diff --git a/src/bin/ephoto_main.c b/src/bin/ephoto_main.c index fce0c0d..523b735 100644 --- a/src/bin/ephoto_main.c +++ b/src/bin/ephoto_main.c @@ -55,8 +55,8 @@ static void window_fullscreen(Ewl_Widget *w, void *event, void *data) /*Create the Main Ephoto Window*/ void create_main_gui(void) { - Ewl_Widget *vbox, *spacer, *text, *entry, *hbox; - Ewl_Widget *rvbox, *sp, *hsep, *vsep, *image; + Ewl_Widget *vbox, *spacer, *entry, *hbox; + Ewl_Widget *rvbox, *hsep, *vsep, *image; em = NULL; em = calloc(1, sizeof(Ephoto_Main)); @@ -209,7 +209,7 @@ static void populate(Ewl_Widget *w, void *event, void *data) { const char *album; char *imagef; - Ewl_Widget *shadow, *thumb; + Ewl_Widget *thumb; if (w) { @@ -421,7 +421,7 @@ static void *album_data_fetch(void *data, unsigned int row, unsigned int column) album = ecore_list_goto_index(em->albums, row); if (album) { - val = album; + val = (void *)album; } return val; diff --git a/src/bin/ephoto_utils.c b/src/bin/ephoto_utils.c index 6562c91..41427c1 100644 --- a/src/bin/ephoto_utils.c +++ b/src/bin/ephoto_utils.c @@ -45,7 +45,6 @@ const char *image_pixels_string_get(const char *file) /*Get the pixels and return them in integers*/ void image_pixels_int_get(const char *file, int *width, int *height) { - char pixels[PATH_MAX]; int w, h; Evas_Imaging_Image *image;