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.
This commit is contained in:
committed by
Jon Trulson
parent
a5b5eb0f80
commit
c48ec3adff
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -68,13 +68,6 @@ static
|
||||
void
|
||||
catchExit(void)
|
||||
{
|
||||
int a;
|
||||
int b;
|
||||
|
||||
a = 1;
|
||||
b = a;
|
||||
a = b;
|
||||
return;
|
||||
}
|
||||
|
||||
typedef struct _argArray {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user