diff options
author | Steve Zesch <[email protected]> | 2012-11-20 20:57:16 -0800 |
---|---|---|
committer | Steve Zesch <[email protected]> | 2012-11-20 20:57:16 -0800 |
commit | 3ba516419041962944da9f9bdf0cb55810a2ad02 (patch) | |
tree | 620d5fa2f8be7c9a65313c6a238cc349e6faaad4 | |
parent | d72b5f2a0bbd035a98979c3519de90a194f67e05 (diff) | |
parent | 3c82397d3fdbbaa8d1614a6f5eeeaad4ef20d3f6 (diff) | |
download | marco-3ba516419041962944da9f9bdf0cb55810a2ad02.tar.bz2 marco-3ba516419041962944da9f9bdf0cb55810a2ad02.tar.xz |
Merge pull request #26 from sbalneav/master
Deprecations and warnings
-rw-r--r-- | src/compositor/compositor-xrender.c | 10 | ||||
-rw-r--r-- | src/core/boxes.c | 2 | ||||
-rw-r--r-- | src/core/display.c | 4 | ||||
-rw-r--r-- | src/core/errors.c | 8 | ||||
-rw-r--r-- | src/core/keybindings.c | 4 | ||||
-rw-r--r-- | src/core/main.c | 12 | ||||
-rw-r--r-- | src/core/prefs.c | 35 | ||||
-rw-r--r-- | src/core/screen.c | 4 | ||||
-rw-r--r-- | src/core/testasyncgetprop.c | 8 | ||||
-rw-r--r-- | src/core/window.c | 14 | ||||
-rw-r--r-- | src/ui/testgradient.c | 8 | ||||
-rw-r--r-- | src/ui/themewidget.c | 8 |
12 files changed, 87 insertions, 30 deletions
diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c index f013eac8..805002e3 100644 --- a/src/compositor/compositor-xrender.c +++ b/src/compositor/compositor-xrender.c @@ -62,6 +62,12 @@ #define USE_IDLE_REPAINT 1 +#ifdef __GNUC__ +#define UNUSED_VARIABLE __attribute__ ((unused)) +#else +#define UNUSED_VARIABLE +#endif + #ifdef HAVE_COMPOSITE_EXTENSIONS static inline gboolean composite_at_least_version (MetaDisplay *display, @@ -1131,8 +1137,8 @@ paint_windows (MetaScreen *screen, MetaCompScreen *info = meta_screen_get_compositor_data (screen); Display *xdisplay = meta_display_get_xdisplay (display); GList *index, *last; - int screen_width, screen_height, screen_number; - Window xroot; + int screen_width, screen_height, UNUSED_VARIABLE screen_number; + Window UNUSED_VARIABLE xroot; MetaCompWindow *cw; XserverRegion paint_region, desktop_region; diff --git a/src/core/boxes.c b/src/core/boxes.c index dad6b470..877fa458 100644 --- a/src/core/boxes.c +++ b/src/core/boxes.c @@ -311,7 +311,6 @@ meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect, */ /* First, the x direction */ - int adjust = 0; switch (gravity) { case NorthWestGravity: @@ -344,7 +343,6 @@ meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect, rect->width = new_width; /* Next, the y direction */ - adjust = 0; switch (gravity) { case NorthWestGravity: diff --git a/src/core/display.c b/src/core/display.c index eccb5497..a66dfc9f 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -2805,7 +2805,11 @@ key_event_description (Display *xdisplay, KeySym keysym; const char *str; +#ifdef HAVE_XKB + keysym = XkbKeycodeToKeysym (xdisplay, event->xkey.keycode, 0, 0); +#else keysym = XKeycodeToKeysym (xdisplay, event->xkey.keycode, 0); +#endif str = XKeysymToString (keysym); diff --git a/src/core/errors.c b/src/core/errors.c index 6539d7b1..c603ccfd 100644 --- a/src/core/errors.c +++ b/src/core/errors.c @@ -29,6 +29,12 @@ #include <stdlib.h> #include <gdk/gdk.h> +#ifdef __GNUC__ +#define UNUSED_VARIABLE __attribute__ ((unused)) +#else +#define UNUSED_VARIABLE +#endif + static int x_error_handler (Display *display, XErrorEvent *error); static int x_io_error_handler (Display *display); @@ -121,7 +127,7 @@ meta_error_trap_pop_internal (MetaDisplay *display, * assumes that there are no pending GDK traps from GDK itself */ - int (* restored_error_handler) (Display *, + int UNUSED_VARIABLE (* restored_error_handler) (Display *, XErrorEvent *); restored_error_handler = XSetErrorHandler (x_error_handler); diff --git a/src/core/keybindings.c b/src/core/keybindings.c index 8dda13cd..07384b22 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -1273,7 +1273,11 @@ meta_display_process_key_event (MetaDisplay *display, /* window may be NULL */ +#ifdef HAVE_XKB + keysym = XkbKeycodeToKeysym (display->xdisplay, event->xkey.keycode, 0, 0); +#else keysym = XKeycodeToKeysym (display->xdisplay, event->xkey.keycode, 0); +#endif str = XKeysymToString (keysym); diff --git a/src/core/main.c b/src/core/main.c index 90332c50..5f8d9b32 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -69,6 +69,12 @@ #include <time.h> #include <unistd.h> +#ifdef __GNUC__ +#define UNUSED_VARIABLE __attribute__ ((unused)) +#else +#define UNUSED_VARIABLE +#endif + /** * The exit code we'll return to our parent process when we eventually die. */ @@ -376,7 +382,7 @@ sigterm_handler (int signum) { if (sigterm_pipe_fds[1] >= 0) { - int dummy; + int UNUSED_VARIABLE dummy; dummy = write (sigterm_pipe_fds[1], "", 1); close (sigterm_pipe_fds[1]); @@ -415,8 +421,12 @@ main (int argc, char **argv) guint i; GIOChannel *channel; +#if GLIB_CHECK_VERSION (2, 32, 0) + /* g_thread_init () deprecated */ +#else if (!g_thread_supported ()) g_thread_init (NULL); +#endif if (setlocale (LC_ALL, "") == NULL) meta_warning ("Locale not understood by C library, internationalization will not work\n"); diff --git a/src/core/prefs.c b/src/core/prefs.c index a39af335..a2cd3d76 100644 --- a/src/core/prefs.c +++ b/src/core/prefs.c @@ -143,7 +143,10 @@ static char* settings_key_for_workspace_name (int i); static void queue_changed (MetaPreference pref); +#if 0 static void cleanup_error (GError **error); +#endif + static void maybe_give_disable_workarounds_warning (void); static void titlebar_handler (MetaPreference, const gchar*, gboolean*); @@ -275,37 +278,37 @@ static MetaEnumPreference preferences_enum[] = { "focus-new-windows", KEY_GENERAL_SCHEMA, META_PREF_FOCUS_NEW_WINDOWS, - &focus_new_windows, + (gint *) &focus_new_windows, }, { "focus-mode", KEY_GENERAL_SCHEMA, META_PREF_FOCUS_MODE, - &focus_mode, + (gint *) &focus_mode, }, { "wrap-style", KEY_GENERAL_SCHEMA, META_PREF_WRAP_STYLE, - &wrap_style, + (gint *) &wrap_style, }, { "visual-bell-type", KEY_GENERAL_SCHEMA, META_PREF_VISUAL_BELL_TYPE, - &visual_bell_type, + (gint *) &visual_bell_type, }, { "action-double-click-titlebar", KEY_GENERAL_SCHEMA, META_PREF_ACTION_DOUBLE_CLICK_TITLEBAR, - &action_double_click_titlebar, + (gint *) &action_double_click_titlebar, }, { "action-middle-click-titlebar", KEY_GENERAL_SCHEMA, META_PREF_ACTION_MIDDLE_CLICK_TITLEBAR, - &action_middle_click_titlebar, + (gint *) &action_middle_click_titlebar, }, { "action-right-click-titlebar", KEY_GENERAL_SCHEMA, META_PREF_ACTION_RIGHT_CLICK_TITLEBAR, - &action_right_click_titlebar, + (gint *) &action_right_click_titlebar, }, { NULL, NULL, 0, NULL }, }; @@ -898,7 +901,7 @@ meta_prefs_init (void) /* Updates. */ /****************************************************************************/ -gboolean (*preference_update_handler[]) (const gchar*, GVariant*) = { +gboolean (*preference_update_handler[]) (const gchar*, GSettings*) = { handle_preference_update_enum, handle_preference_update_bool, handle_preference_update_string, @@ -975,6 +978,7 @@ change_notify (GSettings *settings, g_free (schema_name); } +#if 0 static void cleanup_error (GError **error) { @@ -986,6 +990,7 @@ cleanup_error (GError **error) *error = NULL; } } +#endif /** * Special case: give a warning the first time disable_workarounds @@ -1566,9 +1571,9 @@ init_bindings (void) NULL }; int i; - gchar **list; - gchar *str_val; - GSettings *bindings_settings; + gchar **list = NULL; + gchar *str_val = NULL; + GSettings *bindings_settings = NULL; for (i = 0; prefix[i]; i++) { @@ -1589,8 +1594,8 @@ init_bindings (void) static void init_commands (void) { - gchar **list; - gchar *str_val; + gchar **list = NULL; + gchar *str_val = NULL; list = g_settings_list_keys (settings_command); while (*list != NULL) @@ -1605,8 +1610,8 @@ init_commands (void) static void init_workspace_names (void) { - gchar **list; - gchar *str_val; + gchar **list = NULL; + gchar *str_val = NULL; list = g_settings_list_keys (settings_workspace_names); while (*list != NULL) diff --git a/src/core/screen.c b/src/core/screen.c index f696d92a..e8fce40a 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -1272,8 +1272,8 @@ meta_screen_ensure_tab_popup (MetaScreen *screen, { MetaWindow *window; MetaRectangle r; - GdkPixbuf *win_pixbuf; - int width, height; + GdkPixbuf *win_pixbuf = NULL; + int width = 0, height = 0; window = tmp->data; diff --git a/src/core/testasyncgetprop.c b/src/core/testasyncgetprop.c index ed044009..25490cb8 100644 --- a/src/core/testasyncgetprop.c +++ b/src/core/testasyncgetprop.c @@ -81,6 +81,12 @@ print_backtrace (void) } #endif +#ifdef __GNUC__ +#define UNUSED_VARIABLE __attribute__ ((unused)) +#else +#define UNUSED_VARIABLE +#endif + static int error_trap_depth = 0; static int @@ -416,7 +422,7 @@ run_speed_comparison (Display *xdisplay, while ((task = ag_get_next_completed_task (xdisplay))) { - int result; + int UNUSED_VARIABLE result; Atom actual_type; int actual_format; unsigned long n_items; diff --git a/src/core/window.c b/src/core/window.c index 06b6446f..bf1b53e4 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -53,6 +53,12 @@ #include <X11/extensions/shape.h> #endif +#ifdef __GNUC__ +#define UNUSED_VARIABLE __attribute__ ((unused)) +#else +#define UNUSED_VARIABLE +#endif + static int destroying_windows_disallowed = 0; @@ -5204,7 +5210,7 @@ meta_window_client_message (MetaWindow *window, else if (event->xclient.message_type == display->atom__NET_MOVERESIZE_WINDOW) { - int gravity, source; + int gravity, UNUSED_VARIABLE source; guint value_mask; gravity = (event->xclient.data.l[0] & 0xff); @@ -5252,7 +5258,7 @@ meta_window_client_message (MetaWindow *window, else if (event->xclient.message_type == display->atom__NET_WM_FULLSCREEN_MONITORS) { - MetaClientType source_indication; + MetaClientType UNUSED_VARIABLE source_indication; gulong top, bottom, left, right; meta_verbose ("_NET_WM_FULLSCREEN_MONITORS request for window '%s'\n", @@ -5463,7 +5469,7 @@ static gboolean process_property_notify (MetaWindow *window, XPropertyEvent *event) { - Window xid = window->xwindow; + Window UNUSED_VARIABLE xid = window->xwindow; if (meta_is_verbose ()) /* avoid looking up the name if we don't have to */ { @@ -6705,7 +6711,7 @@ meta_window_titlebar_is_onscreen (MetaWindow *window) { MetaRectangle titlebar_rect; GList *onscreen_region; - int titlebar_size; + int UNUSED_VARIABLE titlebar_size; gboolean is_onscreen; const int min_height_needed = 8; diff --git a/src/ui/testgradient.c b/src/ui/testgradient.c index 4def3b07..0de2510c 100644 --- a/src/ui/testgradient.c +++ b/src/ui/testgradient.c @@ -23,6 +23,12 @@ #include "gradient.h" #include <gtk/gtk.h> +#ifdef __GNUC__ +#define UNUSED_VARIABLE __attribute__ ((unused)) +#else +#define UNUSED_VARIABLE +#endif + typedef void (* RenderGradientFunc) (GdkDrawable *drawable, cairo_t *cr, int width, @@ -294,7 +300,7 @@ create_gradient_window (const char *title, static void meta_gradient_test (void) { - GtkWidget *window; + GtkWidget UNUSED_VARIABLE *window; window = create_gradient_window ("Simple vertical", render_vertical_func); diff --git a/src/ui/themewidget.c b/src/ui/themewidget.c index 6bbb05a1..3489618a 100644 --- a/src/ui/themewidget.c +++ b/src/ui/themewidget.c @@ -24,6 +24,12 @@ #include "themewidget.h" #include <math.h> +#ifdef __GNUC__ +#define UNUSED_VARIABLE __attribute__ ((unused)) +#else +#define UNUSED_VARIABLE +#endif + static void meta_area_class_init (MetaAreaClass *klass); static void meta_area_init (MetaArea *area); static void meta_area_size_request (GtkWidget *widget, @@ -64,7 +70,7 @@ static void meta_area_class_init (MetaAreaClass *class) { GObjectClass *gobject_class = G_OBJECT_CLASS (class); - GtkObjectClass *object_class; + GtkObjectClass UNUSED_VARIABLE *object_class; GtkWidgetClass *widget_class; object_class = (GtkObjectClass*) class; |