nsgmls: resolve coverity warnings related to uninitialed members in C++ classes
[oweals/cde.git] / cde / programs / dtcreate / FileCharacteristics.c
index 49691d040651c10e6be7df6485dbe22d6da021fe..d53264b4c5e9c73f07bd1ea341d4c453ee49a0cc 100644 (file)
@@ -1,3 +1,25 @@
+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these librararies and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
 /* $TOG: FileCharacteristics.c /main/7 1999/09/17 15:43:31 mgreess $ */
 
 /*******************************************************************************
@@ -9,6 +31,7 @@
 #include <stdio.h>
 #include <sys/stat.h>
 #include <string.h>
+#include <stdlib.h>
 
 #include <Xm/Xm.h>
 #include <Xm/MwmUtil.h>
@@ -17,6 +40,7 @@
 #include <Xm/RowColumn.h>
 #include <Xm/Form.h>
 #include <Xm/ToggleBG.h>
+#include <Xm/Text.h>
 #include <Xm/TextF.h>
 #include <Xm/Label.h>
 #include <Xm/PushBG.h>
@@ -26,6 +50,9 @@
 #include "UxXt.h"
 #include "dtcreate.h"
 #include "cmncbs.h"
+#include "cmnrtns.h"
+#include "cmnutils.h"
+#include "ErrorDialog.h"
 
 #define CONTEXT_MACRO_ACCESS 1
 #include "FileCharacteristics.h"
@@ -145,6 +172,7 @@ ushort GetContentsType(void)
   } else if (XmToggleButtonGadgetGetState(FC_LongToggle)) {
     return((ushort)CA_FT_CNTLONG);
   }
+  /* NOTREACHED */
 }
 
 /******************************************************************************/
@@ -323,7 +351,7 @@ void ParseAndUpdateID(FiletypeData *pFtD)
 /*****************************************************************************/
 void CalculateAND(void)
 {
-  Boolean set1, set2, set3, set4;
+  XtArgVal /* Boolean */ set1, set2, set3, set4;
   int     cnt;
 
   XtVaGetValues(FC_NameOrPathToggle, XmNset, &set1, NULL);
@@ -386,7 +414,7 @@ static  void    valueChangedCB_FC_PermissionToggle(Widget UxWidget,
                                           XtPointer UxClientData,
                                           XtPointer UxCallbackArg)
 {
-  Boolean set;
+  XtArgVal /* Boolean */ set;
 
   XtVaGetValues(UxWidget, XmNset, &set, NULL);
   XtSetSensitive(FC_PermissionLabel, set);
@@ -445,7 +473,7 @@ static  void    valueChangedCB_FC_ContentsToggle( Widget UxWidget,
                                                  XtPointer UxClientData,
                                                  XtPointer UxCallbackArg)
 {
-  Boolean set;
+  XtArgVal /* Boolean */ set;
 
   XtVaGetValues(UxWidget, XmNset, &set, NULL);
   XtSetSensitive(FC_ContentsLabel, set);
@@ -461,7 +489,7 @@ static  void    valueChangedCB_FC_NameOrPathToggle(Widget UxWidget,
                                                    XtPointer UxCallbackArg)
 
 {
-  Boolean set;
+  XtArgVal /* Boolean */ set;
 
   XtVaGetValues(UxWidget, XmNset, &set, NULL);
   XtSetSensitive(FC_NamePatternLabel, set);
@@ -513,7 +541,7 @@ static Widget   _Uxbuild_FileCharacteristics(void)
 
         pre = GETMESSAGE(3, 10, "Create Action");
         suf = GETMESSAGE(9, 10, "Identifying Characteristics");
-        dialog_title = XtMalloc(strlen(pre) + strlen(suf) + 2);
+        dialog_title = XtMalloc(strlen(pre) + strlen(suf) + 4);
         sprintf(dialog_title, "%s - %s", pre, suf);
 
         if (bLowRes) {
@@ -1293,9 +1321,9 @@ static Widget   _Uxbuild_FileCharacteristics(void)
 Widget  create_FileCharacteristics( swidget _UxUxParent )
 {
         Widget            rtrn;
-        Dimension         dimHeight;
-        Dimension         dimWidth;
-        Dimension         dimTmp;
+        XtArgVal /* Dimension */          dimHeight;
+        XtArgVal /* Dimension */          dimWidth;
+        XtArgVal /* Dimension */          dimTmp;
         Widget            widScrolledWindow;
         Widget            widTmp;