Remove some compiler warnings
authorJulien Lavergne <julien.lavergne@gmail.com>
Mon, 20 Dec 2010 21:54:23 +0000 (22:54 +0100)
committerJulien Lavergne <julien.lavergne@gmail.com>
Mon, 20 Dec 2010 21:54:23 +0000 (22:54 +0100)
src/cursor-theme.c
src/icon-theme.c
src/lxappearance.c
src/plugin.c
src/utils.c
src/widget-theme.c

index 4e77d68..1a458ec 100644 (file)
@@ -37,7 +37,8 @@ static void update_cursor_demo()
         GDK_LEFT_SIDE,
         GDK_TOP_LEFT_CORNER,
         GDK_SB_H_DOUBLE_ARROW};
-    int i, n;
+    unsigned int i;
+    int s;
     for(i = 0; i < G_N_ELEMENTS(types); ++i)
     {
         GtkTreeIter it;
@@ -56,8 +57,8 @@ static void update_cursor_demo()
      * Unfortunately, this doesn't work for non-gtk+ programs.
      * KDE programs seem to require special handling with XFixes */
     cursor = gdk_cursor_new(GDK_LEFT_PTR);
-    i = gdk_display_get_n_screens(gdk_display_get_default());
-    while(--i >= 0)
+    s = gdk_display_get_n_screens(gdk_display_get_default());
+    while(--s >= 0)
     {
         GdkScreen* screen = gdk_display_get_screen(gdk_display_get_default(), i);
         gdk_window_set_cursor(gdk_screen_get_root_window(screen), cursor);
@@ -102,7 +103,7 @@ static void on_cursor_theme_size_changed(GtkRange* range, gpointer user_data)
 
 void cursor_theme_init(GtkBuilder* b)
 {
-    int max_cursor_w, max_cursor_h, max_size;
+    guint max_cursor_w, max_cursor_h, max_size;
     GtkTreeSelection* sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(app.cursor_theme_view));
     /* treeview and model are already set up in icon_theme_init() */
     g_signal_connect(sel, "changed", G_CALLBACK(on_cursor_theme_sel_changed), NULL);
index 396c00b..498f83e 100644 (file)
@@ -63,8 +63,8 @@ void load_icon_themes_from_dir(const char* base_dir, const char* theme_dir, GKey
     GDir* dir = g_dir_open(theme_dir, 0, NULL);
     if(dir)
     {
-        const char* name;
-        while(name = g_dir_read_name(dir))
+        const char* name = NULL;
+        while(name == g_dir_read_name(dir))
         {
             /* skip "default" */
             if(G_UNLIKELY(strcmp(name, "default") == 0))
@@ -157,7 +157,6 @@ static void on_install_theme_clicked(GtkButton* btn, gpointer user_data)
 
 static void on_remove_theme_clicked(GtkButton* btn, gpointer user_data)
 {
-    char* theme_name;
     GtkTreeSelection* sel;
     GtkTreeModel* model;
     GtkTreeIter it;
index 8e95001..ae8d973 100644 (file)
@@ -121,10 +121,12 @@ static void reload_all_programs()
     gdk_event_send_clientmessage_toall((GdkEvent *)&event);
 }
 
+/* Disable, not used
 static const char* bool2str(gboolean val)
 {
     return val ? "TRUE" : "FALSE";
 }
+*/
 
 static void lxappearance_save_gtkrc()
 {
@@ -191,17 +193,17 @@ static void lxappearance_save_gtkrc()
 
     if(app.hinting_style)
         g_string_append_printf(content,
-            "gtk-xft-hintstyle=\"%s\"\n", app.hinting_style);
+            "gtk-xft-hintstyle=\"%i\"\n", app.hinting_style);
 
     if(app.font_rgba)
         g_string_append_printf(content,
-            "gtk-xft-rgba=\"%s\"\n", app.font_rgba);
+            "gtk-xft-rgba=\"%i\"\n", app.font_rgba);
 
     if(app.color_scheme)
     {
         char* escaped = g_strescape(app.color_scheme, NULL);
         g_string_append_printf(content,
-            "gtk-color-scheme=\"\"\n",
+            "gtk-color-scheme=\"%s\"\n",
             escaped);
         g_free(escaped);
     }
@@ -265,8 +267,8 @@ static void lxappearance_save_lxsession()
 #endif
     g_key_file_set_integer( kf, "GTK", "iXft/Antialias", app.enable_antialising);
     g_key_file_set_integer( kf, "GTK", "iXft/Hinting", app.enable_hinting);
-    g_key_file_set_string ( kf, "GTK", "sXft/HintStyle", app.hinting_style);
-    g_key_file_set_string ( kf, "GTK", "sXft/RGBA", app.font_rgba);
+    g_key_file_set_integer( kf, "GTK", "sXft/HintStyle", app.hinting_style);
+    g_key_file_set_integer( kf, "GTK", "sXft/RGBA", app.font_rgba);
 
     buf = g_key_file_to_data( kf, &len, NULL );
     g_key_file_free(kf);
index bd22c18..594ad1a 100644 (file)
@@ -43,10 +43,10 @@ static GSList* plugins = NULL;
 void plugins_init(GtkBuilder* builder)
 {
     GDir* dir = g_dir_open(PLUGIN_DIR, 0, NULL);
-    const char* name;
+    const char* name = NULL;
     if(!dir)
         return;
-    while(name = g_dir_read_name(dir))
+    while(name == g_dir_read_name(dir))
     {
         if(g_str_has_suffix(name, ".so"))
         {
index 7f9f11e..0540797 100644 (file)
@@ -160,7 +160,7 @@ static gboolean install_icon_theme_package(const char* package_path)
             if(dir)
             {
                 char* name;
-                while(name = (char*)g_dir_read_name(dir))
+                while(name == (char*)g_dir_read_name(dir))
                 {
                     char* index_theme = g_build_filename(tmp_dir, name, "index.theme", NULL);
                     gboolean is_theme = g_file_test(index_theme, G_FILE_TEST_EXISTS);
index f891e99..17141e5 100644 (file)
@@ -29,8 +29,8 @@ static GSList* load_themes_in_dir(const char* theme_dir, GSList* themes)
     GDir* dir = g_dir_open(theme_dir, 0, NULL);
     if(dir)
     {
-        const char* name;
-        while(name = g_dir_read_name(dir))
+        const char* name = NULL;
+        while(name == g_dir_read_name(dir))
         {
             /* test if we already have this in list */
             if(!g_slist_find_custom(themes, name, (GCompareFunc)strcmp))