From c48ec3adff2ddc7c65cce07ea215fffebcfd866a Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Wed, 3 Jan 2024 22:52:43 +0100 Subject: [PATCH] lib/DtTerm: Remove dead assignments, initializations and increments This shouldn't change behavior (or even object code) at all because those assignments are all without effect. Removing that code removes noise which helps working with code analysis tools. --- cde/lib/DtTerm/Term/Term.c | 2 - cde/lib/DtTerm/Term/TermAction.c | 1 - cde/lib/DtTerm/Term/TermBuffer.c | 17 +++----- cde/lib/DtTerm/Term/TermFunction.c | 12 ----- cde/lib/DtTerm/Term/TermFunctionKey.c | 1 - cde/lib/DtTerm/Term/TermParse.c | 41 ++--------------- cde/lib/DtTerm/TermPrim/TermPrim.c | 1 - cde/lib/DtTerm/TermPrim/TermPrimAction.c | 1 - cde/lib/DtTerm/TermPrim/TermPrimDebug.c | 7 --- cde/lib/DtTerm/TermPrim/TermPrimFunction.c | 1 - cde/lib/DtTerm/TermPrim/TermPrimLineDraw.c | 7 +-- cde/lib/DtTerm/TermPrim/TermPrimRender.c | 9 ---- cde/lib/DtTerm/TermPrim/TermPrimRenderMb.c | 3 -- cde/lib/DtTerm/TermPrim/TermPrimScroll.c | 2 - cde/lib/DtTerm/TermPrim/TermPrimSelect.c | 18 ++------ cde/lib/DtTerm/TermPrim/TermPrimSetUtmp.c | 1 - cde/lib/DtTerm/TermView/TermView.c | 3 +- cde/lib/DtTerm/TermView/TermViewMenu.c | 51 +++++++++++----------- cde/lib/DtTerm/util/lineToData.c | 4 -- 19 files changed, 40 insertions(+), 142 deletions(-) diff --git a/cde/lib/DtTerm/Term/Term.c b/cde/lib/DtTerm/Term/Term.c index 82fdedd82..536c6519d 100644 --- a/cde/lib/DtTerm/Term/Term.c +++ b/cde/lib/DtTerm/Term/Term.c @@ -699,7 +699,6 @@ static void Resize(Widget w) { DtTermWidget tw = (DtTermWidget) w; - DtTermData td = tw->vt.td; /* let our superclass (the Term Widget) perform the resize... */ tw->core.widget_class->core_class.superclass->core_class.resize(w); @@ -880,7 +879,6 @@ static void Destroy(Widget w) { DtTermWidget tw = (DtTermWidget) w; - DtTermData td = tw->vt.td; /* remove the DtTermData structure contents, followed by the structure... */ diff --git a/cde/lib/DtTerm/Term/TermAction.c b/cde/lib/DtTerm/Term/TermAction.c index 12c163eae..c1c4fa8c5 100644 --- a/cde/lib/DtTerm/Term/TermAction.c +++ b/cde/lib/DtTerm/Term/TermAction.c @@ -572,7 +572,6 @@ _DtTermActionEditKeyExecute(Widget w, XEvent *event, String *params, long keyNumber; char *ret; int i; - DtTermData td = tw->vt.td; if (*num_params < 1) { return; diff --git a/cde/lib/DtTerm/Term/TermBuffer.c b/cde/lib/DtTerm/Term/TermBuffer.c index 5325b9f5e..fd5cf8836 100644 --- a/cde/lib/DtTerm/Term/TermBuffer.c +++ b/cde/lib/DtTerm/Term/TermBuffer.c @@ -624,12 +624,7 @@ _DtTermDeleteEnhancement } /* - ** get a copy of the current enhancement - */ - fillEnh = enh[col]; - - /* - ** move all of the enhancement blocks between col + width and and the + ** move all of the enhancement blocks between col + width and the ** end of the line to col */ copyCount = WIDTH(line) - (col + width); @@ -736,19 +731,19 @@ _DtTermSetEnhancement switch (id) { case enhVideo: - enhState->video = (value &= VIDEO_MASK); + enhState->video = value & VIDEO_MASK; break; case enhField: - enhState->field = (value &= FIELD_MASK); + enhState->field = value & FIELD_MASK; break; case enhFgColor: - enhState->fgColor = (value &= COLOR_MASK); + enhState->fgColor = value & COLOR_MASK; break; case enhBgColor: - enhState->bgColor = (value &= COLOR_MASK); + enhState->bgColor = value & COLOR_MASK; break; case enhFont: - enhState->font = (value &= FONT_MASK); + enhState->font = value & FONT_MASK; break; default: return(-1); diff --git a/cde/lib/DtTerm/Term/TermFunction.c b/cde/lib/DtTerm/Term/TermFunction.c index dfc425af5..f661662a3 100644 --- a/cde/lib/DtTerm/Term/TermFunction.c +++ b/cde/lib/DtTerm/Term/TermFunction.c @@ -90,7 +90,6 @@ void _DtTermFuncScroll(Widget w, int count, FunctionSource functionSource) { DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget) w; - struct termData *tpd = tw->term.tpd; /* make sure the cursor is off... */ (void) _DtTermPrimCursorOff(w); @@ -120,7 +119,6 @@ void _DtTermFuncEndOfBuffer(Widget w, int count, FunctionSource functionSource) { DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget) w; - struct termData *tpd = tw->term.tpd; EXIT_IF_MARGINS_SET(tw) (void) _DtTermPrimCursorOff(w); @@ -220,13 +218,9 @@ termFuncErase { DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget) w; DtTermPrimData tpd = tw->term.tpd; - TermBuffer tb = tpd->termBuffer; short row; short col; - row = tpd->cursorRow + tpd->topRow; - col = tpd->cursorColumn; - switch(eraseSwitch) { case eraseToEOL: @@ -339,8 +333,6 @@ void _DtTermFuncClearToEndOfBuffer(Widget w, int count, FunctionSource functionSource) { DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget) w; - DtTermPrimData tpd = tw->term.tpd; - short trow ; /* turn the cursor off... */ (void) _DtTermPrimCursorOff(w); @@ -855,7 +847,6 @@ _DtTermFuncInsertLine(Widget w, int count, FunctionSource functionSource) } /* update screen info and counts... */ - count -= moveCount; insertedRows += moveCount; } } @@ -954,7 +945,6 @@ _DtTermVideoEnhancement(Widget w,int value) DtTermPrimData tpd = tw->term.tpd; DtTermWidget vtw = (DtTermWidget) w; DtTermData td = vtw->vt.td; - ParserContext context = GetParserContext(w); switch(value) { case 0: @@ -1075,8 +1065,6 @@ _DtTermFontEnhancement(Widget w,int value) DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget) w; DtTermPrimData tpd = tw->term.tpd; DtTermWidget vtw = (DtTermWidget) w; - DtTermData td = vtw->vt.td; - ParserContext context = GetParserContext(w); (void)_DtTermPrimBufferSetEnhancement(tpd->termBuffer, tpd->topRow + tpd->cursorRow, tpd->cursorColumn, enhFont, value); diff --git a/cde/lib/DtTerm/Term/TermFunctionKey.c b/cde/lib/DtTerm/Term/TermFunctionKey.c index 27a87d4c4..2dc475c0c 100644 --- a/cde/lib/DtTerm/Term/TermFunctionKey.c +++ b/cde/lib/DtTerm/Term/TermFunctionKey.c @@ -54,7 +54,6 @@ _DtTermFunctionKeyExecute( ) { DtTermWidget tw = (DtTermWidget) w; - DtTermData td = tw->vt.td; if (!shift || tw->vt.sunFunctionKeys == True ) { if ( tw->vt.sunFunctionKeys == True ) { diff --git a/cde/lib/DtTerm/Term/TermParse.c b/cde/lib/DtTerm/Term/TermParse.c index 9b3aba174..31830fcfc 100644 --- a/cde/lib/DtTerm/Term/TermParse.c +++ b/cde/lib/DtTerm/Term/TermParse.c @@ -536,11 +536,10 @@ _DtTermEraseChars(Widget w) /* ECH CSIpX */ { ParserContext context ; DtTermWidget vtw = (DtTermWidget) w; - int row,col,cnt ; + int col,cnt ; Debug('P', fprintf(stderr,">>In func _DtTermEraseChars\n")) ; KILLWRAP(vtw) ; context = GetParserContext(w) ; - row = vtw->term.tpd->cursorRow ; col = vtw->term.tpd->cursorColumn ; STORELASTARG(context) ; cnt = context->parms[1] ; @@ -596,12 +595,11 @@ _DtTermCursorUp(Widget w) /* CUU CISpA */ { ParserContext context ; DtTermWidget vtw = (DtTermWidget) w; - int trow, row, tmargin, cnt; + int row, tmargin, cnt; Debug('P', fprintf(stderr,">>In func _DtTermCursorUp\n")) ; context = GetParserContext(w) ; KILLWRAP(vtw) ; tmargin = TOPMARGIN(vtw) ; - trow = TOPROW(vtw) ; STORELASTARG(context) ; cnt = context->parms[1] ; if (!(cnt))cnt=1; @@ -659,13 +657,12 @@ _DtTermCursorBack(Widget w) /* CUB CISpD */ { ParserContext context ; DtTermWidget vtw = (DtTermWidget) w; - int i,k,j,row,col,fcol,cnt ; + int i,k,j,row,col,cnt ; Debug('P', fprintf(stderr,">>In func _DtTermCursorBack\n")) ; KILLWRAP(vtw) ; context = GetParserContext(w) ; STORELASTARG(context) ; cnt = context->parms[1] ; - fcol = FIRSTCOLUMN(vtw) ; row = vtw->term.tpd->cursorRow; col = vtw->term.tpd->cursorColumn; if (!cnt) cnt=1; @@ -693,10 +690,8 @@ void _DtTermCursorToLineUp(Widget w) /* CPL CSIpF */ { DtTermWidget vtw = (DtTermWidget) w; - ParserContext context ; Debug('P', fprintf(stderr,">>In func _DtTermCursorToLineUp\n")) ; KILLWRAP(vtw) ; - context = GetParserContext(w) ; vtw->term.tpd->cursorColumn = FIRSTCOLUMN(vtw) ; _DtTermCursorUp(w) ; } @@ -887,7 +882,6 @@ _DtTermCharAttributes(Widget w) /* SGR CSIpm */ Debug('P', fprintf(stderr,">>In func _DtTermCharAttributes\n")) ; context = GetParserContext(w) ; STORELASTARG(context) ; - cnt = PCOUNT(context) ; if(PCOUNT(context)) { for (cnt=1; cnt <= PCOUNT(context); cnt++) _DtTermVideoEnhancement(w,context->parms[cnt]) ; @@ -936,7 +930,6 @@ _DtTermChangeTextParam(Widget w) /* xterm CSIp;pcCtrl-G */ { ParserContext context ; DtTermWidget tw = (DtTermWidget) w; - DtTermData vtd = tw->vt.td; Widget sw; int i ; Arg arg[5]; @@ -1033,7 +1026,6 @@ _DtTermSaveCursor(Widget w) /* DECSC ESC7 */ { DtTermWidget vtw = (DtTermWidget) w; DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget) w; - DtTermBuffer tb = (DtTermBuffer)tw->term.tpd->termBuffer ; DtTermData vtd = vtw->vt.td; Debug('P', fprintf(stderr,">>In func _DtTermSaveCursor\n")) ; @@ -1168,19 +1160,13 @@ _DtTermSetCompatLevel(Widget w) /* DECSCL CSI p;p"p (last p literal) */ void _DtTermInvokeG3(Widget w) /* LS3R ESC| */ { - ParserContext context ; - int cnt ; Debug('P', fprintf(stderr,">>In func _DtTermInvokeG3\n")) ; - context = GetParserContext(w) ; } void _DtTermInvokeG2(Widget w) /* LS3R ESC} */ { - ParserContext context ; - int cnt ; Debug('P', fprintf(stderr,">>In func _DtTermInvokeG2\n")) ; - context = GetParserContext(w) ; } void @@ -1441,10 +1427,7 @@ _DtTermAlignTest(Widget w) /* DECALN ESC#8 */ void _DtTermInvokeG1(Widget w) /* ESC~ESC */ { - ParserContext context ; - int cnt ; Debug('P', fprintf(stderr,">>In func _DtTermInvokeG1\n")) ; - context = GetParserContext(w) ; } void @@ -1538,7 +1521,6 @@ _DtTermSelEraseInDisplay(Widget w) /* DECSED ESC?pJ */ { DtTermWidget vtw = (DtTermWidget) w; DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget) w; - TermBuffer tb = tw->term.tpd->termBuffer ; ParserContext context ; enhValues evalues; int r,col1,col2,row1,row2,col,row ; @@ -1689,10 +1671,7 @@ _DtTermParseHexDigit(Widget w) /* vt220 DECUDK store hex digit*/ void _DtTermReset(Widget w) /* RIS ESCc */ { - ParserContext context ; - int cnt ; Debug('P', fprintf(stderr,">>In func _DtTermReset\n")) ; - context = GetParserContext(w) ; _DtTermFuncHardReset(w,0 ,fromParser) ; } @@ -1766,28 +1745,19 @@ _DtTermSetCharEraseMode(Widget w) /* DECSCA ESCp"q */ void _DtTermSingleWide(Widget w) /* DECSWL ESC#5 */ { - ParserContext context ; - int cnt ; Debug('P', fprintf(stderr,">>In func _DtTermSingleWide\n")) ; - context = GetParserContext(w) ; } void _DtTermDoubleWide(Widget w) /* DECDWL ESC#6 */ { - ParserContext context ; - int cnt ; Debug('P', fprintf(stderr,">>In func _DtTermDoubleWide\n")) ; - context = GetParserContext(w) ; } void _DtTermDoubleHigh(Widget w) /* DECWHL ESC#4 */ { - ParserContext context ; - int cnt ; Debug('P', fprintf(stderr,">>In func _DtTermDoubleHigh\n")) ; - context = GetParserContext(w) ; } void @@ -1990,11 +1960,9 @@ _DtTermParseBackspace /* Ctrl-H */ Widget w ) { - ParserContext context ; DtTermWidget vtw = (DtTermWidget) w; int row,col,fcol,cnt ; Debug('P', fprintf(stderr,">>In func _DtTermParseBackspace\n")) ; - context = GetParserContext(w) ; fcol = FIRSTCOLUMN(vtw) ; row = vtw->term.tpd->cursorRow; col = vtw->term.tpd->cursorColumn; @@ -2098,7 +2066,6 @@ _DtTermParseSunMisc /* Misc sun esc seqs */ DtTermWidget vtw = (DtTermWidget) w; Display *display = XtDisplay(w); int i, scr_num = XScreenNumberOfScreen(XtScreen(w)); - Window win = XtWindow(w); Window sh_win; Widget sw; XWindowChanges values; @@ -2233,8 +2200,6 @@ Widget w void _DtTermParserSunIconFile(Widget w) /* Sun set icon to pixmap in file */ { - DtTermBuffer tb = - (DtTermBuffer)((DtTermPrimitiveWidget)w)->term.tpd->termBuffer ; ParserContext context ; int fg, bg; Widget sw; diff --git a/cde/lib/DtTerm/TermPrim/TermPrim.c b/cde/lib/DtTerm/TermPrim/TermPrim.c index f4d79c90f..e8c7a368f 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrim.c +++ b/cde/lib/DtTerm/TermPrim/TermPrim.c @@ -2355,7 +2355,6 @@ static void Realize(Widget w, XtValueMask *p_valueMask, XSetWindowAttributes *attributes) { DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget) w; - DtTermPrimData tpd = tw->term.tpd; Mask valueMask = *p_valueMask; sigset_t sigNew; char buffer[BUFSIZ]; diff --git a/cde/lib/DtTerm/TermPrim/TermPrimAction.c b/cde/lib/DtTerm/TermPrim/TermPrimAction.c index 4287e3e81..b6b2953a9 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrimAction.c +++ b/cde/lib/DtTerm/TermPrim/TermPrimAction.c @@ -157,7 +157,6 @@ _DtTermPrimActionTab(Widget w, XEvent *event, String *params, Cardinal *num_params) { DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget) w; - struct termData *tpd = tw->term.tpd; Boolean shiftedTab = False; Boolean numericTab = False; int i; diff --git a/cde/lib/DtTerm/TermPrim/TermPrimDebug.c b/cde/lib/DtTerm/TermPrim/TermPrimDebug.c index 119fc56d4..f80dcf91f 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrimDebug.c +++ b/cde/lib/DtTerm/TermPrim/TermPrimDebug.c @@ -68,13 +68,6 @@ static void catchExit(void) { - int a; - int b; - - a = 1; - b = a; - a = b; - return; } typedef struct _argArray { diff --git a/cde/lib/DtTerm/TermPrim/TermPrimFunction.c b/cde/lib/DtTerm/TermPrim/TermPrimFunction.c index dad8e3518..d9755542c 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrimFunction.c +++ b/cde/lib/DtTerm/TermPrim/TermPrimFunction.c @@ -389,7 +389,6 @@ void _DtTermPrimFuncRedrawDisplay(Widget w, int count, FunctionSource functionSource) { DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget) w; - struct termData *tpd = tw->term.tpd; (void) XClearArea(XtDisplay(w), XtWindow(w), 0, 0, 0, 0, True); return; diff --git a/cde/lib/DtTerm/TermPrim/TermPrimLineDraw.c b/cde/lib/DtTerm/TermPrim/TermPrimLineDraw.c index 1a5417b60..70e6e45de 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrimLineDraw.c +++ b/cde/lib/DtTerm/TermPrim/TermPrimLineDraw.c @@ -263,6 +263,7 @@ ScaleCharacter( #endif /* USE_PIXMAPS */ } +#ifdef USE_PIXMAPS /* stipple in the rectangle... */ for (j = 0; j < glyph->numStipples; j++) { @@ -272,10 +273,8 @@ ScaleCharacter( int y1; int y2; int stippleSize; -#ifdef USE_PIXMAPS int xIndex; int yIndex; -#endif /* USE_PIXMAPS */ /* scale x1 and x2 to our width... */ x1 = ((width - 1) * glyph->stipples[j].x1) / 100; @@ -293,7 +292,6 @@ ScaleCharacter( y1 += glyph->stipples[j].y1Offset; y2 += glyph->stipples[j].y2Offset; -#ifdef USE_PIXMAPS /* fill in the area... */ for (yIndex = y1; yIndex < y2; yIndex += stippleSize) { for (xIndex = x1; xIndex < x2; xIndex += stippleSize) { @@ -321,8 +319,8 @@ ScaleCharacter( } } } -#endif /* USE_PIXMAPS */ } +#endif /* USE_PIXMAPS */ /* mark this character as completed... */ #ifdef USE_PIXMAPS @@ -374,7 +372,6 @@ _DtTermPrimLineDrawCreateFont(Widget w, GlyphInfo glyphInfo, int numGlyphs, int width, int ascent, int descent) { DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget) w; - struct termData *tpd = tw->term.tpd; int fontNumber; LineDrawFont lineDrawFont; int i; diff --git a/cde/lib/DtTerm/TermPrim/TermPrimRender.c b/cde/lib/DtTerm/TermPrim/TermPrimRender.c index 040e5a254..6c02de6c7 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrimRender.c +++ b/cde/lib/DtTerm/TermPrim/TermPrimRender.c @@ -795,7 +795,6 @@ _DtTermPrimFillScreenGap(Widget w) /* the lines are now freed, adjust the used count... */ tpd->lastUsedHistoryRow -= historyLinesNeeded; if (tpd->lastUsedHistoryRow < 0) { - historyLinesNeeded += tpd->lastUsedHistoryRow; tpd->lastUsedHistoryRow = 0; } } @@ -824,9 +823,6 @@ _DtTermPrimFillScreenGap(Widget w) enhValue *eValues = (enhValue *)NULL; overflowChars = (termChar *) XtMalloc(BUFSIZ * sizeof (termChar)); - c1 = _DtTermPrimBufferGetCharacterPointer( - tBuffer, i1, 0); - /* Perpetuate the enhancements. */ for (eCol = 0; eCol < length; eCol += eCount) { @@ -1095,7 +1091,6 @@ _DtTermPrimInsertText(Widget w, unsigned char *buffer, int length) * character count... */ pmb = (char *)buffer; - pwc = wcBuffer; wcBufferLen = i; i = 0; while (i < wcBufferLen) @@ -1270,7 +1265,6 @@ _DtTermPrimInsertText(Widget w, unsigned char *buffer, int length) newWidth = DoInsert(w, &buffer[insertStartX], insertCharCount, &wrapped); tpd->cursorColumn += insertCharCount; - insertCharCount = 0; if (tpd->insertCharMode != DtTERM_INSERT_CHAR_OFF) { renderEndX = newWidth; } else { @@ -1289,8 +1283,6 @@ _DtTermPrimInsertText(Widget w, unsigned char *buffer, int length) (void) _DtTermPrimRefreshText(w, 0, tpd->cursorRow + 1, renderEndX, tpd->cursorRow + 1); } - wrapped = False; - needToRender = False; } return(i); @@ -1336,7 +1328,6 @@ _DtTermPrimParseInput struct termData *tpd = tw->term.tpd; DtTermPrimitiveClassPart *termClassPart = &(((DtTermPrimitiveClassRec *) (tw->core.widget_class))->term_primitive_class); - TermBuffer tBuffer = tpd->termBuffer; int i; short insertStart; short insertByteCount; diff --git a/cde/lib/DtTerm/TermPrim/TermPrimRenderMb.c b/cde/lib/DtTerm/TermPrim/TermPrimRenderMb.c index 26f51edf0..6beafd0c1 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrimRenderMb.c +++ b/cde/lib/DtTerm/TermPrim/TermPrimRenderMb.c @@ -880,7 +880,6 @@ _DtTermPrimInsertTextWc newWidth = DoInsertWc(w, &wcBuffer[insertStartX], insertCharCount, &wrapped); tpd->cursorColumn += insertCharWidth; - insertCharCount = 0; if (tpd->insertCharMode == DtTERM_INSERT_CHAR_OFF) { renderEndX = MAX(renderEndX, tpd->cursorColumn); } else { @@ -899,8 +898,6 @@ _DtTermPrimInsertTextWc (void) _DtTermPrimRefreshTextWc(w, 0, tpd->cursorRow + 1, renderEndX + 1, tpd->cursorRow + 1); } - wrapped = False; - needToRender = False; } return(i); } diff --git a/cde/lib/DtTerm/TermPrim/TermPrimScroll.c b/cde/lib/DtTerm/TermPrim/TermPrimScroll.c index f142f3fe8..e90756d37 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrimScroll.c +++ b/cde/lib/DtTerm/TermPrim/TermPrimScroll.c @@ -105,7 +105,6 @@ _DtTermPrimScrollWait(Widget w) int i; int exposeY; int exposeHeight; - int scrolledLines; Debug('s', fprintf(stderr, ">>_DtTermPrimScrollWait() starting\n")); Debug('s', fprintf(stderr, @@ -232,7 +231,6 @@ _DtTermPrimScrollWait(Widget w) exposeHeight)); /* set scrollLines == 0, or renderText will not render them... */ - scrolledLines = tpd->scroll.jump.scrollLines; tpd->scroll.jump.scrollLines = 0; /* clear the scrolled flag... */ tpd->scroll.jump.scrolled = False; diff --git a/cde/lib/DtTerm/TermPrim/TermPrimSelect.c b/cde/lib/DtTerm/TermPrim/TermPrimSelect.c index 3701db6ad..20271fb94 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrimSelect.c +++ b/cde/lib/DtTerm/TermPrim/TermPrimSelect.c @@ -372,7 +372,6 @@ bufferRowColToPos ) { DtTermPrimData tpd = tw->term.tpd; - TermSelectInfo selectInfo = tpd->selectInfo; short lrow, lcol; XmTextPosition pos; @@ -1369,7 +1368,7 @@ doExtendedSelection if (position == scan (tw, begin, selectInfo->scanType, scanRight, 1, FALSE)) { - begin = cursorPos = position; + begin = position; } } } @@ -1505,8 +1504,6 @@ doHandleTargets { _TermSelectPrimaryRec *primSelect = (_TermSelectPrimaryRec *) closure; DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget)w; - DtTermPrimData tpd = tw->term.tpd; - TermSelectInfo selectInfo = tpd->selectInfo; XTextProperty tmpProp; XmTextBlockRec block; int i, status; @@ -2240,9 +2237,8 @@ _DtTermPrimSelectDeleteLines return; } - /* figure out what the begin and end lines are... */ + /* figure out what the begin line is... */ selectLineBegin = selectInfo->begin / (selectInfo->columns + 1); - selectLineEnd = (selectInfo->end - 1) / (selectInfo->columns + 1); /* if the beginning of the selection is after the source, we need to * move the selection up... @@ -2274,9 +2270,8 @@ _DtTermPrimSelectInsertLines return; } - /* figure out what the begin and end lines are... */ + /* figure out what the begin line is... */ selectLineBegin = selectInfo->begin / (selectInfo->columns + 1); - selectLineEnd = (selectInfo->end - 1) / (selectInfo->columns + 1); /* if the beginning of the selection is at or after the source, we need to * move the selection up... @@ -2328,8 +2323,6 @@ _DtTermPrimSelectPage ) { DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget)w; - DtTermPrimData tpd = tw->term.tpd; - TermSelectInfo selectInfo = tpd->selectInfo; XButtonEvent *btnEvent = (XButtonEvent *) event; XmTextPosition begin, end; short lastRow, width; @@ -2365,8 +2358,6 @@ DropTransferCallback( { _DtTermDropTransferRec *transfer_rec = (_DtTermDropTransferRec *) closure; DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget)transfer_rec->widget; - DtTermPrimData tpd = tw->term.tpd; - TermSelectInfo selectInfo = tpd->selectInfo; /* When type = NULL, we are assuming a DELETE request has been requested */ if (*type == 0) { @@ -2384,7 +2375,6 @@ DropTransferCallback( transferEntries[0].client_data = (XtPointer) transfer_rec; transferEntries[0].target = XmInternAtom(XtDisplay(w),"DELETE", False); - transferList = transferEntries; XmDropTransferAdd(w, transferEntries, 1); } } @@ -2444,8 +2434,6 @@ HandleDrop( Widget w, XmDropProcCallbackStruct *cb ) Widget drag_cont, initiator; /* XmTextWidget tw = (XmTextWidget) w; */ DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget)w; - DtTermPrimData tpd = tw->term.tpd; - TermSelectInfo selectInfo = tpd->selectInfo; Cardinal numExportTargets, n; Atom *exportTargets; Arg args[10]; diff --git a/cde/lib/DtTerm/TermPrim/TermPrimSetUtmp.c b/cde/lib/DtTerm/TermPrim/TermPrimSetUtmp.c index df2574d17..f74ccc8e3 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrimSetUtmp.c +++ b/cde/lib/DtTerm/TermPrim/TermPrimSetUtmp.c @@ -324,7 +324,6 @@ UtmpEntryCreate(Widget w, pid_t pid, char *utmpLine) { #if !defined(CSRG_BASED) /* XXX */ DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget) w; - struct termData *tpd = tw->term.tpd; struct utmp ut; struct utmp *utPtr; char *c; diff --git a/cde/lib/DtTerm/TermView/TermView.c b/cde/lib/DtTerm/TermView/TermView.c index fd1a5c302..b933e5073 100644 --- a/cde/lib/DtTerm/TermView/TermView.c +++ b/cde/lib/DtTerm/TermView/TermView.c @@ -898,7 +898,7 @@ Initialize(Widget rw, Widget w, Arg *args, Cardinal *num_args) if (geometry && *geometry) { hints.flags = 0; - flags = XWMGeometry(XtDisplay(w), + (void) XWMGeometry(XtDisplay(w), XScreenNumberOfScreen(XtScreen(w)), geometry, "80x24", @@ -1183,7 +1183,6 @@ Initialize(Widget rw, Widget w, Arg *args, Cardinal *num_args) /* create the function key form... */ - i = 0; /* Add an event handler for enter and leave events to allow us to * modify the "CAPS LOCK" indicator... */ diff --git a/cde/lib/DtTerm/TermView/TermViewMenu.c b/cde/lib/DtTerm/TermView/TermViewMenu.c index 753c536ea..f73b61b21 100644 --- a/cde/lib/DtTerm/TermView/TermViewMenu.c +++ b/cde/lib/DtTerm/TermView/TermViewMenu.c @@ -545,7 +545,6 @@ createFontMenu /* clear out mnemonics string... */ *mnemonics = '\0'; - c1 = mnemonics; /* create the font buttons... */ fontSizeToggles = (Widget *) XtMalloc((fontArrayCount + 1) * sizeof(Widget)); @@ -626,9 +625,9 @@ CreateMenu(Widget termView, Widget parent, Boolean menuBar, i); } menu = popupMenu; - button = _DtTermViewCreateLabel(menu, + (void) _DtTermViewCreateLabel(menu, (GETMESSAGE(NL_SETN_ViewMenu,83, "Terminal"))); - button = _DtTermViewCreateSeparator(menu, "Separator"); + (void) _DtTermViewCreateSeparator(menu, "Separator"); } (void) XtFree((char *) newArglist); @@ -659,7 +658,7 @@ CreateMenu(Widget termView, Widget parent, Boolean menuBar, ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,19, "C")); accelerator = mallocGETMESSAGE(NL_SETN_ViewMenu,62, "Alt F4"); acceleratorText = mallocGETMESSAGE(NL_SETN_ViewMenu,62, "Alt+F4"); - button = _DtTermViewCreatePushButton(pulldown[pc], + (void) _DtTermViewCreatePushButton(pulldown[pc], (GETMESSAGE(NL_SETN_ViewMenu,18, "Close")), ks, accelerator, @@ -671,12 +670,12 @@ CreateMenu(Widget termView, Widget parent, Boolean menuBar, if (menuBar || (!menuBar && firstPopup)) #ifdef PULLDOWN_ACCELERATORS ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,21, "W")); - cascade = _DtTermViewCreateCascadeButton(menu, pulldown[pc], + (void) _DtTermViewCreateCascadeButton(menu, pulldown[pc], (GETMESSAGE(NL_SETN_ViewMenu,20, "Window")), ks, NULL, NULL, NULL, NULL); #else /* PULLDOWN_ACCELERATORS */ - cascade = _DtTermViewCreateCascadeButton(menu, pulldown[pc], + (void) _DtTermViewCreateCascadeButton(menu, pulldown[pc], (GETMESSAGE(NL_SETN_ViewMenu,20, "Window")), NoSymbol, NULL, NULL, NULL, NULL); #endif /* PULLDOWN_ACCELERATORS */ @@ -689,7 +688,7 @@ CreateMenu(Widget termView, Widget parent, Boolean menuBar, "Ctrl osfInsert"); acceleratorText = mallocGETMESSAGE(NL_SETN_ViewMenu,25, "Ctrl+Insert"); ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,23, "C")); - button = _DtTermViewCreatePushButton(pulldown[pc], + (void) _DtTermViewCreatePushButton(pulldown[pc], (GETMESSAGE(NL_SETN_ViewMenu,22, "Copy")), ks, accelerator, @@ -702,7 +701,7 @@ CreateMenu(Widget termView, Widget parent, Boolean menuBar, accelerator = mallocGETMESSAGE(NL_SETN_ViewMenu,28, "Shift osfInsert"); acceleratorText = mallocGETMESSAGE(NL_SETN_ViewMenu,29, "Shift+Insert"); - button = _DtTermViewCreatePushButton(pulldown[pc], + (void) _DtTermViewCreatePushButton(pulldown[pc], (GETMESSAGE(NL_SETN_ViewMenu,26, "Paste")), ks, accelerator, @@ -714,12 +713,12 @@ CreateMenu(Widget termView, Widget parent, Boolean menuBar, if (menuBar || (!menuBar && firstPopup)) #ifdef PULLDOWN_ACCELERATORS ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,31, "E")); - cascade = _DtTermViewCreateCascadeButton(menu, pulldown[pc], + (void) _DtTermViewCreateCascadeButton(menu, pulldown[pc], (GETMESSAGE(NL_SETN_ViewMenu,30, "Edit")), ks, NULL, NULL, NULL, NULL); #else /* PULLDOWN_ACCELERATORS */ - cascade = _DtTermViewCreateCascadeButton(menu, pulldown[pc], + (void) _DtTermViewCreateCascadeButton(menu, pulldown[pc], (GETMESSAGE(NL_SETN_ViewMenu,30, "Edit")), NoSymbol, NULL, NULL, NULL, NULL); #endif /* PULLDOWN_ACCELERATORS */ @@ -742,13 +741,13 @@ CreateMenu(Widget termView, Widget parent, Boolean menuBar, NULL, NULL, scrollBarToggleCallback, NULL); ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,37, "G")); - button = _DtTermViewCreatePushButton(pulldown[pc], + (void) _DtTermViewCreatePushButton(pulldown[pc], (GETMESSAGE(NL_SETN_ViewMenu,36, "Global...")), ks, NULL, NULL, globalOptionsCallback, NULL); ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,39, "T")); - button = _DtTermViewCreatePushButton(pulldown[pc], + (void) _DtTermViewCreatePushButton(pulldown[pc], (GETMESSAGE(NL_SETN_ViewMenu,38, "Terminal...")), ks, NULL, NULL, terminalOptionsCallback, NULL); @@ -761,13 +760,13 @@ CreateMenu(Widget termView, Widget parent, Boolean menuBar, submenu = createPulldown(pulldown[pc], "Reset", arglist, i); ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,41, "S")); - button = _DtTermViewCreatePushButton(submenu, + (void)_DtTermViewCreatePushButton(submenu, (GETMESSAGE(NL_SETN_ViewMenu,40, "Soft Reset")), ks, NULL, NULL, softResetCallback, NULL); ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,43, "H")); - button = _DtTermViewCreatePushButton(submenu, + (void)_DtTermViewCreatePushButton(submenu, (GETMESSAGE(NL_SETN_ViewMenu,42, "Hard Reset")), ks, NULL, NULL, hardResetCallback, NULL); @@ -781,12 +780,12 @@ CreateMenu(Widget termView, Widget parent, Boolean menuBar, if (menuBar || (!menuBar && firstPopup)) #ifdef PULLDOWN_ACCELERATORS ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,47, "O")); - cascade = _DtTermViewCreateCascadeButton(menu, pulldown[pc], + (void) _DtTermViewCreateCascadeButton(menu, pulldown[pc], (GETMESSAGE(NL_SETN_ViewMenu,46, "Options")), ks, NULL, NULL, NULL, NULL); #else /* PULLDOWN_ACCELERATORS */ - cascade = _DtTermViewCreateCascadeButton(menu, pulldown[pc], + (void) _DtTermViewCreateCascadeButton(menu, pulldown[pc], (GETMESSAGE(NL_SETN_ViewMenu,46, "Options")), NoSymbol, NULL, NULL, NULL, NULL); #endif /* PULLDOWN_ACCELERATORS */ @@ -858,49 +857,49 @@ CreateMenu(Widget termView, Widget parent, Boolean menuBar, #else /* HPVUE */ ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,65, "v")); - button = _DtTermViewCreatePushButton(pulldown[pc], + (void)_DtTermViewCreatePushButton(pulldown[pc], (GETMESSAGE(NL_SETN_ViewMenu,64, "Overview")), ks, NULL, NULL, helpOverviewCallback, NULL); - button = _DtTermViewCreateSeparator(pulldown[pc], "Separator"); + (void)_DtTermViewCreateSeparator(pulldown[pc], "Separator"); ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,69,"C")); - button = _DtTermViewCreatePushButton(pulldown[pc], + (void)_DtTermViewCreatePushButton(pulldown[pc], (GETMESSAGE(NL_SETN_ViewMenu,68, "Table Of Contents")), ks, NULL, NULL, helpTableOfContentsCallback, NULL); ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,71,"T")); - button = _DtTermViewCreatePushButton(pulldown[pc], + (void)_DtTermViewCreatePushButton(pulldown[pc], (GETMESSAGE(NL_SETN_ViewMenu,70, "Tasks")), ks, NULL, NULL, helpTasksCallback, NULL); ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,73,"R")); - button = _DtTermViewCreatePushButton(pulldown[pc], + (void)_DtTermViewCreatePushButton(pulldown[pc], (GETMESSAGE(NL_SETN_ViewMenu,72, "Reference")), ks, NULL, NULL, helpReferenceCallback, NULL) ; ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,75,"K")); - button = _DtTermViewCreatePushButton(pulldown[pc], + (void)_DtTermViewCreatePushButton(pulldown[pc], (GETMESSAGE(NL_SETN_ViewMenu,74, "Keyboard")), ks, NULL, NULL, helpKeyboardCallback, NULL) ; - button = _DtTermViewCreateSeparator(pulldown[pc], "Separator"); + (void)_DtTermViewCreateSeparator(pulldown[pc], "Separator"); ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,77,"U")); - button = _DtTermViewCreatePushButton(pulldown[pc], + (void)_DtTermViewCreatePushButton(pulldown[pc], (GETMESSAGE(NL_SETN_ViewMenu,76, "Using Help")), ks, NULL, NULL, helpUsingHelpCallback, NULL); - button = _DtTermViewCreateSeparator(pulldown[pc], "Separator"); + (void)_DtTermViewCreateSeparator(pulldown[pc], "Separator"); ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,79,"A")); - button = _DtTermViewCreatePushButton(pulldown[pc], + (void)_DtTermViewCreatePushButton(pulldown[pc], (GETMESSAGE(NL_SETN_ViewMenu,83, "About Terminal")), ks, NULL, NULL, helpAboutDttermCallback, NULL); diff --git a/cde/lib/DtTerm/util/lineToData.c b/cde/lib/DtTerm/util/lineToData.c index 5813ba41c..1a3e7a249 100644 --- a/cde/lib/DtTerm/util/lineToData.c +++ b/cde/lib/DtTerm/util/lineToData.c @@ -280,10 +280,6 @@ main(int argc, char **argv) (void) DumpChar(stdout, charCount++, charList, charListMax, rectList, rectListMax, lineList, lineListMax, stippleList, stippleListMax); - lineListMax = 0; - rectListMax = 0; - stippleListMax = 0; - charListMax = 0; } /* build the final structure... */