From ea50cc7239c0f562ecf23d8f7a39e93f749c99bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Thu, 13 Apr 2006 13:16:42 +0000 Subject: [PATCH] *** empty log message *** --- ChangeLog | 21 +++++++++++++++++++++ src/async-getprop.c | 16 ++++++++-------- src/async-getprop.h | 2 +- src/display.h | 4 ++-- src/keybindings.c | 2 +- src/screen.c | 2 +- src/stack.c | 4 ++-- src/testasyncgetprop.c | 4 ++-- src/xprops.c | 12 ++++++------ 9 files changed, 44 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7ca73373b..1cf984d4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2006-04-13 Björn Lindqvist + + * src/async-getprop.c, src/async-getprop.h + (async_get_property_handler, ag_task_get_reply_and_free): + * src/testasyncgetprop.c (try_get_reply, run_speed_comparison): + Change unsigned chars to chars. + + * src/display.h (struct MetaDisplay): + * src/keybindings.c (reload_modmap): + Change unsigned ints to ints. + + * src/screen.c (set_workspace_names) + * src/stack.c (meta_stack_sync_to_server): + * src/xprops.c (utf8_string_from_results, utf8_list_from_results, + class_hint_from_results, meta_prop_get_values): + Introduce casts. + + Add a number of casts and change signedness on a number of + variables so that Metacity compiles with many fewer + warnings. Fixes #336032. + 2006-04-12 Elijah Newren Patch from Ron Yorston to add a focus_new_windows option. Default diff --git a/src/async-getprop.c b/src/async-getprop.c index d5a4b289c..60d6b3a92 100644 --- a/src/async-getprop.c +++ b/src/async-getprop.c @@ -66,7 +66,7 @@ struct _AgGetPropertyTask unsigned long n_items; unsigned long bytes_after; - unsigned char *data; + char *data; Bool have_reply; }; @@ -316,7 +316,7 @@ async_get_property_handler (Display *dpy, /* there's padding to word boundary */ netbytes = ALIGN_VALUE (nbytes, 4); if (nbytes + 1 > 0 && - (task->data = (unsigned char *) Xmalloc ((unsigned)nbytes + 1))) + (task->data = (char *) Xmalloc ((unsigned)nbytes + 1))) { #ifdef DEBUG_SPEW printf ("%s: already read %d bytes using %ld, more eating %ld more\n", @@ -334,7 +334,7 @@ async_get_property_handler (Display *dpy, netbytes = reply->nItems << 1; netbytes = ALIGN_VALUE (netbytes, 4); /* align to word boundary */ if (nbytes + 1 > 0 && - (task->data = (unsigned char *) Xmalloc ((unsigned)nbytes + 1))) + (task->data = (char *) Xmalloc ((unsigned)nbytes + 1))) { #ifdef DEBUG_SPEW printf ("%s: already read %d bytes using %ld more, eating %ld more\n", @@ -351,7 +351,7 @@ async_get_property_handler (Display *dpy, nbytes = reply->nItems * sizeof (long); netbytes = reply->nItems << 2; /* wire size is always 32 bits though */ if (nbytes + 1 > 0 && - (task->data = (unsigned char *) Xmalloc ((unsigned)nbytes + 1))) + (task->data = (char *) Xmalloc ((unsigned)nbytes + 1))) { #ifdef DEBUG_SPEW printf ("%s: already read %d bytes using %ld more, eating %ld more\n", @@ -363,9 +363,9 @@ async_get_property_handler (Display *dpy, */ if (sizeof (long) == 8) { - unsigned char *netdata; - unsigned char *lptr; - unsigned char *end_lptr; + char *netdata; + char *lptr; + char *end_lptr; /* Store the 32-bit values in the end of the array */ netdata = task->data + nbytes / 2; @@ -584,7 +584,7 @@ ag_task_get_reply_and_free (AgGetPropertyTask *task, int *actual_format, unsigned long *nitems, unsigned long *bytesafter, - unsigned char **prop) + char **prop) { Display *dpy; diff --git a/src/async-getprop.h b/src/async-getprop.h index f190900fc..15ac1feda 100644 --- a/src/async-getprop.h +++ b/src/async-getprop.h @@ -45,7 +45,7 @@ Status ag_task_get_reply_and_free (AgGetPropertyTask *task, int *actual_format, unsigned long *nitems, unsigned long *bytesafter, - unsigned char **prop); + char **prop); Bool ag_task_have_reply (AgGetPropertyTask *task); Atom ag_task_get_property (AgGetPropertyTask *task); diff --git a/src/display.h b/src/display.h index 5de5577f7..361edf719 100644 --- a/src/display.h +++ b/src/display.h @@ -295,8 +295,8 @@ struct _MetaDisplay int n_screen_bindings; MetaKeyBinding *window_bindings; int n_window_bindings; - unsigned int min_keycode; - unsigned int max_keycode; + int min_keycode; + int max_keycode; KeySym *keymap; int keysyms_per_keycode; XModifierKeymap *modmap; diff --git a/src/keybindings.c b/src/keybindings.c index 541b18676..d48e5ec46 100644 --- a/src/keybindings.c +++ b/src/keybindings.c @@ -465,7 +465,7 @@ reload_modmap (MetaDisplay *display) /* get the key code at this point in the map, * see if its keysym is one we're interested in */ - unsigned int keycode = modmap->modifiermap[i]; + int keycode = modmap->modifiermap[i]; if (keycode >= display->min_keycode && keycode <= display->max_keycode) diff --git a/src/screen.c b/src/screen.c index 0347344e2..bde2f7f95 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1760,7 +1760,7 @@ set_workspace_names (MetaScreen *screen) screen->display->atom_net_desktop_names, screen->display->atom_utf8_string, 8, PropModeReplace, - flattened->str, flattened->len); + (unsigned char *)flattened->str, flattened->len); meta_error_trap_pop (screen->display, FALSE); g_string_free (flattened, TRUE); diff --git a/src/stack.c b/src/stack.c index bf834b4c7..ad6c038c2 100644 --- a/src/stack.c +++ b/src/stack.c @@ -1196,14 +1196,14 @@ meta_stack_sync_to_server (MetaStack *stack) stack->screen->display->atom_net_client_list, XA_WINDOW, 32, PropModeReplace, - stack->windows->data, + (unsigned char *)stack->windows->data, stack->windows->len); XChangeProperty (stack->screen->display->xdisplay, stack->screen->xroot, stack->screen->display->atom_net_client_list_stacking, XA_WINDOW, 32, PropModeReplace, - stacked->data, + (unsigned char *)stacked->data, stacked->len); g_array_free (stacked, TRUE); diff --git a/src/testasyncgetprop.c b/src/testasyncgetprop.c index 195afd16d..702c1f327 100644 --- a/src/testasyncgetprop.c +++ b/src/testasyncgetprop.c @@ -185,7 +185,7 @@ try_get_reply (Display *xdisplay, int actual_format; unsigned long n_items; unsigned long bytes_after; - unsigned char *data; + char *data; char *name; struct timeval current_time; @@ -419,7 +419,7 @@ run_speed_comparison (Display *xdisplay, int actual_format; unsigned long n_items; unsigned long bytes_after; - unsigned char *data; + char *data; assert (ag_task_have_reply (task)); diff --git a/src/xprops.c b/src/xprops.c index 7f1ba70c7..7a9158566 100644 --- a/src/xprops.c +++ b/src/xprops.c @@ -391,7 +391,7 @@ utf8_string_from_results (GetPropertyResults *results, return FALSE; if (results->n_items > 0 && - !g_utf8_validate (results->prop, results->n_items, NULL)) + !g_utf8_validate ((gchar *)results->prop, results->n_items, NULL)) { char *name; @@ -468,7 +468,7 @@ utf8_list_from_results (GetPropertyResults *results, retval = g_new0 (char*, n_strings + 1); - p = results->prop; + p = (char *)results->prop; i = 0; while (i < n_strings) { @@ -784,12 +784,12 @@ class_hint_from_results (GetPropertyResults *results, return FALSE; } - strcpy (class_hint->res_name, results->prop); + strcpy (class_hint->res_name, (char *)results->prop); if (len_name == (int) results->n_items) len_name--; - len_class = strlen (results->prop + len_name + 1); + len_class = strlen ((char *)results->prop + len_name + 1); if (! (class_hint->res_class = ag_Xmalloc(len_class+1))) { @@ -800,7 +800,7 @@ class_hint_from_results (GetPropertyResults *results, return FALSE; } - strcpy (class_hint->res_class, results->prop + len_name + 1); + strcpy (class_hint->res_class, (char *)results->prop + len_name + 1); XFree (results->prop); results->prop = NULL; @@ -1050,7 +1050,7 @@ meta_prop_get_values (MetaDisplay *display, &results.type, &results.format, &results.n_items, &results.bytes_after, - (guchar **)&results.prop) != Success || + (gchar **)&results.prop) != Success || results.type == None) { values[i].type = META_PROP_VALUE_INVALID;