summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-02-28 17:49:59 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-09-21 18:12:57 -0700
commit77533b88018c2923075562e106ef2970c7e6c6a9 (patch)
tree02c4fecde81eda546df38dba82317f7842cc7e9e
parentc5a5fcea941e4ee7c4c68ae090601d6282f0a5cb (diff)
Handle redundantInitialization warnings from cppcheck
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/Label.c2
-rw-r--r--src/MultiSrc.c1
-rw-r--r--src/Panner.c2
-rw-r--r--src/Text.c2
4 files changed, 3 insertions, 4 deletions
diff --git a/src/Label.c b/src/Label.c
index e75139a..ffdad56 100644
--- a/src/Label.c
+++ b/src/Label.c
@@ -358,7 +358,7 @@ SetTextWidthAndHeight(LabelWidget lw)
fs->max_bounds.ascent + fs->max_bounds.descent;
}
if (*label) {
- int width = XTextWidth(fs, label, (int)strlen(label));
+ int width;
if (lw->label.encoding)
width = XTextWidth16(fs, (XChar2b *)label, (int)(strlen(label) / 2));
diff --git a/src/MultiSrc.c b/src/MultiSrc.c
index 34e17e2..ffcabf0 100644
--- a/src/MultiSrc.c
+++ b/src/MultiSrc.c
@@ -591,7 +591,6 @@ Scan(Widget w, register XawTextPosition position, XawTextScanType type,
if (piece == NULL) /* Beginning of text */
return (0);
ptr = piece->text + piece->used - 1;
- c = *ptr;
}
else if (ptr >= piece->text + piece->used) {
piece = piece->next;
diff --git a/src/Panner.c b/src/Panner.c
index 9f32620..d8334eb 100644
--- a/src/Panner.c
+++ b/src/Panner.c
@@ -342,7 +342,7 @@ WidgetClass pannerWidgetClass = (WidgetClass) &pannerClassRec;
static void
reset_shadow_gc(PannerWidget pw)
{
- XtGCMask valuemask = GCForeground;
+ XtGCMask valuemask;
XGCValues values;
unsigned long pixels[3];
diff --git a/src/Text.c b/src/Text.c
index 521bafe..2bc4c7a 100644
--- a/src/Text.c
+++ b/src/Text.c
@@ -3073,7 +3073,7 @@ _XawTextClearAndCenterDisplay(TextWidget ctx)
left_margin == ctx->text.left_margin) {
int insert_line = LineForPosition(ctx, ctx->text.insertPos);
int scroll_by = insert_line - (ctx->text.lt.lines >> 1);
- Boolean clear_to_eol = ctx->text.clear_to_eol;
+ Boolean clear_to_eol;
XawTextScroll(ctx, scroll_by, 0);
SinkClearToBG(ctx->text.sink, 0, 0, XtWidth(ctx), XtHeight(ctx));