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: */
|
/* vim: set sw=4 ts=4 sts=4 et: */
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
@ -22,7 +25,7 @@ static Eina_Hash *file_ids = NULL;
|
||||||
static Eina_Hash *paths = NULL;
|
static Eina_Hash *paths = NULL;
|
||||||
|
|
||||||
static int
|
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;
|
Efreet_Desktop *desk;
|
||||||
char *ext;
|
char *ext;
|
||||||
|
@ -42,6 +45,7 @@ cache_add(const char *path, const char *file_id, int priority)
|
||||||
return 0;
|
return 0;
|
||||||
eina_hash_add(paths, desk->orig_path, (void *)1);
|
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))
|
if (file_id && !eina_hash_find(file_ids, file_id))
|
||||||
{
|
{
|
||||||
int id;
|
int id;
|
||||||
|
@ -146,7 +150,7 @@ cache_scan(const char *path, const char *base_id, int priority)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main()
|
||||||
{
|
{
|
||||||
/* TODO:
|
/* TODO:
|
||||||
* - Add file monitor on files, so that we catch changes on files
|
* - 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 char *cache_file = NULL;
|
||||||
static Eet_File *cache = NULL;
|
static Eet_File *cache = NULL;
|
||||||
static Eet_Data_Descriptor *edd = NULL;
|
static Eet_Data_Descriptor *desktop_edd = NULL;
|
||||||
|
|
||||||
#ifdef EFREET_MODULE_LOG_DOM
|
#ifdef EFREET_MODULE_LOG_DOM
|
||||||
#undef EFREET_MODULE_LOG_DOM
|
#undef EFREET_MODULE_LOG_DOM
|
||||||
|
@ -153,8 +153,8 @@ efreet_desktop_init(void)
|
||||||
}
|
}
|
||||||
if (!ecore_file_init())
|
if (!ecore_file_init())
|
||||||
goto ecore_error;
|
goto ecore_error;
|
||||||
edd = efreet_desktop_edd_init();
|
desktop_edd = efreet_desktop_edd_init();
|
||||||
if (!edd)
|
if (!desktop_edd)
|
||||||
goto edd_error;
|
goto edd_error;
|
||||||
|
|
||||||
efreet_desktop_cache = eina_hash_string_superfast_new(NULL);
|
efreet_desktop_cache = eina_hash_string_superfast_new(NULL);
|
||||||
|
@ -209,7 +209,7 @@ efreet_desktop_shutdown(void)
|
||||||
efreet_desktop_types);
|
efreet_desktop_types);
|
||||||
}
|
}
|
||||||
if (cache) eet_close(cache);
|
if (cache) eet_close(cache);
|
||||||
efreet_desktop_edd_shutdown(edd);
|
efreet_desktop_edd_shutdown(desktop_edd);
|
||||||
ecore_file_shutdown();
|
ecore_file_shutdown();
|
||||||
eina_log_domain_unregister(_efreet_desktop_log_dom);
|
eina_log_domain_unregister(_efreet_desktop_log_dom);
|
||||||
IF_FREE(cache_file);
|
IF_FREE(cache_file);
|
||||||
|
@ -362,7 +362,7 @@ efreet_desktop_new(const char *file)
|
||||||
if (cache)
|
if (cache)
|
||||||
{
|
{
|
||||||
/* TODO: Check if the cached version is out of date */
|
/* 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)
|
if (desktop)
|
||||||
{
|
{
|
||||||
desktop->ref = 1;
|
desktop->ref = 1;
|
||||||
|
@ -1751,15 +1751,15 @@ efreet_desktop_command_file_process(Efreet_Desktop_Command *command, const char
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *abs = efreet_desktop_command_path_absolute(file);
|
char *absol = efreet_desktop_command_path_absolute(file);
|
||||||
/* process local uri/path */
|
/* process local uri/path */
|
||||||
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_FULLPATH)
|
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_FULLPATH)
|
||||||
f->fullpath = strdup(abs);
|
f->fullpath = strdup(absol);
|
||||||
|
|
||||||
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_URI)
|
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_URI)
|
||||||
{
|
{
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
snprintf(buf, sizeof(buf), "file://%s", abs);
|
snprintf(buf, sizeof(buf), "file://%s", absol);
|
||||||
f->uri = strdup(buf);
|
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);
|
path = efreet_icon_path_find(theme_name, icon, size);
|
||||||
if (path)
|
if (path)
|
||||||
{
|
{
|
||||||
Efreet_Icon *icon;
|
Efreet_Icon *ic;
|
||||||
|
|
||||||
icon = efreet_icon_new(path);
|
ic = efreet_icon_new(path);
|
||||||
free(path);
|
free(path);
|
||||||
return icon;
|
return ic;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -1656,40 +1656,40 @@ efreet_menu_merge(Efreet_Menu_Internal *parent, Efreet_Xml *xml, const char *pat
|
||||||
{
|
{
|
||||||
Efreet_Xml *merge_xml;
|
Efreet_Xml *merge_xml;
|
||||||
Efreet_Menu_Internal *internal;
|
Efreet_Menu_Internal *internal;
|
||||||
char *realpath;
|
char *rp;
|
||||||
|
|
||||||
if (!parent || !xml || !path) return 0;
|
if (!parent || !xml || !path) return 0;
|
||||||
|
|
||||||
/* do nothing if the file doesn't exist */
|
/* do nothing if the file doesn't exist */
|
||||||
if (!ecore_file_exists(path)) return 1;
|
if (!ecore_file_exists(path)) return 1;
|
||||||
|
|
||||||
realpath = ecore_file_realpath(path);
|
rp = ecore_file_realpath(path);
|
||||||
if (realpath[0] == '\0')
|
if (rp[0] == '\0')
|
||||||
{
|
{
|
||||||
INF("efreet_menu_merge() unable to get real path for %s", path);
|
INF("efreet_menu_merge() unable to get real path for %s", path);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* don't merge the same path twice */
|
/* 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;
|
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)
|
if (!merge_xml)
|
||||||
{
|
{
|
||||||
INF("efreet_menu_merge() failed to read in the "
|
INF("efreet_menu_merge() failed to read in the "
|
||||||
"merge file (%s)", realpath);
|
"merge file (%s)", rp);
|
||||||
FREE(realpath);
|
FREE(rp);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
FREE(realpath);
|
FREE(rp);
|
||||||
|
|
||||||
internal = efreet_menu_internal_new();
|
internal = efreet_menu_internal_new();
|
||||||
efreet_menu_path_set(internal, path);
|
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.*/
|
* be done once per menu.*/
|
||||||
if (eina_list_count(internal->applications))
|
if (eina_list_count(internal->applications))
|
||||||
{
|
{
|
||||||
Efreet_Menu_Desktop *md;
|
Eina_List *l2;
|
||||||
Eina_List *l, *l2;
|
|
||||||
|
|
||||||
EINA_LIST_FOREACH_SAFE(internal->applications, l, l2, md)
|
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)
|
if (eina_list_count(themes) > 0)
|
||||||
{
|
{
|
||||||
char *dir;
|
|
||||||
|
|
||||||
printf("efreet_icon_theme_list_get() missed: ");
|
printf("efreet_icon_theme_list_get() missed: ");
|
||||||
EINA_LIST_FOREACH(themes, l, dir)
|
EINA_LIST_FOREACH(themes, l, dir)
|
||||||
printf("%s ", 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",
|
"address-book-new",
|
||||||
"application-exit",
|
"application-exit",
|
||||||
|
@ -480,26 +478,26 @@ ef_cb_efreet_icon_match(void)
|
||||||
themes = eina_list_remove_list(themes, themes);
|
themes = eina_list_remove_list(themes, themes);
|
||||||
|
|
||||||
double start = ecore_time_get();
|
double start = ecore_time_get();
|
||||||
for (i = 0; icons[i] != NULL; i++)
|
for (i = 0; system_icons[i] != NULL; i++)
|
||||||
{
|
{
|
||||||
char *path, *s;
|
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 (!path)
|
||||||
{
|
{
|
||||||
#if 1
|
#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;
|
ret = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
continue;
|
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, '.');
|
s = strrchr(path, '.');
|
||||||
|
@ -507,9 +505,9 @@ ef_cb_efreet_icon_match(void)
|
||||||
s = strrchr(path, '/');
|
s = strrchr(path, '/');
|
||||||
if (s) s++;
|
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;
|
ret = 0;
|
||||||
}
|
}
|
||||||
free(path);
|
free(path);
|
||||||
|
@ -518,11 +516,11 @@ ef_cb_efreet_icon_match(void)
|
||||||
eina_hash_free(icon_hash);
|
eina_hash_free(icon_hash);
|
||||||
|
|
||||||
start = ecore_time_get();
|
start = ecore_time_get();
|
||||||
for (i = 0; icons[i] != NULL; i++)
|
for (i = 0; system_icons[i] != NULL; i++)
|
||||||
{
|
{
|
||||||
char *path, *s;
|
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;
|
if (!path) continue;
|
||||||
|
|
||||||
|
@ -531,9 +529,9 @@ ef_cb_efreet_icon_match(void)
|
||||||
s = strrchr(path, '/');
|
s = strrchr(path, '/');
|
||||||
if (s) s++;
|
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;
|
ret = 0;
|
||||||
}
|
}
|
||||||
free(path);
|
free(path);
|
||||||
|
|
Loading…
Reference in New Issue