1 commit b093ed77fbab09bd474094898719ed6346d30d45
2 Author: Jeremy Huddleston <jeremyhu@apple.com>
3 Date: Sun Jan 22 22:01:07 2012 -0800
5 Build fix for int-pointer cast errors
7 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
9 diff --git a/src/XawIm.c b/src/XawIm.c
10 index b01f0d0..82a94b1 100644
13 @@ -141,14 +141,14 @@ SearchVendorShell(Widget w)
17 -static XContext extContext = (XContext)NULL;
18 +static XContext extContext = (XContext)0;
20 static XawVendorShellExtPart *
21 SetExtPart(VendorShellWidget w, XawVendorShellExtWidget vew)
23 contextDataRec *contextData;
25 - if (extContext == (XContext)NULL) extContext = XUniqueContext();
26 + if (extContext == (XContext)0) extContext = XUniqueContext();
28 contextData = XtNew(contextDataRec);
29 contextData->parent = (Widget)w;
30 @@ -252,14 +252,14 @@ ConfigureCB(Widget w, XtPointer closure, XEvent *event)
34 -static XContext errContext = (XContext)NULL;
35 +static XContext errContext = (XContext)0;
38 SetErrCnxt(Widget w, XIM xim)
40 contextErrDataRec *contextErrData;
42 - if (errContext == (XContext)NULL) errContext = XUniqueContext();
43 + if (errContext == (XContext)0) errContext = XUniqueContext();
45 contextErrData = XtNew(contextErrDataRec);
46 contextErrData->widget = w;
47 @@ -1321,12 +1321,12 @@ Destroy(Widget w, XawVendorShellExtPart *ve)
49 XtFree( (char*) ve->im.resources );
51 - if (extContext != (XContext)NULL &&
52 + if (extContext != (XContext)0 &&
53 !XFindContext (XtDisplay (w), (Window)w,
54 extContext, (XPointer*)&contextData))
55 XtFree( (char*) contextData );
57 - if (errContext != (XContext)NULL &&
58 + if (errContext != (XContext)0 &&
59 !XFindContext (XDisplayOfIM( ve->im.xim ), (Window) ve->im.xim,
60 errContext, (XPointer*) &contextErrData))
61 XtFree( (char*) contextErrData );
63 commit 702e4ff9f5fbfae4aecba09f8c735dc97bac1b59
64 Author: Jeremy Huddleston <jeremyhu@apple.com>
65 Date: Sun Jan 22 11:58:09 2012 -0800
67 Cleanup shadow declarations
69 Box.c:265:10: warning: declaration shadows a local variable [-Wshadow]
70 int i = bbw->composite.num_children;
72 Box.c:166:15: note: previous declaration is here
77 Form.c:809:9: warning: declaration shadows a local variable [-Wshadow]
80 Form.c:793:24: note: previous declaration is here
81 XawFormDoLayout(Widget w,
85 Viewport.c:627:24: warning: declaration shadows a local variable [-Wshadow]
86 if (!needshoriz) CheckHoriz();
88 Viewport.c:605:14: note: expanded from macro 'CheckHoriz'
89 Widget bar = w->viewport.horiz_bar; \
91 Viewport.c:620:14: note: previous declaration is here
92 Widget bar = w->viewport.vert_bar;
96 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
98 diff --git a/src/Box.c b/src/Box.c
99 index ccd52fd..43be5dc 100644
102 @@ -262,9 +262,9 @@ DoLayout(BoxWidget bbw, Dimension width, Dimension height,
103 if (bbw->composite.num_children == num_mapped_children)
104 XMapSubwindows( XtDisplay((Widget)bbw), XtWindow((Widget)bbw) );
106 - int i = bbw->composite.num_children;
107 + int j = bbw->composite.num_children;
108 Widget *childP = bbw->composite.children;
109 - for (; i > 0; childP++, i--)
110 + for (; j > 0; childP++, j--)
111 if (XtIsRealized(*childP) && XtIsManaged(*childP) &&
112 (*childP)->core.mapped_when_managed)
113 XtMapWidget(*childP);
114 diff --git a/src/Form.c b/src/Form.c
115 index 49fceb6..f078270 100644
118 @@ -790,7 +790,7 @@ PreferredGeometry(Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *re
122 -XawFormDoLayout(Widget w,
123 +XawFormDoLayout(Widget _fw,
124 #if NeedWidePrototypes
127 @@ -798,11 +798,11 @@ XawFormDoLayout(Widget w,
131 - FormWidget fw = (FormWidget)w;
132 + FormWidget fw = (FormWidget)_fw;
133 int num_children = fw->composite.num_children;
134 WidgetList children = fw->composite.children;
136 - if ( ((fw->form.no_refigure = !doit) == TRUE) || !XtIsRealized(w) )
137 + if ( ((fw->form.no_refigure = !doit) == TRUE) || !XtIsRealized(_fw) )
140 for (childP = children; childP - children < num_children; childP++) {
141 diff --git a/src/Viewport.c b/src/Viewport.c
142 index abb8961..a37a9a1 100644
145 @@ -602,12 +602,12 @@ ComputeLayout(Widget widget, Boolean query, Boolean destroy_scrollbars)
146 if (w->viewport.allowhoriz && \
147 (int)preferred.width > clip_width + 2 * sw) { \
149 - Widget bar = w->viewport.horiz_bar; \
150 + Widget horiz_bar = w->viewport.horiz_bar; \
152 - if (bar == (Widget)NULL) \
153 - bar = CreateScrollbar(w, True); \
154 - clip_height -= bar->core.height + \
155 - bar->core.border_width + pad; \
156 + if (horiz_bar == (Widget)NULL) \
157 + horiz_bar = CreateScrollbar(w, True); \
158 + clip_height -= horiz_bar->core.height + \
159 + horiz_bar->core.border_width + pad; \
160 if (clip_height < 1) clip_height = 1; \
162 intended.width = preferred.width; \
163 @@ -617,12 +617,12 @@ ComputeLayout(Widget widget, Boolean query, Boolean destroy_scrollbars)
164 if (w->viewport.allowvert &&
165 (int)preferred.height > clip_height + 2 * sw) {
167 - Widget bar = w->viewport.vert_bar;
168 + Widget vert_bar = w->viewport.vert_bar;
170 - if (bar == (Widget)NULL)
171 - bar = CreateScrollbar(w, False);
172 - clip_width -= bar->core.width +
173 - bar->core.border_width + pad;
174 + if (vert_bar == (Widget)NULL)
175 + vert_bar = CreateScrollbar(w, False);
176 + clip_width -= vert_bar->core.width +
177 + vert_bar->core.border_width + pad;
178 if (clip_width < 1) clip_width = 1;
179 if (!needshoriz) CheckHoriz();
182 commit d31153b30abd26c3f65e19d126ce4a3542cf14c0
183 Author: Jeremy Huddleston <jeremyhu@apple.com>
184 Date: Sun Jan 22 11:55:29 2012 -0800
186 Include <stdlib.h> for abs()
188 Tip.c:336:9: error: implicit declaration of function 'abs' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
189 ksy += abs(ext->max_ink_extent.y);
193 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
195 diff --git a/src/Tip.c b/src/Tip.c
196 index 6881670..5f54d14 100644
200 #include <X11/Xaw3d/TipP.h>
201 #include <X11/Xaw3d/XawInit.h>
205 #define TIP_EVENT_MASK (ButtonPressMask | \
206 ButtonReleaseMask | \
207 PointerMotionMask | \