Article View: comp.windows.x
Article #37061Fix to bug in Xpostit
From: Geoffrey H. Cooper
Date: Tue, 20 Feb 1990 18:59
Date: Tue, 20 Feb 1990 18:59
25 lines
1159 bytes
1159 bytes
Xpostit was dying for me when I create a note. Found a "dangerous
macro" bug:
In note.c, MakeNoteWidget:
> if (app_res.scroll_bar)
> {
> SetArg(XtNscrollVertical, XawtextScrollAlways);
> }
> else
> SetArg(XtNscrollVertical, XawtextScrollWhenNeeded);
However, in xpostit.h:
#define SetArg(which, val) XtSetArg(args[nargs], (which),\
(XtArgVal) (val)); nargs++
^^^^^^^
This is clearly a buggy macro. You can fix it by putting the entire
macro in parentheses and changing the ; to a ,. Alternately, fix the
immediate problem by putting braces around the ELSE clause.
- Geof
--
geof@aurora.com / aurora!geof@decwrl.dec.com / geof%aurora.com@decwrl.dec.com
Technical Details
Message-ID:
<1990Feb20.185909.12114@aurora.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!jarthur!elroy.jpl.nasa.gov!decwrl!aurora!geofShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!jarthur!elroy.jpl.nasa.gov!decwrl!aurora!geof From: geof@aurora.com (Geoffrey H. Cooper) Newsgroups: comp.windows.x Subject: Fix to bug in Xpostit Message-ID: <1990Feb20.185909.12114@aurora.com> Date: 20 Feb 90 18:59:09 GMT Organization: The Aurora Group Lines: 25