Fix most compiler & clang warnings.
authorbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 26 Feb 2009 22:35:38 +0000 (22:35 +0000)
committerbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 26 Feb 2009 22:35:38 +0000 (22:35 +0000)
Left warnings regarding signed and unsigned comparison since
eina_list_count() returns unsigned, can use a cast in this return, but
not big deal for now.

By: Luis Felipe Strano Moraes & myself.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/efreet@39260 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/compare/efreet_alloc.c
src/bin/compare/efreet_menu_alloc.c
src/bin/ef_icon_theme.c
src/lib/efreet_desktop.c
src/lib/efreet_icon.c
src/lib/efreet_ini.c
src/lib/efreet_menu.c
src/lib/efreet_utils.c

index 818d0b0..98d11ae 100644 (file)
@@ -4,7 +4,7 @@
 #include "comp.h"
 
 int
-main(int argc, char **argv)
+main(void)
 {
     int i = 0, k;
     char *path;
index 5a43a0c..fcfb75b 100644 (file)
@@ -3,7 +3,7 @@
 #include "comp.h"
 
 int
-main(int argc, char **argv)
+main(void)
 {
     int k;
 
index 369a4b8..494b089 100644 (file)
@@ -54,7 +54,7 @@ ef_cb_efreet_icon_theme(void)
 }
 
 static Eina_Bool
-_hash_keys(Eina_Hash *hash, const char *key, void *list)
+_hash_keys(Eina_Hash *hash __UNUSED__, const char *key, void *list)
 {
   Eina_List **l = list;
 
@@ -74,7 +74,6 @@ ef_cb_efreet_icon_theme_list(void)
     Efreet_Icon_Theme *theme;
     const char *dir;
     char buf[PATH_MAX];
-    void *value;
 
     dirs = eina_hash_string_superfast_new(free);
 
index 9515e7c..0927ba9 100644 (file)
@@ -1009,17 +1009,18 @@ efreet_desktop_generic_fields_save(Efreet_Desktop *desktop, Efreet_Ini *ini)
  * @internal
  * @param node: The node to work with
  * @param desktop: The desktop file to work with
- * @return Returns no value
+ * @return Returns always true, to be used in eina_hash_foreach()
  * @brief Parses out an X- key from @a node and stores in @a desktop
  */
 static Eina_Bool
-efreet_desktop_x_fields_parse(const Eina_Hash *hash, const void *key, void *value, void *fdata)
+efreet_desktop_x_fields_parse(const Eina_Hash *hash __UNUSED__, const void *key, void *value, void *fdata)
 {
     Efreet_Desktop * desktop = fdata;
 
+    if (!desktop) return EINA_TRUE;
     if (strncmp(key, "X-", 2)) return EINA_TRUE;
 
-    if (desktop && !desktop->x)
+    if (!desktop->x)
       desktop->x = eina_hash_string_superfast_new(EINA_FREE_CB(eina_stringshare_del));
     eina_hash_del(desktop->x, key, NULL);
     eina_hash_add(desktop->x, key, (void *)eina_stringshare_add(value));
@@ -1035,7 +1036,7 @@ efreet_desktop_x_fields_parse(const Eina_Hash *hash, const void *key, void *valu
  * @brief Stores an X- key from @a node and stores in @a ini
  */
 static Eina_Bool
-efreet_desktop_x_fields_save(const Eina_Hash *hash, const void *key, void *value, void *fdata)
+efreet_desktop_x_fields_save(const Eina_Hash *hash __UNUSED__, const void *key, void *value, void *fdata)
 {
     Efreet_Ini *ini = fdata;
     efreet_ini_string_set(ini, key, value);
index 8da6db3..33a1cea 100644 (file)
@@ -48,7 +48,6 @@ static int efreet_icon_directory_size_match(Efreet_Icon_Theme_Directory *dir,
                                                   unsigned int size);
 
 static Efreet_Icon *efreet_icon_new(const char *path);
-static void efreet_icon_point_free(Efreet_Icon_Point *point);
 static void efreet_icon_populate(Efreet_Icon *icon, const char *file);
 
 static char *efreet_icon_lookup_directory_helper(Efreet_Icon_Theme_Directory *dir,
@@ -67,7 +66,6 @@ static void efreet_icon_theme_index_read(Efreet_Icon_Theme *theme,
 
 static Efreet_Icon_Theme_Directory *efreet_icon_theme_directory_new(Efreet_Ini *ini,
                                                                 const char *name);
-static void efreet_icon_theme_directory_free(Efreet_Icon_Theme_Directory *dir);
 
 static void efreet_icon_theme_cache_check(Efreet_Icon_Theme *theme);
 static int efreet_icon_theme_cache_check_dir(Efreet_Icon_Theme *theme,
@@ -211,7 +209,7 @@ efreet_icon_extra_list_get(void)
 }
 
 static Eina_Bool
-_hash_keys(Eina_Hash *hash, const void *key, void *list)
+_hash_keys(Eina_Hash *hash __UNUSED__, const void *key, void *list)
 {
   *(Eina_List**)list = eina_list_append(*(Eina_List**)list, key);
   return EINA_TRUE;
@@ -354,13 +352,14 @@ efreet_icon_find_theme_check(const char *theme_name)
 EAPI char *
 efreet_icon_path_find(const char *theme_name, const char *icon, unsigned int size)
 {
-    char *value = NULL;
+    const char *cached;
+    char *value;
     Efreet_Icon_Theme *theme;
 
-    if ((value = efreet_icon_hash_get(theme_name, icon, size)) != NULL)
+    if ((cached = efreet_icon_hash_get(theme_name, icon, size)) != NULL)
     {
-       if (value == NON_EXISTING) return NULL;
-       return strdup(value);
+       if (cached == NON_EXISTING) return NULL;
+       return strdup(cached);
     }
     theme = efreet_icon_find_theme_check(theme_name);
 
@@ -988,20 +987,6 @@ efreet_icon_free(Efreet_Icon *icon)
 
 /**
  * @internal
- * @param point: The Efreet_Icon_Point to free
- * @return Returns no value
- * @brief Frees the given structure
- */
-static void
-efreet_icon_point_free(Efreet_Icon_Point *point)
-{
-    if (!point) return;
-
-    FREE(point);
-}
-
-/**
- * @internal
  * @param icon: The icon to populate
  * @param file: The file to populate from
  * @return Returns no value
@@ -1505,21 +1490,6 @@ efreet_icon_theme_directory_new(Efreet_Ini *ini, const char *name)
     return dir;
 }
 
-/**
- * @internal
- * @param dir: The Efreet_Icon_Theme_Directory to free
- * @return Returns no value
- * @brief Frees the given directory @a dir
- */
-static void
-efreet_icon_theme_directory_free(Efreet_Icon_Theme_Directory *dir)
-{
-    if (!dir) return;
-
-    IF_FREE(dir->name);
-    FREE(dir);
-}
-
 static int
 efreet_icon_cache_find(Efreet_Icon_Cache *value, const char *key)
 {
index 15e8f24..7c14efd 100644 (file)
@@ -623,7 +623,7 @@ efreet_ini_unescape(const char *str)
 }
 
 static Eina_Bool
-efreet_ini_section_save(const Eina_Hash *hash, const void *key, void *value, void *fdata)
+efreet_ini_section_save(const Eina_Hash *hash __UNUSED__, const void *key, void *value, void *fdata)
 {
     FILE *f = fdata;
 
@@ -633,7 +633,7 @@ efreet_ini_section_save(const Eina_Hash *hash, const void *key, void *value, voi
 }
 
 static Eina_Bool
-efreet_ini_value_save(const Eina_Hash *hash, const void *key, void *value, void *fdata)
+efreet_ini_value_save(const Eina_Hash *hash __UNUSED__, const void *key, void *value, void *fdata)
 {
     FILE *f = fdata;
 
index 3ec7d46..35994fb 100644 (file)
@@ -280,7 +280,6 @@ static void efreet_menu_create_default_layout_list(Efreet_Menu_Internal *interna
 static char *efreet_menu_path_get(Efreet_Menu_Internal *internal, const char *suffix);
 
 static Efreet_Menu_App_Dir *efreet_menu_app_dir_new(void);
-static void efreet_menu_app_dir_free(Efreet_Menu_App_Dir *dir);
 
 static Efreet_Menu_Move *efreet_menu_move_new(void);
 static void efreet_menu_move_free(Efreet_Menu_Move *move);
@@ -289,7 +288,6 @@ static Efreet_Menu_Filter *efreet_menu_filter_new(void);
 static void efreet_menu_filter_free(Efreet_Menu_Filter *filter);
 
 static Efreet_Menu_Layout *efreet_menu_layout_new(void);
-static void efreet_menu_layout_free(Efreet_Menu_Layout *layout);
 
 static Efreet_Menu_Filter_Op *efreet_menu_filter_op_new(void);
 static void efreet_menu_filter_op_free(Efreet_Menu_Filter_Op *op);
@@ -2429,22 +2427,6 @@ efreet_menu_layout_new(void)
 
 /**
  * @internal
- * @param layout: The layout to work with
- * @return Returns no data
- * @brief Frees the given layout and all data
- */
-static void
-efreet_menu_layout_free(Efreet_Menu_Layout *layout)
-{
-    if (!layout) return;
-
-    IF_FREE(layout->name);
-
-    FREE(layout);
-}
-
-/**
- * @internal
  * @return Returns a new Efreet_Menu_Filter_Op on success or NULL on failure
  * @brief Creates and initializes an Efreet_Menu_Filter_Op structure
  */
@@ -3218,23 +3200,6 @@ efreet_menu_app_dir_new(void)
 
 /**
  * @internal
- * @param dir: The app dir to free
- * @return Returns no value
- * @brief Frees @a dir
- */
-static void
-efreet_menu_app_dir_free(Efreet_Menu_App_Dir *dir)
-{
-    if (!dir) return;
-
-    IF_FREE(dir->path);
-    IF_FREE(dir->prefix);
-
-    FREE(dir);
-}
-
-/**
- * @internal
  * @param a: The app dir to compare too
  * @param b: The path to compare too
  * @return Returns 1 if the strings are equals, 0 otherwise
index 26ab157..a701764 100644 (file)
@@ -480,7 +480,7 @@ efreet_util_desktop_comment_glob_list(const char *glob)
 }
 
 static Eina_Bool
-_hash_keys(Eina_Hash *hash, const void *key, void *fdata)
+_hash_keys(Eina_Hash *hash __UNUSED__, const void *key, void *fdata)
 {
     Eina_List **l = fdata;