From 407aa2c4b797a3fb002c28be14ee247c3de3292f Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Tue, 23 Dec 2014 20:05:01 +0000 Subject: [PATCH] libDtWidget: Resolve some static analyser warnings prevent usage of potentially unitialised variables. --- cde/lib/DtWidget/Control.c | 4 ++++ cde/lib/DtWidget/Icon.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cde/lib/DtWidget/Control.c b/cde/lib/DtWidget/Control.c index 7333d1b3..b4a35a64 100644 --- a/cde/lib/DtWidget/Control.c +++ b/cde/lib/DtWidget/Control.c @@ -508,6 +508,10 @@ CheckFile( else file_changed = False; break; + + default: + /* unsupported control type */ + return; } G_FileSize (g) = file_size; diff --git a/cde/lib/DtWidget/Icon.c b/cde/lib/DtWidget/Icon.c index 2bb613c7..d91a4b99 100644 --- a/cde/lib/DtWidget/Icon.c +++ b/cde/lib/DtWidget/Icon.c @@ -3088,7 +3088,7 @@ Draw( else if (fill_mode == XmFILL_PARENT) gc = G_ParentBackgroundGC (g); - if ((fill_mode != XmFILL_NONE) && (fill_mode != XmFILL_TRANSPARENT)) + if ((fill_mode == XmFILL_SELF) || (fill_mode == XmFILL_PARENT)) XFillRectangle (d, drawable, gc, x + h_t, y + h_t, w - 2 * h_t, h - 2 * h_t); @@ -3197,6 +3197,10 @@ Draw( ? 0 : Min ((unsigned)G_StringHeight (g), G_Height (g) - s_y); break; + default: + /* Unknown alignment */ + clip.width = 0; + clip.height = 0; } if (clip.width > 0 && clip.height > 0) { -- 2.25.1