diff --git a/ChangeLog b/ChangeLog index eb9388bbe..3a1d0f87b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +2004-09-17 Kjartan Maraas + + * src/bell.c: (meta_bell_flash_screen): + * src/compositor.c: + * src/effects.c: (meta_effects_draw_box_animation): + * src/fixedtip.c: (meta_fixed_tip_show): + * src/frame.c: (find_argb_visual): + * src/frames.c: (unsigned_long_hash), (meta_frames_manage_window), + (meta_frames_apply_shapes): + * src/iconcache.c: (find_largest_sizes), (find_best_size): + * src/keybindings.c: (meta_spawn_command_line_async_on_screen): + * src/main.c: (main): + * src/menu.c: (meta_window_menu_new): + * src/prefs.c: (meta_prefs_get_visual_bell), + (meta_prefs_bell_is_audible), (meta_prefs_get_visual_bell_type), + (meta_prefs_get_action_double_click_titlebar), + (meta_prefs_get_auto_raise), (meta_prefs_get_auto_raise_delay), + (meta_prefs_get_reduced_resources): + * src/screen.c: (meta_create_offscreen_window): + * src/tabpopup.c: (meta_ui_tab_popup_get_selected): + * src/theme-parser.c: (meta_theme_load): + * src/theme.c: (meta_gtk_widget_get_font_desc): + * src/tools/metacity-mag.c: (mouse_press), (begin_area_grab): + * src/util.c: (meta_unsigned_long_hash): A load of fixes of issues + reported by sparse. Closes bug #152849 + 2004-09-15 Elijah Newren * src/display.c (event_callback): Remove some redundant code diff --git a/src/bell.c b/src/bell.c index ff01bb5f2..a8a1027d5 100644 --- a/src/bell.c +++ b/src/bell.c @@ -34,7 +34,7 @@ meta_bell_flash_screen (MetaDisplay *display, if (screen->flash_window == None) { - Visual *visual = CopyFromParent; + Visual *visual = (Visual *)CopyFromParent; XSetWindowAttributes xswa; int depth = CopyFromParent; xswa.save_under = True; diff --git a/src/compositor.c b/src/compositor.c index f31699466..d82fadbff 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -100,7 +100,7 @@ struct MetaCompositor guint have_composite : 1; guint have_damage : 1; guint have_fixes : 1; -#if HAVE_NAME_WINDOW_PIXMAP +#ifdef HAVE_NAME_WINDOW_PIXMAP guint have_name_window_pixmap : 1; #endif }; diff --git a/src/effects.c b/src/effects.c index e361c091e..0f5ccd4f3 100644 --- a/src/effects.c +++ b/src/effects.c @@ -382,7 +382,7 @@ meta_effects_draw_box_animation (MetaScreen *screen, 0, CopyFromParent, CopyFromParent, - CopyFromParent, + (Visual *)CopyFromParent, CWOverrideRedirect | CWBackPixel, &attrs); diff --git a/src/fixedtip.c b/src/fixedtip.c index 047b0d14c..99caa3016 100644 --- a/src/fixedtip.c +++ b/src/fixedtip.c @@ -64,10 +64,8 @@ meta_fixed_tip_show (Display *xdisplay, int screen_number, gtk_widget_set_name (tip, "gtk-tooltips"); gtk_container_set_border_width (GTK_CONTAINER (tip), 4); - gtk_signal_connect_object (GTK_OBJECT (tip), - "expose_event", - GTK_SIGNAL_FUNC (expose_handler), - NULL); + g_signal_connect_swapped (tip, "expose_event", + G_CALLBACK (expose_handler), NULL); label = gtk_label_new (NULL); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); @@ -76,10 +74,8 @@ meta_fixed_tip_show (Display *xdisplay, int screen_number, gtk_container_add (GTK_CONTAINER (tip), label); - gtk_signal_connect (GTK_OBJECT (tip), - "destroy", - GTK_SIGNAL_FUNC (gtk_widget_destroyed), - &tip); + g_signal_connect (tip, "destroy", + G_CALLBACK (gtk_widget_destroyed), &tip); } gtk_label_set_markup (GTK_LABEL (label), markup_text); diff --git a/src/frame.c b/src/frame.c index 42f3cd0f1..b381c8586 100644 --- a/src/frame.c +++ b/src/frame.c @@ -63,7 +63,7 @@ find_argb_visual (MetaDisplay *display, &template, &nvi); if (!xvi) - return 0; + return NULL; visual = NULL; diff --git a/src/frames.c b/src/frames.c index 7d7353a90..f37dfd19f 100644 --- a/src/frames.c +++ b/src/frames.c @@ -159,7 +159,7 @@ unsigned_long_hash (gconstpointer v) gulong val = * (const gulong *) v; /* I'm not sure this works so well. */ -#if G_SIZEOF_LONG > 4 +#if GLIB_SIZEOF_LONG > 4 return (guint) (val ^ (val >> 32)); #else return val; @@ -472,7 +472,6 @@ meta_frames_manage_window (MetaFrames *frames, GdkWindow *window) { MetaUIFrame *frame; - GdkColor col; g_assert (window); @@ -853,7 +852,7 @@ meta_frames_apply_shapes (MetaFrames *frames, 0, CopyFromParent, CopyFromParent, - CopyFromParent, + (Visual *)CopyFromParent, CWOverrideRedirect, &attrs); diff --git a/src/iconcache.c b/src/iconcache.c index b6e4aff14..0be581bf1 100644 --- a/src/iconcache.c +++ b/src/iconcache.c @@ -66,7 +66,7 @@ find_largest_sizes (gulong *data, w = data[0]; h = data[1]; - if (nitems < ((w * h) + 2)) + if (nitems < ((gulong)(w * h) + 2)) return FALSE; /* not enough data */ *width = MAX (w, *width); @@ -122,7 +122,7 @@ find_best_size (gulong *data, w = data[0]; h = data[1]; - if (nitems < ((w * h) + 2)) + if (nitems < ((gulong)(w * h) + 2)) break; /* not enough data */ if (best_start == NULL) diff --git a/src/keybindings.c b/src/keybindings.c index 19316a2d7..e0038792c 100644 --- a/src/keybindings.c +++ b/src/keybindings.c @@ -2553,7 +2553,7 @@ meta_spawn_command_line_async_on_screen (const gchar *command_line, GError **error) { gboolean retval; - gchar **argv = 0; + gchar **argv = NULL; g_return_val_if_fail (command_line != NULL, FALSE); @@ -3379,6 +3379,7 @@ handle_workspace_switch (MetaDisplay *display, } } +#if 0 static void handle_spew_mark (MetaDisplay *display, MetaScreen *screen, @@ -3388,6 +3389,7 @@ handle_spew_mark (MetaDisplay *display, { meta_verbose ("-- MARK MARK MARK MARK --\n"); } +#endif void meta_set_keybindings_disabled (gboolean setting) diff --git a/src/main.c b/src/main.c index 289bbd12d..fd4fcb74c 100644 --- a/src/main.c +++ b/src/main.c @@ -186,11 +186,11 @@ main (int argc, char **argv) act.sa_handler = SIG_IGN; act.sa_mask = empty_mask; act.sa_flags = 0; - if (sigaction (SIGPIPE, &act, 0) < 0) + if (sigaction (SIGPIPE, &act, NULL) < 0) g_printerr ("Failed to register SIGPIPE handler: %s\n", g_strerror (errno)); #ifdef SIGXFSZ - if (sigaction (SIGXFSZ, &act, 0) < 0) + if (sigaction (SIGXFSZ, &act, NULL) < 0) g_printerr ("Failed to register SIGXFSZ handler: %s\n", g_strerror (errno)); #endif diff --git a/src/menu.c b/src/menu.c index 9520576ae..d96936e2d 100644 --- a/src/menu.c +++ b/src/menu.c @@ -421,10 +421,8 @@ meta_window_menu_new (MetaFrames *frames, else meta_verbose ("not creating workspace menu\n"); - gtk_signal_connect (GTK_OBJECT (menu->menu), - "selection_done", - GTK_SIGNAL_FUNC (menu_closed), - menu); + g_signal_connect (menu->menu, "selection_done", + G_CALLBACK (menu_closed), menu); return menu; } diff --git a/src/prefs.c b/src/prefs.c index 1166f51b8..df6168d73 100644 --- a/src/prefs.c +++ b/src/prefs.c @@ -1975,19 +1975,19 @@ meta_prefs_get_button_layout (MetaButtonLayout *button_layout_p) } gboolean -meta_prefs_get_visual_bell () +meta_prefs_get_visual_bell (void) { return provide_visual_bell; } gboolean -meta_prefs_bell_is_audible () +meta_prefs_bell_is_audible (void) { return bell_is_audible; } MetaVisualBellType -meta_prefs_get_visual_bell_type () +meta_prefs_get_visual_bell_type (void) { return visual_bell_type; } @@ -2010,25 +2010,25 @@ meta_prefs_get_window_bindings (const MetaKeyPref **bindings, } MetaActionDoubleClickTitlebar -meta_prefs_get_action_double_click_titlebar () +meta_prefs_get_action_double_click_titlebar (void) { return action_double_click_titlebar; } gboolean -meta_prefs_get_auto_raise () +meta_prefs_get_auto_raise (void) { return auto_raise; } int -meta_prefs_get_auto_raise_delay () +meta_prefs_get_auto_raise_delay (void) { return auto_raise_delay; } gboolean -meta_prefs_get_reduced_resources () +meta_prefs_get_reduced_resources (void) { return reduced_resources; } diff --git a/src/screen.c b/src/screen.c index 695c335b5..9116aae24 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1769,7 +1769,7 @@ meta_create_offscreen_window (Display *xdisplay, 0, CopyFromParent, CopyFromParent, - CopyFromParent, + (Visual *)CopyFromParent, CWOverrideRedirect | CWEventMask, &attrs); } diff --git a/src/tabpopup.c b/src/tabpopup.c index 3f8256691..e40746206 100644 --- a/src/tabpopup.c +++ b/src/tabpopup.c @@ -473,7 +473,7 @@ meta_ui_tab_popup_get_selected (MetaTabPopup *popup) return te->key; } else - return None; + return (MetaTabEntryKey)None; } void diff --git a/src/theme-parser.c b/src/theme-parser.c index 8ff0a07b1..7eb614509 100644 --- a/src/theme-parser.c +++ b/src/theme-parser.c @@ -4350,7 +4350,7 @@ meta_theme_load (const char *theme_name, g_propagate_error (err, error); g_free (theme_file); g_free (theme_dir); - return FALSE; /* all fallbacks failed */ + return NULL; /* all fallbacks failed */ } } diff --git a/src/theme.c b/src/theme.c index 4f3d25901..bc520a56f 100644 --- a/src/theme.c +++ b/src/theme.c @@ -1602,6 +1602,7 @@ pos_tokenize (const char *expr, return FALSE; } +#if 0 static void debug_print_tokens (PosToken *tokens, int n_tokens) @@ -1642,6 +1643,7 @@ debug_print_tokens (PosToken *tokens, g_print ("\n"); } +#endif typedef enum { @@ -1661,6 +1663,7 @@ typedef struct } d; } PosExpr; +#if 0 static void debug_print_exprs (PosExpr *exprs, int n_exprs) @@ -1687,6 +1690,7 @@ debug_print_exprs (PosExpr *exprs, } g_print ("\n"); } +#endif static gboolean do_operation (PosExpr *a, @@ -5157,7 +5161,7 @@ meta_gtk_widget_get_font_desc (GtkWidget *widget, { PangoFontDescription *font_desc; - g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), 0); + g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL); font_desc = pango_font_description_copy (widget->style->font_desc); diff --git a/src/tools/metacity-mag.c b/src/tools/metacity-mag.c index 1e00effb5..95498967d 100644 --- a/src/tools/metacity-mag.c +++ b/src/tools/metacity-mag.c @@ -211,12 +211,10 @@ mouse_press (GtkWidget *invisible, if (event->type == GDK_BUTTON_PRESS && event->button == 1) { - gtk_signal_connect (GTK_OBJECT (invisible), "motion_notify_event", - GTK_SIGNAL_FUNC (mouse_motion), - NULL); - gtk_signal_connect (GTK_OBJECT (invisible), "button_release_event", - GTK_SIGNAL_FUNC (mouse_release), - NULL); + g_signal_connect (invisible, "motion_notify_event", + G_CALLBACK (mouse_motion), NULL); + g_signal_connect (invisible, "button_release_event", + G_CALLBACK (mouse_release), NULL); gtk_signal_disconnect_by_func (GTK_OBJECT (invisible), GTK_SIGNAL_FUNC (mouse_press), NULL); @@ -264,10 +262,10 @@ begin_area_grab (void) gtk_grab_add (grab_widget); - gtk_signal_connect (GTK_OBJECT (grab_widget), "button_press_event", - GTK_SIGNAL_FUNC (mouse_press), NULL); - gtk_signal_connect (GTK_OBJECT (grab_widget), "key_press_event", - GTK_SIGNAL_FUNC (key_press), NULL); + g_signal_connect (grab_widget, "button_press_event", + G_CALLBACK (mouse_press), NULL); + g_signal_connect (grab_widget, "key_press_event", + G_CALLBACK (key_press), NULL); } int diff --git a/src/util.c b/src/util.c index 96e720a00..c4d59f267 100644 --- a/src/util.c +++ b/src/util.c @@ -443,7 +443,7 @@ meta_unsigned_long_hash (gconstpointer v) gulong val = * (const gulong *) v; /* I'm not sure this works so well. */ -#if G_SIZEOF_LONG > 4 +#if GLIB_SIZEOF_LONG > 4 return (guint) (val ^ (val >> 32)); #else return val;