forked from enlightenment/efl
Fix compiler warnings
Found when compiling with --enable-tests and --enable-coverage SVN revision: 46746
This commit is contained in:
parent
a15116ecae
commit
d99f80aff7
|
@ -1,4 +1,7 @@
|
|||
/* vim: set sw=4 ts=4 sts=4 et: */
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <dirent.h>
|
||||
|
@ -22,7 +25,7 @@ static Eina_Hash *file_ids = NULL;
|
|||
static Eina_Hash *paths = NULL;
|
||||
|
||||
static int
|
||||
cache_add(const char *path, const char *file_id, int priority)
|
||||
cache_add(const char *path, const char *file_id, int priority __UNUSED__)
|
||||
{
|
||||
Efreet_Desktop *desk;
|
||||
char *ext;
|
||||
|
@ -42,6 +45,7 @@ cache_add(const char *path, const char *file_id, int priority)
|
|||
return 0;
|
||||
eina_hash_add(paths, desk->orig_path, (void *)1);
|
||||
}
|
||||
/* TODO: We should check priority, and not just hope we search in right order */
|
||||
if (file_id && !eina_hash_find(file_ids, file_id))
|
||||
{
|
||||
int id;
|
||||
|
@ -146,7 +150,7 @@ cache_scan(const char *path, const char *base_id, int priority)
|
|||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
main()
|
||||
{
|
||||
/* TODO:
|
||||
* - Add file monitor on files, so that we catch changes on files
|
||||
|
|
|
@ -46,7 +46,7 @@ static int efreet_desktop_command_file_id = 0;
|
|||
|
||||
static char *cache_file = NULL;
|
||||
static Eet_File *cache = NULL;
|
||||
static Eet_Data_Descriptor *edd = NULL;
|
||||
static Eet_Data_Descriptor *desktop_edd = NULL;
|
||||
|
||||
#ifdef EFREET_MODULE_LOG_DOM
|
||||
#undef EFREET_MODULE_LOG_DOM
|
||||
|
@ -153,8 +153,8 @@ efreet_desktop_init(void)
|
|||
}
|
||||
if (!ecore_file_init())
|
||||
goto ecore_error;
|
||||
edd = efreet_desktop_edd_init();
|
||||
if (!edd)
|
||||
desktop_edd = efreet_desktop_edd_init();
|
||||
if (!desktop_edd)
|
||||
goto edd_error;
|
||||
|
||||
efreet_desktop_cache = eina_hash_string_superfast_new(NULL);
|
||||
|
@ -209,7 +209,7 @@ efreet_desktop_shutdown(void)
|
|||
efreet_desktop_types);
|
||||
}
|
||||
if (cache) eet_close(cache);
|
||||
efreet_desktop_edd_shutdown(edd);
|
||||
efreet_desktop_edd_shutdown(desktop_edd);
|
||||
ecore_file_shutdown();
|
||||
eina_log_domain_unregister(_efreet_desktop_log_dom);
|
||||
IF_FREE(cache_file);
|
||||
|
@ -362,7 +362,7 @@ efreet_desktop_new(const char *file)
|
|||
if (cache)
|
||||
{
|
||||
/* TODO: Check if the cached version is out of date */
|
||||
desktop = eet_data_read(cache, edd, file);
|
||||
desktop = eet_data_read(cache, desktop_edd, file);
|
||||
if (desktop)
|
||||
{
|
||||
desktop->ref = 1;
|
||||
|
@ -1751,15 +1751,15 @@ efreet_desktop_command_file_process(Efreet_Desktop_Command *command, const char
|
|||
}
|
||||
else
|
||||
{
|
||||
char *abs = efreet_desktop_command_path_absolute(file);
|
||||
char *absol = efreet_desktop_command_path_absolute(file);
|
||||
/* process local uri/path */
|
||||
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_FULLPATH)
|
||||
f->fullpath = strdup(abs);
|
||||
f->fullpath = strdup(absol);
|
||||
|
||||
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_URI)
|
||||
{
|
||||
char buf[PATH_MAX];
|
||||
snprintf(buf, sizeof(buf), "file://%s", abs);
|
||||
snprintf(buf, sizeof(buf), "file://%s", absol);
|
||||
f->uri = strdup(buf);
|
||||
}
|
||||
|
||||
|
|
|
@ -467,11 +467,11 @@ efreet_icon_find(const char *theme_name, const char *icon, unsigned int size)
|
|||
path = efreet_icon_path_find(theme_name, icon, size);
|
||||
if (path)
|
||||
{
|
||||
Efreet_Icon *icon;
|
||||
Efreet_Icon *ic;
|
||||
|
||||
icon = efreet_icon_new(path);
|
||||
ic = efreet_icon_new(path);
|
||||
free(path);
|
||||
return icon;
|
||||
return ic;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
|
|
@ -1656,40 +1656,40 @@ efreet_menu_merge(Efreet_Menu_Internal *parent, Efreet_Xml *xml, const char *pat
|
|||
{
|
||||
Efreet_Xml *merge_xml;
|
||||
Efreet_Menu_Internal *internal;
|
||||
char *realpath;
|
||||
char *rp;
|
||||
|
||||
if (!parent || !xml || !path) return 0;
|
||||
|
||||
/* do nothing if the file doesn't exist */
|
||||
if (!ecore_file_exists(path)) return 1;
|
||||
|
||||
realpath = ecore_file_realpath(path);
|
||||
if (realpath[0] == '\0')
|
||||
rp = ecore_file_realpath(path);
|
||||
if (rp[0] == '\0')
|
||||
{
|
||||
INF("efreet_menu_merge() unable to get real path for %s", path);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* don't merge the same path twice */
|
||||
if (eina_hash_find(efreet_merged_menus, realpath))
|
||||
if (eina_hash_find(efreet_merged_menus, rp))
|
||||
{
|
||||
FREE(realpath);
|
||||
FREE(rp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
eina_hash_add(efreet_merged_menus, realpath, (void *)1);
|
||||
eina_hash_add(efreet_merged_menus, rp, (void *)1);
|
||||
|
||||
merge_xml = efreet_xml_new(realpath);
|
||||
merge_xml = efreet_xml_new(rp);
|
||||
|
||||
if (!merge_xml)
|
||||
{
|
||||
INF("efreet_menu_merge() failed to read in the "
|
||||
"merge file (%s)", realpath);
|
||||
FREE(realpath);
|
||||
"merge file (%s)", rp);
|
||||
FREE(rp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
FREE(realpath);
|
||||
FREE(rp);
|
||||
|
||||
internal = efreet_menu_internal_new();
|
||||
efreet_menu_path_set(internal, path);
|
||||
|
@ -2761,8 +2761,7 @@ efreet_menu_process_filters(Efreet_Menu_Internal *internal, unsigned int only_un
|
|||
* be done once per menu.*/
|
||||
if (eina_list_count(internal->applications))
|
||||
{
|
||||
Efreet_Menu_Desktop *md;
|
||||
Eina_List *l, *l2;
|
||||
Eina_List *l2;
|
||||
|
||||
EINA_LIST_FOREACH_SAFE(internal->applications, l, l2, md)
|
||||
{
|
||||
|
|
|
@ -121,8 +121,6 @@ ef_cb_efreet_icon_theme_list(void)
|
|||
|
||||
if (eina_list_count(themes) > 0)
|
||||
{
|
||||
char *dir;
|
||||
|
||||
printf("efreet_icon_theme_list_get() missed: ");
|
||||
EINA_LIST_FOREACH(themes, l, dir)
|
||||
printf("%s ", dir);
|
||||
|
@ -188,7 +186,7 @@ ef_icon_theme_themes_find(const char *search_dir, Eina_Hash *themes)
|
|||
}
|
||||
}
|
||||
|
||||
const char *icons[] =
|
||||
const char *system_icons[] =
|
||||
{
|
||||
"address-book-new",
|
||||
"application-exit",
|
||||
|
@ -480,26 +478,26 @@ ef_cb_efreet_icon_match(void)
|
|||
themes = eina_list_remove_list(themes, themes);
|
||||
|
||||
double start = ecore_time_get();
|
||||
for (i = 0; icons[i] != NULL; i++)
|
||||
for (i = 0; system_icons[i] != NULL; i++)
|
||||
{
|
||||
char *path, *s;
|
||||
|
||||
path = efreet_icon_path_find(THEME, icons[i], SIZE);
|
||||
path = efreet_icon_path_find(THEME, system_icons[i], SIZE);
|
||||
|
||||
if (!path)
|
||||
{
|
||||
#if 1
|
||||
if (eina_hash_find(icon_hash, icons[i]))
|
||||
if (eina_hash_find(icon_hash, system_icons[i]))
|
||||
{
|
||||
printf("NOT FOUND %s\n", icons[i]);
|
||||
printf("NOT FOUND %s\n", system_icons[i]);
|
||||
ret = 0;
|
||||
}
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
else if (!eina_hash_find(icon_hash, icons[i]))
|
||||
else if (!eina_hash_find(icon_hash, system_icons[i]))
|
||||
{
|
||||
printf("Found icon not in hash: %s\n", icons[i]);
|
||||
printf("Found icon not in hash: %s\n", system_icons[i]);
|
||||
}
|
||||
|
||||
s = strrchr(path, '.');
|
||||
|
@ -507,9 +505,9 @@ ef_cb_efreet_icon_match(void)
|
|||
s = strrchr(path, '/');
|
||||
if (s) s++;
|
||||
|
||||
if (s && strcmp(s, icons[i]))
|
||||
if (s && strcmp(s, system_icons[i]))
|
||||
{
|
||||
printf("Name mismatch name (%s) vs ef (%s)\n", icons[i], s);
|
||||
printf("Name mismatch name (%s) vs ef (%s)\n", system_icons[i], s);
|
||||
ret = 0;
|
||||
}
|
||||
free(path);
|
||||
|
@ -518,11 +516,11 @@ ef_cb_efreet_icon_match(void)
|
|||
eina_hash_free(icon_hash);
|
||||
|
||||
start = ecore_time_get();
|
||||
for (i = 0; icons[i] != NULL; i++)
|
||||
for (i = 0; system_icons[i] != NULL; i++)
|
||||
{
|
||||
char *path, *s;
|
||||
|
||||
path = efreet_icon_path_find(THEME, icons[i], SIZE);
|
||||
path = efreet_icon_path_find(THEME, system_icons[i], SIZE);
|
||||
|
||||
if (!path) continue;
|
||||
|
||||
|
@ -531,9 +529,9 @@ ef_cb_efreet_icon_match(void)
|
|||
s = strrchr(path, '/');
|
||||
if (s) s++;
|
||||
|
||||
if (s && strcmp(s, icons[i]))
|
||||
if (s && strcmp(s, system_icons[i]))
|
||||
{
|
||||
printf("Name mismatch name (%s) vs ef (%s)\n", icons[i], s);
|
||||
printf("Name mismatch name (%s) vs ef (%s)\n", system_icons[i], s);
|
||||
ret = 0;
|
||||
}
|
||||
free(path);
|
||||
|
|
Loading…
Reference in New Issue