libDtWidget: Resolve some static analyser warnings
authorPeter Howkins <flibble@users.sf.net>
Tue, 23 Dec 2014 20:05:01 +0000 (20:05 +0000)
committerPeter Howkins <flibble@users.sf.net>
Tue, 23 Dec 2014 20:05:01 +0000 (20:05 +0000)
prevent usage of potentially unitialised variables.

cde/lib/DtWidget/Control.c
cde/lib/DtWidget/Icon.c

index 7333d1b31f6755dbb46b02b85681e4b52ee5cd33..b4a35a644ebe6f0688612e62022efe62a631ff48 100644 (file)
@@ -508,6 +508,10 @@ CheckFile(
       else
        file_changed = False;
       break;
+
+    default:
+      /* unsupported control type */
+      return;
     }
   
   G_FileSize (g) = file_size;
index 2bb613c7c01c580d25233c80f3c4ae1170da517e..d91a4b99479c5c68dbaaddd332b4203d92758383 100644 (file)
@@ -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)
                 {