From 0f61db83a4b02e947dff984d9b3a821c67935a5f Mon Sep 17 00:00:00 2001 From: handa Date: Thu, 30 Oct 2008 02:44:32 +0000 Subject: [PATCH] (update_scroll_bar): Use XawScrollbarSetThumb. (FilterProc): Fix strict aliasing bug. --- example/medit.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/example/medit.c b/example/medit.c index 6cb9389..fe6fad2 100644 --- a/example/medit.c +++ b/example/medit.c @@ -353,12 +353,8 @@ update_scroll_bar (int from, int to) { float top = (float) from / nchars; float shown = (float) (to - from) / nchars; - XtArgVal *l_top = (XtArgVal *) ⊤ - XtArgVal *l_shown = (XtArgVal *) &shown; - XtSetArg (arg[0], XtNtopOfThumb, *l_top); - XtSetArg (arg[1], XtNshown, *l_shown); - XtSetValues (SbarWidget, arg, 2); + XawScrollbarSetThumb (SbarWidget, top, shown); } @@ -1945,7 +1941,7 @@ FilterProc (Widget w, XtPointer client_data, XtPointer call_data) handle = dlopen (filter_module, RTLD_NOW); if (! handle) return; - *(void **) (&func) = dlsym (handle, "filter"); + func = (void (*) (MText *, int, int)) dlsym (handle, "filter"); if (func) (*func) (mt, mtext_property_start (selection), mtext_property_end (selection)); -- 1.7.10.4