diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2024-03-01 19:30:22 -0500 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2024-03-02 16:36:03 -0500 |
commit | f4906b8a4fc09eb3ce971272f993be81885f602f (patch) | |
tree | e68c28100aa05def54ecd5cfdd81e5541b3b5229 | |
parent | 1b1d164cdcd3b30d1effb4a07a40ae1cf08d0419 (diff) |
delete unused assignments
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
-rw-r--r-- | src/AsciiSink.c | 7 | ||||
-rw-r--r-- | src/DisplayList.c | 2 | ||||
-rw-r--r-- | src/SimpleMenu.c | 3 | ||||
-rw-r--r-- | src/Text.c | 1 | ||||
-rw-r--r-- | src/TextAction.c | 21 | ||||
-rw-r--r-- | src/Tip.c | 2 | ||||
-rw-r--r-- | src/Vendor.c | 10 | ||||
-rw-r--r-- | src/XawIm.c | 8 |
8 files changed, 20 insertions, 34 deletions
diff --git a/src/AsciiSink.c b/src/AsciiSink.c index 3a12c75..dc1c32c 100644 --- a/src/AsciiSink.c +++ b/src/AsciiSink.c @@ -454,7 +454,7 @@ AsciiPreparePaint(Widget w, int y, int line, /* XXX the x coordinate can be a parameter, but since it is required to calculate the ascent/descent, do it here to avoid an extra search in the entities */ - pos = tmp = left = ctx->text.lt.info[line].position; + pos = left = ctx->text.lt.info[line].position; right = ctx->text.lt.info[line + 1].position; right = XawMin(right, ctx->text.lastPos + 1); while (pos < right) { @@ -1388,7 +1388,7 @@ FindDistance(Widget w, XawTextPosition fromPos, int fromx, #ifndef OLDXAW AsciiSinkObject sink = (AsciiSinkObject)w; TextWidget ctx = (TextWidget)XtParent(w); - XFontStruct *font = sink->ascii_sink.font; + XFontStruct *font; Widget source = ctx->text.source; XawTextPosition idx, pos; unsigned char c; @@ -1402,7 +1402,6 @@ FindDistance(Widget w, XawTextPosition fromPos, int fromx, pos = idx = fromPos; rWidth = 0; - c = 0; while (!done) { if (XawTextSourceAnchorAndEntity(source, pos, &anchor, &entity)) { @@ -1500,7 +1499,7 @@ FindPosition(Widget w, XawTextPosition fromPos, int fromx, int width, AsciiSinkObject sink = (AsciiSinkObject)w; TextWidget ctx = (TextWidget)XtParent(w); Widget source = ctx->text.source; - XFontStruct *font = sink->ascii_sink.font; + XFontStruct *font; XawTextPosition idx, pos, whiteSpacePosition = 0; int i, lastWidth, whiteSpaceWidth, rWidth, ascent = 0, descent = 0; Boolean whiteSpaceSeen; diff --git a/src/DisplayList.c b/src/DisplayList.c index f06ac34..b351305 100644 --- a/src/DisplayList.c +++ b/src/DisplayList.c @@ -2120,7 +2120,7 @@ Bool XawDeclareDisplayListProc(XawDLClass *lc, String name, if (!lc || !proc || !name || name[0] == '\0') return (False); - if ((info = _XawFindDLInfo(lc, name)) != NULL) + if (_XawFindDLInfo(lc, name) != NULL) /* Since the data structures to the displayList classes are(should be) * opaque, it is not a good idea to allow overriding a displayList * procedure; it's better to choose another name or class name! diff --git a/src/SimpleMenu.c b/src/SimpleMenu.c index 9eb8cd9..0405747 100644 --- a/src/SimpleMenu.c +++ b/src/SimpleMenu.c @@ -1108,8 +1108,6 @@ Layout(Widget w, Dimension *width_ret, Dimension *height_ret) short vadd, hadd, x_ins, y_ins; Dimension *widths; - height = 0; - if (XtIsSubclass(w, simpleMenuWidgetClass)) { smw = (SimpleMenuWidget)w; current_entry = NULL; @@ -1559,7 +1557,6 @@ GetEventEntry(Widget w, XEvent *event) */ if (x_root == WidthOfScreen(XtScreen(w)) - 1 && XtX(w) + XtWidth(w) + (XtBorderWidth(w)) > x_root) { - warp = -8; if (smw->simple_menu.entry_set) { entry = DoGetEventEntry(w, XtX(smw->simple_menu.entry_set) @@ -1716,7 +1716,6 @@ XawTextScroll(TextWidget ctx, int vlines, int hpixels) else { update_from = lt->info[lt->lines - vlines].position; update_to = lt->info[lt->lines].position; - y1 = lt->info[lt->lines - vlines].y; y2 = lt->info[vlines].y; DoCopyArea(ctx, ctx->text.r_margin.left, y2, (unsigned)vwidth, (unsigned)(lt->info[lt->lines].y - y2), diff --git a/src/TextAction.c b/src/TextAction.c index 01ec48c..b031d49 100644 --- a/src/TextAction.c +++ b/src/TextAction.c @@ -1607,8 +1607,7 @@ StripSpaces(TextWidget ctx, XawTextPosition left, XawTextPosition right, text.ptr = (char*)" "; text.length = 1; - position = XawTextSourceRead(ctx->text.source, position, - &block, (int)(right - left)); + XawTextSourceRead(ctx->text.source, position, &block, (int)(right - left)); done = False; space = False; /* convert tabs and returns to spaces */ @@ -1644,8 +1643,7 @@ StripSpaces(TextWidget ctx, XawTextPosition left, XawTextPosition right, text.ptr = (char*)""; text.length = 0; position = tmp = left; - position = XawTextSourceRead(ctx->text.source, position, - &block, (int)(right - left)); + XawTextSourceRead(ctx->text.source, position, &block, (int)(right - left)); ipos = ctx->text.insertPos; done = False; while (!done) { @@ -1725,8 +1723,7 @@ Tabify(TextWidget ctx, XawTextPosition left, XawTextPosition right, text.format = XawFmt8Bit; text.length = 1; - position = XawTextSourceRead(ctx->text.source, position, - &block, (int)(right - left)); + XawTextSourceRead(ctx->text.source, position, &block, (int)(right - left)); ipos = ctx->text.insertPos; done = zero = False; if (tab_count) @@ -1869,8 +1866,7 @@ Untabify(TextWidget ctx, XawTextPosition left, XawTextPosition right, text.format = XawFmt8Bit; text.ptr = tabs; - position = XawTextSourceRead(ctx->text.source, position, - &block, (int)(right - left)); + XawTextSourceRead(ctx->text.source, position, &block, (int)(right - left)); ipos = ctx->text.insertPos; done = False; zero = False; @@ -2239,7 +2235,6 @@ DoFormatText(TextWidget ctx, XawTextPosition left, Bool force, int level, } XawStackFree(text.ptr, buf); position += count; - right += count; if (num_pos) { for (cpos = 0; cpos < num_pos; cpos++) if (pos[cpos] > left) @@ -2301,7 +2296,6 @@ DoFormatText(TextWidget ctx, XawTextPosition left, Bool force, int level, inc += ii; } position += count; - right += count; XawStackFree(text.ptr, buf); } break; @@ -3423,7 +3417,6 @@ Numeric(Widget w, XEvent *event, String *params, Cardinal *num_params) return; } else if (mult == 32767) { - mult = ctx->text.mult = (short)(- (params[0][0] - '0')); return; } else { @@ -3548,13 +3541,13 @@ StripOutOldCRs(TextWidget ctx, XawTextPosition from, XawTextPosition to, } /* Strip out CR's. */ - eop_begin = eop_end = startPos = endPos = from; + eop_begin = eop_end = startPos = from; /* CONSTCOND */ while (TRUE) { XawTextPosition temp; - endPos=SrcScan(src, startPos, XawstEOL, XawsdRight, 1, False); + endPos = SrcScan(src, startPos, XawstEOL, XawsdRight, 1, False); temp = SrcScan(src, endPos, XawstWhiteSpace, XawsdLeft, 1, False); temp = SrcScan(src, temp, XawstWhiteSpace, XawsdRight,1, False); @@ -3749,14 +3742,12 @@ FormRegion(TextWidget ctx, XawTextPosition from, XawTextPosition to, ctx->text.justify == XawjustifyFull) { Untabify(ctx, from, to, pos, num_pos, NULL); to += ctx->text.lastPos - len; - len = ctx->text.insertPos; (void)BlankLine((Widget)ctx, from, &inc); if (from + inc >= to) return (XawEditDone); } if (!StripSpaces(ctx, from + inc, to, pos, num_pos, NULL)) return (XawReplaceError); - to += ctx->text.lastPos - len; FormatText(ctx, from, ctx->text.justify != XawjustifyFull, pos, num_pos); } @@ -527,7 +527,7 @@ FindTipInfo(Widget w) Screen *screen = XtScreenOfObject(w); if (tip == NULL) - return (first_tip = tip = CreateTipInfo(w)); + return (first_tip = CreateTipInfo(w)); for (ptip = tip; tip; ptip = tip, tip = tip->next) if (tip->screen == screen) diff --git a/src/Vendor.c b/src/Vendor.c index 67370a1..07faaa9 100644 --- a/src/Vendor.c +++ b/src/Vendor.c @@ -330,11 +330,11 @@ XawVendorShellClassPartInit(WidgetClass cclass) CompositeClassExtension ext; VendorShellWidgetClass vsclass = (VendorShellWidgetClass)cclass; - if ((ext = (CompositeClassExtension) - XtGetClassExtension (cclass, - XtOffsetOf(CompositeClassRec, - composite_class.extension), - NULLQUARK, 1L, (Cardinal) 0)) == NULL) { + if (((CompositeClassExtension) + XtGetClassExtension (cclass, + XtOffsetOf(CompositeClassRec, + composite_class.extension), + NULLQUARK, 1L, (Cardinal) 0)) == NULL) { ext = (CompositeClassExtension) XtNew (CompositeClassExtensionRec); if (ext != NULL) { ext->next_extension = vsclass->composite_class.extension; diff --git a/src/XawIm.c b/src/XawIm.c index 0e5eef5..fa786d2 100644 --- a/src/XawIm.c +++ b/src/XawIm.c @@ -511,7 +511,7 @@ OpenIM(XawVendorShellExtPart *ve) if (pbuf != buf) XtFree (pbuf); } if (xim == NULL) { - if ((p = XSetLocaleModifiers("")) != NULL) { + if (XSetLocaleModifiers("") != NULL) { xim = XOpenIM(XtDisplay(ve->parent), NULL, NULL, NULL); } } @@ -528,7 +528,7 @@ OpenIM(XawVendorShellExtPart *ve) return; } found = False; - for(ns = s = ve->im.preedit_type; s && !found;) { + for (s = ve->im.preedit_type; s && !found;) { while (*s && isspace((unsigned char)*s)) s++; if (!*s) break; if ((ns = end = strchr(s, ',')) == NULL) @@ -986,9 +986,9 @@ SetICValues(Widget w, XawVendorShellExtPart *ve, Bool focus) ADD_ST(p->font_set); if (p->font_set) { height = maxAscentOfFontSet(p->font_set) - + maxDescentOfFontSet(p->font_set); + + maxDescentOfFontSet(p->font_set); } - height = (int)SetVendorShellHeight(ve, (unsigned)height); + SetVendorShellHeight(ve, (unsigned)height); } if (p->flg & CIFg) { ADD_PE(XNForeground); |