diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2024-02-28 16:30:11 -0500 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2024-02-28 20:48:23 -0500 |
commit | 5c23a1f5e5b0961a0938a8f3da1c9ad01fe67af7 (patch) | |
tree | 99bf546eb0df7050c9b8d1cbe1ca1025445ccac6 | |
parent | 239a9d1f8fa2655a5ebc53de00e3311ae1413e33 (diff) |
build-fix
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
-rw-r--r-- | src/Actions.c | 6 | ||||
-rw-r--r-- | src/AsciiSink.c | 3 | ||||
-rw-r--r-- | src/AsciiSrc.c | 8 | ||||
-rw-r--r-- | src/Command.c | 3 | ||||
-rw-r--r-- | src/Dialog.c | 3 | ||||
-rw-r--r-- | src/DisplayList.c | 10 | ||||
-rw-r--r-- | src/Label.c | 5 | ||||
-rw-r--r-- | src/List.c | 3 | ||||
-rw-r--r-- | src/MultiSrc.c | 3 | ||||
-rw-r--r-- | src/SimpleMenu.c | 4 | ||||
-rw-r--r-- | src/StripChart.c | 5 | ||||
-rw-r--r-- | src/Text.c | 6 | ||||
-rw-r--r-- | src/TextSrc.c | 3 | ||||
-rw-r--r-- | src/Tree.c | 22 |
14 files changed, 55 insertions, 29 deletions
diff --git a/src/Actions.c b/src/Actions.c index 3dd2d78..203251b 100644 --- a/src/Actions.c +++ b/src/Actions.c @@ -502,6 +502,7 @@ XawGetValuesAction(Widget w, XEvent *event, { XawActionResList *rlist; XawActionVarList *vlist; + Cardinal count; if (!(*num_params & 1)) { @@ -514,7 +515,7 @@ XawGetValuesAction(Widget w, XEvent *event, rlist = XawGetActionResList(XtClass(w)); vlist = XawGetActionVarList(w); - for (Cardinal count = 1; count < *num_params; count += 2) + for (count = 1; count < *num_params; count += 2) { String value = XawConvertActionRes(rlist, w, params[count + 1]); if (value == NULL) @@ -528,6 +529,7 @@ XawDeclareAction(Widget w, XEvent *event, String *params, Cardinal *num_params) { XawActionVarList *vlist; + Cardinal count; if (!(*num_params & 1)) { @@ -539,7 +541,7 @@ XawDeclareAction(Widget w, XEvent *event, vlist = XawGetActionVarList(w); - for (Cardinal count = 1; count < *num_params; count += 2) + for (count = 1; count < *num_params; count += 2) XawDeclareActionVar(vlist, params[count], params[count + 1]); } diff --git a/src/AsciiSink.c b/src/AsciiSink.c index ac2d78f..d0d5d3d 100644 --- a/src/AsciiSink.c +++ b/src/AsciiSink.c @@ -299,12 +299,13 @@ GetTextWidth(TextWidget ctx, int current_width, XFontStruct *font, int width = 0; XawTextBlock block; XawTextPosition pos = from; + int i; while (length > 0) { pos = XawTextSourceRead(ctx->text.source, from, &block, length); length = (int)(length - (pos - from)); from = pos; - for (int i = 0; i < block.length; i++) + for (i = 0; i < block.length; i++) width += CharWidth((AsciiSinkObject)ctx->text.sink, font, current_width + width, (unsigned char)block.ptr[i]); diff --git a/src/AsciiSrc.c b/src/AsciiSrc.c index 0ce721b..0248617 100644 --- a/src/AsciiSrc.c +++ b/src/AsciiSrc.c @@ -977,6 +977,7 @@ XawAsciiSrcSetValues(Widget current, Widget request _X_UNUSED, Widget cnew, AsciiSrcObject src = (AsciiSrcObject)cnew; AsciiSrcObject old_src = (AsciiSrcObject)current; Bool total_reset = False, string_set = False; + Cardinal i; if (old_src->ascii_src.use_string_in_place != src->ascii_src.use_string_in_place) { @@ -987,7 +988,7 @@ XawAsciiSrcSetValues(Widget current, Widget request _X_UNUSED, Widget cnew, old_src->ascii_src.use_string_in_place; } - for (unsigned int i = 0; i < *num_args ; i++) + for (i = 0; i < *num_args ; i++) if (streq(args[i].name, XtNstring)) { string_set = True; break; @@ -1002,7 +1003,7 @@ XawAsciiSrcSetValues(Widget current, Widget request _X_UNUSED, Widget cnew, if (file != NULL) fclose(file); #ifndef OLDXAW - for (unsigned int i = 0; i < src->text_src.num_text; i++) + for (i = 0; i < src->text_src.num_text; i++) /* Tell text widget what happened */ XawTextSetSource(src->text_src.text[i], cnew, 0); #else @@ -1043,9 +1044,10 @@ static void XawAsciiSrcGetValuesHook(Widget w, ArgList args, Cardinal *num_args) { AsciiSrcObject src = (AsciiSrcObject)w; + Cardinal i; if (src->ascii_src.type == XawAsciiString) { - for (unsigned int i = 0; i < *num_args ; i++) + for (i = 0; i < *num_args ; i++) if (streq(args[i].name, XtNstring)) { if (src->ascii_src.use_string_in_place) *((char **)args[i].value) = src->ascii_src.first_piece->text; diff --git a/src/Command.c b/src/Command.c index 8417f9d..053a1f4 100644 --- a/src/Command.c +++ b/src/Command.c @@ -562,8 +562,9 @@ static void XawCommandGetValuesHook(Widget w, ArgList args, Cardinal *num_args) { CommandWidget cbw = (CommandWidget)w; + Cardinal i; - for (unsigned int i = 0; i < *num_args; i++) { + for (i = 0; i < *num_args; i++) { if (STR_EQUAL(args[i].name, XtNforeground)) *((String*)args[i].value) = cbw->command.set ? (String)cbw->core.background_pixel : (String)cbw->label.foreground; diff --git a/src/Dialog.c b/src/Dialog.c index 0e193fb..c285b10 100644 --- a/src/Dialog.c +++ b/src/Dialog.c @@ -359,8 +359,9 @@ XawDialogGetValuesHook(Widget w, ArgList args, Cardinal *num_args) Arg a[1]; char * s; DialogWidget src = (DialogWidget)w; + Cardinal i; - for (unsigned int i = 0; i < *num_args; i++) { + for (i = 0; i < *num_args; i++) { if (streq(args[i].name, XtNvalue)) { XtSetArg(a[0], XtNstring, &s); XtGetValues(src->dialog.valueW, a, 1); diff --git a/src/DisplayList.c b/src/DisplayList.c index 936c3a8..ed4fbc8 100644 --- a/src/DisplayList.c +++ b/src/DisplayList.c @@ -122,10 +122,12 @@ void XawRunDisplayList(Widget w, _XawDisplayList *list, XEvent *event, Region region) { + Cardinal i; + if (!XtIsRealized(w)) return; - for (Cardinal i = 0; i < list->num_procs; i++) + for (i = 0; i < list->num_procs; i++) { XawDLProc *proc = list->procs[i]; proc->proc(w, proc->args, proc->data->data, event, region); @@ -445,10 +447,12 @@ XawDisplayListString(_XawDisplayList *dlist) void XawDestroyDisplayList(_XawDisplayList *dlist) { + Cardinal i, j; + if (!dlist) return; - for (Cardinal i = 0; i < dlist->num_procs; i++) + for (i = 0; i < dlist->num_procs; i++) { XawDLProc *proc = dlist->procs[i]; XawDLData *data = proc->data; @@ -472,7 +476,7 @@ XawDestroyDisplayList(_XawDisplayList *dlist) } } - for (Cardinal j = 0; j < proc->num_params; j++) + for (j = 0; j < proc->num_params; j++) XtFree((char *)proc->params[j]); if (proc->num_params) XtFree((char *)proc->params); diff --git a/src/Label.c b/src/Label.c index fd37881..f8bad69 100644 --- a/src/Label.c +++ b/src/Label.c @@ -645,11 +645,12 @@ XawLabelSetValues(Widget current, Widget request, Widget cnew, LabelWidget reqlw = (LabelWidget)request; LabelWidget newlw = (LabelWidget)cnew; Boolean was_resized = False, redisplay = False, checks[NUM_CHECKS]; + Cardinal i; - for (unsigned int i = 0; i < NUM_CHECKS; i++) + for (i = 0; i < NUM_CHECKS; i++) checks[i] = False; - for (unsigned int i = 0; i < *num_args; i++) { + for (i = 0; i < *num_args; i++) { if (streq(XtNbitmap, args[i].name)) checks[PIXMAP] = True; else if (streq(XtNwidth, args[i].name)) @@ -354,6 +354,7 @@ static void CalculatedValues(Widget w) { ListWidget lw = (ListWidget)w; + int i; /* If list is NULL then the list will just be the name of the widget */ if (lw->list.list == NULL) { @@ -370,7 +371,7 @@ CalculatedValues(Widget w) if (LongestFree(lw)) { lw->list.longest = 0; /* so it will accumulate real longest below */ - for (int i = 0 ; i < lw->list.nitems; i++) { + for (i = 0 ; i < lw->list.nitems; i++) { int len; if (lw->simple.international == True) diff --git a/src/MultiSrc.c b/src/MultiSrc.c index ffcabf0..d4af34e 100644 --- a/src/MultiSrc.c +++ b/src/MultiSrc.c @@ -872,9 +872,10 @@ static void XawMultiSrcGetValuesHook(Widget w, ArgList args, Cardinal *num_args) { MultiSrcObject src = (MultiSrcObject)w; + Cardinal i; if (src->multi_src.type == XawAsciiString) { - for (unsigned int i = 0; i < *num_args ; i++) { + for (i = 0; i < *num_args ; i++) { if (streq(args[i].name, XtNstring)) { if (src->multi_src.use_string_in_place) *((char **)args[i].value) = (char *) diff --git a/src/SimpleMenu.c b/src/SimpleMenu.c index e62c028..b482ea1 100644 --- a/src/SimpleMenu.c +++ b/src/SimpleMenu.c @@ -1306,7 +1306,9 @@ AddPositionAction(XtAppContext app_con, XPointer data _X_UNUSED) static Widget FindMenu(Widget widget, String name) { - for (Widget w = widget; w != NULL; w = XtParent(w)) { + Widget w; + + for (w = widget; w != NULL; w = XtParent(w)) { Widget menu = XtNameToWidget(w, name); if (menu != NULL) diff --git a/src/StripChart.c b/src/StripChart.c index 702c419..6c4be57 100644 --- a/src/StripChart.c +++ b/src/StripChart.c @@ -388,6 +388,7 @@ repaint_window(StripChartWidget w, int left, int width) int next = w->strip_chart.interval; int scale = w->strip_chart.scale; int scalewidth = 0; + int i; /* Compute the minimum scale required to graph the data, but don't go lower than min_scale */ @@ -423,7 +424,7 @@ repaint_window(StripChartWidget w, int left, int width) width = NUM_VALUEDATA(w); /* Draw data point lines */ - for (int i = left; i < width; i++) { + for (i = left; i < width; i++) { int y = (int)(XtHeight(w) - (XtHeight(w) * w->strip_chart.valuedata[i]) / w->strip_chart.scale); @@ -432,7 +433,7 @@ repaint_window(StripChartWidget w, int left, int width) } /* Draw graph reference lines */ - for (int i = 1; i < w->strip_chart.scale; i++) { + for (i = 1; i < w->strip_chart.scale; i++) { int j = i * ((int)XtHeight(w) / w->strip_chart.scale); XDrawLine(dpy, win, w->strip_chart.hiGC, left, j, scalewidth, j); } @@ -2693,6 +2693,7 @@ OldDisplayText(Widget w, XawTextPosition left, XawTextPosition right) XmuArea *clip = NULL; Bool cleol = ctx->text.clear_to_eol; Bool has_selection = ctx->text.s.right > ctx->text.s.left; + XawTextPosition start; left = left < ctx->text.lt.top ? ctx->text.lt.top : left; @@ -2705,7 +2706,7 @@ OldDisplayText(Widget w, XawTextPosition left, XawTextPosition right) if (cleol) clip = XmuCreateArea(); - for (XawTextPosition start = left; + for (start = left; start < right && line < ctx->text.lt.lines; line++) { XawTextPosition end, final; @@ -2771,6 +2772,7 @@ DisplayText(Widget w, XawTextPosition left, XawTextPosition right) Bool cleol = ctx->text.clear_to_eol; Bool has_selection = ctx->text.s.right > ctx->text.s.left; XawTextPaintList *paint_list; + XawTextPosition from; left = left < ctx->text.lt.top ? ctx->text.lt.top : left; @@ -2784,7 +2786,7 @@ DisplayText(Widget w, XawTextPosition left, XawTextPosition right) paint_list = ((TextSinkObject)ctx->text.sink)->text_sink.paint; - for (XawTextPosition from = left; + for (from = left; from < right && line < ctx->text.lt.lines; line++) { XawTextPosition to = ctx->text.lt.info[line + 1].position; diff --git a/src/TextSrc.c b/src/TextSrc.c index d22bb11..4630158 100644 --- a/src/TextSrc.c +++ b/src/TextSrc.c @@ -1354,6 +1354,7 @@ static void UndoGC(XawTextUndo *undo) { XawTextUndoList *head = undo->head, *redo = head->redo; + unsigned i; if (head == undo->pointer || head == undo->end_mark || undo->l_no_change == NULL @@ -1365,7 +1366,7 @@ UndoGC(XawTextUndo *undo) --head->left->refcount; if (--head->right->refcount == 0) { - for (unsigned i = 0; i < undo->num_undo; i+= 2) + for (i = 0; i < undo->num_undo; i+= 2) if (head->left == undo->undo[i] || head->left == undo->undo[i+1]) { if (head->left == undo->undo[i+1]) { XawTextUndoBuffer *tmp = redo->left; @@ -285,6 +285,7 @@ delete_node(Widget parent, Widget node) { TreeConstraints pc; int pos; + int i; /* * Make sure the parent exists. @@ -310,7 +311,7 @@ delete_node(Widget parent, Widget node) * Fill in the gap left by the sub_node. * Zero the last slot for good luck. */ - for (int i = pos; i < pc->tree.n_children; i++) + for (i = pos; i < pc->tree.n_children; i++) pc->tree.children[i] = pc->tree.children[i+1]; pc->tree.children[pc->tree.n_children] = NULL; @@ -516,6 +517,7 @@ XawTreeConstraintDestroy(Widget w) { TreeConstraints tc = TREE_CONSTRAINT(w); TreeWidget tw = (TreeWidget) XtParent(w); + int i; /* * Remove the widget from its parent's sub-nodes list and @@ -530,7 +532,7 @@ XawTreeConstraintDestroy(Widget w) } delete_node (tc->tree.parent, (Widget) w); - for (int i = 0; i< tc->tree.n_children; i++) + for (i = 0; i< tc->tree.n_children; i++) insert_node (tc->tree.parent, tc->tree.children[i]); layout_tree ((TreeWidget) (w->core.parent), FALSE); @@ -588,6 +590,8 @@ static void XawTreeRedisplay(Widget gw, XEvent *event _X_UNUSED, Region region _X_UNUSED) { TreeWidget tw = (TreeWidget) gw; + Cardinal i; + int j; #ifndef OLDXAW if (tw->tree.display_list) @@ -601,7 +605,7 @@ XawTreeRedisplay(Widget gw, XEvent *event _X_UNUSED, Region region _X_UNUSED) Display *dpy = XtDisplay (tw); Window w = XtWindow (tw); - for (Cardinal i = 0; i < tw->composite.num_children; i++) { + for (i = 0; i < tw->composite.num_children; i++) { Widget child = tw->composite.children[i]; TreeConstraints tc = TREE_CONSTRAINT(child); @@ -628,7 +632,7 @@ XawTreeRedisplay(Widget gw, XEvent *event _X_UNUSED, Region region _X_UNUSED) break; } - for (int j = 0; j < tc->tree.n_children; j++) { + for (j = 0; j < tc->tree.n_children; j++) { Widget k = tc->tree.children[j]; GC gc = (tc->tree.gc ? tc->tree.gc : tw->tree.gc); @@ -724,6 +728,7 @@ compute_bounding_box_subtree(TreeWidget tree, Widget w, int depth) Bool horiz = IsHorizontal (tree); Dimension newwidth, newheight; Dimension bw2 = (Dimension)(w->core.border_width * 2); + int i; /* * Set the max-size per level. @@ -752,7 +757,7 @@ compute_bounding_box_subtree(TreeWidget tree, Widget w, int depth) */ newwidth = 0; newheight = 0; - for (int i = 0; i < tc->tree.n_children; i++) { + for (i = 0; i < tc->tree.n_children; i++) { Widget child = tc->tree.children[i]; TreeConstraints cc = TREE_CONSTRAINT(child); @@ -792,6 +797,7 @@ set_positions(TreeWidget tw, Widget w, int level) { if (w) { TreeConstraints tc = TREE_CONSTRAINT(w); + int i; if (level > 0) { /* @@ -818,7 +824,7 @@ set_positions(TreeWidget tw, Widget w, int level) /* * Set the positions of all children. */ - for (int i = 0; i < tc->tree.n_children; i++) + for (i = 0; i < tc->tree.n_children; i++) set_positions (tw, tc->tree.children[i], level + 1); } } @@ -835,7 +841,7 @@ arrange_subtree(TreeWidget tree, Widget w, int depth, int x, int y) Dimension tmp; Dimension bw2 = (Dimension)(w->core.border_width * 2); Bool relayout = True; - + int i; /* * If no children, then just lay out where requested. @@ -881,7 +887,7 @@ arrange_subtree(TreeWidget tree, Widget w, int depth, int x, int y) if (depth > 0) newy += tree->tree.vpad; } - for (int i = 0; i < tc->tree.n_children; i++) { + for (i = 0; i < tc->tree.n_children; i++) { TreeConstraints cc; child = tc->tree.children[i]; /* last value is used outside loop */ |