More cleanups, ephoto now compiles with -Wall and -Werror.
SVN revision: 28465
This commit is contained in:
parent
9ba269c55a
commit
78d88227c1
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue