diff options
author | Jan D <jan.h.d@swipnet.se> | 2010-07-05 11:17:12 +0200 |
---|---|---|
committer | Jan D <jan.h.d@swipnet.se> | 2010-07-05 11:17:12 +0200 |
commit | e4c8d29a32adbde811a109d5e19caa75fd9d042b (patch) | |
tree | ffaa67180bd87eae947408a76cddecaaa1c227b0 /lwlib/lwlib-Xaw.c | |
parent | 898b4c5c2cb4b4ae2fa2cd1631db63a9acff787a (diff) | |
download | emacs-e4c8d29a32adbde811a109d5e19caa75fd9d042b.tar.gz emacs-e4c8d29a32adbde811a109d5e19caa75fd9d042b.tar.bz2 emacs-e4c8d29a32adbde811a109d5e19caa75fd9d042b.zip |
Fix some bad prototypes and formatting after conversion from K&R declaration.
* lwlib/lwlib-Xaw.c: Include <ctype.h> for isdigit.
(fill_xft_data, set_text): Remove unused variable screen.
(draw_text): Cast bp to FcChar8*.
(find_xft_data): Return 0 if inst or xft_data is not set.
(wm_delete_window): Correct prototype. Initialize widget to 0
and return if widget is still 0 after loop.
* lwlib/xlwmenu.c (XlwMenuSetValues, XlwMenuInitialize): Correct prototype.
(display_menu_item): Remove unused variable gi.
(make_windows_if_needed): Remove unused variable screen.
(XlwMenuRedisplay): Remove unused variable i.
* src/gtkutil.c (xg_get_pixbuf_from_pix_and_mask)
(xg_get_image_for_pixmap, create_dialog)
(xg_get_file_with_selection, xg_get_file_name, update_cl_data)
(menuitem_highlight_callback, make_menu_item)
(xg_create_one_menuitem, create_menus, xg_update_menu_item)
(xg_create_scroll_bar, xg_update_scrollbar_pos)
(xg_set_toolkit_scroll_bar_thumb, xg_tool_bar_button_cb)
(xg_tool_bar_proxy_help_callback, xg_tool_bar_detach_callback)
(xg_tool_bar_attach_callback, xg_tool_bar_help_callback)
(xg_tool_bar_item_expose_callback): Reformat prototype.
(xg_update_menubar): GList *group => GSList *group.
(xg_modify_menubar_widgets): Initialize witem to 0, check witem != 0
before use.
(update_frame_tool_bar): 4:th param to xg_get_image_for_pixmap changed
to GTK_IMAGE (wimage).
* src/xsettings.c (something_changedCB, parse_settings)
(apply_xft_settings): Reformat prototype.
(something_changedCB, init_gconf): Remove unused variable i.
(read_settings): Remove unused variable long_len.
* src/xsmfns.c (SSDATA): New macro.
(smc_save_yourself_CB, x_session_initialize): Use SSDATA for strings
passed to strlen/strcpy/strcat.
(create_client_leader_window): Surround with #ifndef USE_GTK. Cast
7:th arg to XChangeProperty to (unsigned char *)
Diffstat (limited to 'lwlib/lwlib-Xaw.c')
-rw-r--r-- | lwlib/lwlib-Xaw.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/lwlib/lwlib-Xaw.c b/lwlib/lwlib-Xaw.c index 3ac72acdace..632ba7153ae 100644 --- a/lwlib/lwlib-Xaw.c +++ b/lwlib/lwlib-Xaw.c @@ -26,6 +26,7 @@ Boston, MA 02110-1301, USA. */ #include <stdio.h> #include <setjmp.h> +#include <ctype.h> #include "../src/lisp.h" @@ -151,7 +152,6 @@ fill_xft_data (struct widget_xft_data *data, Widget widget, XftFont *font) { Pixel bg, fg; XColor colors[2]; - int screen = XScreenNumberOfScreen (XtScreen (widget)); data->widget = widget; data->xft_font = font; @@ -252,7 +252,9 @@ draw_text (struct widget_xft_data *data, char *lbl, int inverse) char *cp = strchr (bp, '\n'); XftDrawStringUtf8 (data->xft_draw, inverse ? &data->xft_bg : &data->xft_fg, - data->xft_font, x, y, bp, cp ? cp - bp : strlen (bp)); + data->xft_font, x, y, + (FcChar8 *) bp, + cp ? cp - bp : strlen (bp)); bp = cp ? cp + 1 : NULL; /* 1.2 gives reasonable line spacing. */ y += data->xft_font->height * 1.2; @@ -264,7 +266,6 @@ draw_text (struct widget_xft_data *data, char *lbl, int inverse) static void set_text (struct widget_xft_data *data, Widget toplevel, char *lbl, int margin) { - int screen = XScreenNumberOfScreen (XtScreen (data->widget)); int width, height; width = get_text_width_and_height (data->widget, lbl, data->xft_font, @@ -293,7 +294,7 @@ find_xft_data (Widget widget) inst = lw_get_widget_instance (parent); parent = XtParent (parent); } - if (!inst || !inst->xft_data || !inst->xft_data[0].xft_font) return; + if (!inst || !inst->xft_data || !inst->xft_data[0].xft_font) return 0; for (nr = 0; data == NULL && nr < inst->nr_xft_data; ++nr) { @@ -550,7 +551,10 @@ static char overrideTrans[] = /* Dialogs pop down on any key press */ static char dialogOverride[] = "<KeyPress>Escape: lwlib_delete_dialog()"; -static void wm_delete_window(Widget w, XtPointer closure, XtPointer call_data); +static void wm_delete_window (Widget w, + XEvent *event, + String *params, + Cardinal *num_params); static XtActionsRec xaw_actions [] = { {"lwlib_delete_dialog", wm_delete_window} }; @@ -851,13 +855,16 @@ xaw_generic_callback (Widget widget, XtPointer closure, XtPointer call_data) } static void -wm_delete_window (Widget w, XtPointer closure, XtPointer call_data) +wm_delete_window (Widget w, + XEvent *event, + String *params, + Cardinal *num_params) { LWLIB_ID id; Cardinal nkids; int i; Widget *kids = 0; - Widget widget, shell; + Widget widget = 0, shell; if (XtIsSubclass (w, dialogWidgetClass)) shell = XtParent (w); @@ -876,6 +883,8 @@ wm_delete_window (Widget w, XtPointer closure, XtPointer call_data) if (XtIsSubclass (widget, dialogWidgetClass)) break; } + if (! widget) return; + id = lw_get_widget_id (widget); if (! id) abort (); |