nsgmls: resolve coverity warnings related to uninitialed members in C++ classes
[oweals/cde.git] / cde / programs / dtcreate / cmncbs.c
index 05a8b11cfe1bd8089bf142b68f58b39a7442c9a2..5046aeebfec774bc3312afb32197b2a5f3e87140 100644 (file)
@@ -29,6 +29,7 @@
 /*                                                                           */
 /*****************************************************************************/
 #include <stdio.h>
+#include <sys/types.h>
 #include <sys/signal.h>
 #include <X11/cursorfont.h>
 
 #include "cmncbs.h"
 #include "cmnrtns.h"
 #include "CreateActionAppShell.h"
+#include "af_aux.h"
 #include "ca_aux.h"
 #include "icon_selection_dialog.h"
 
+/* from main.c */
+extern void UxDoEditPixmap(Widget wid, char *fname);
 
 /******************************************************************************/
 /* Initialize global values.                                                  */
@@ -68,7 +72,7 @@ void activateCB_open_FindSet (Widget find_set_button, XtPointer cdata,
                               XmFileSelectionBoxCallbackStruct *cbstruct)
 {
   Widget filter;
-  Boolean use_bm = False;
+  XtArgVal /* Boolean */ use_bm = False;
   static char *use_bm_filter = "*.m.bm";
   static char *use_pm_filter = "*.m.pm";
   char *search_path;
@@ -201,7 +205,7 @@ void activateCB_edit_icon (Widget wid, XtPointer client_data,
 
   if (bIconEditorDisplayed) return;
 
-  if ((int)client_data == CA_ACTION_ICONS) {
+  if ((int)(XtArgVal)client_data == CA_ACTION_ICONS) {
      IsActionIcons = True;
      widSelectedIcon = get_selected_action_icon();
      widEditSource = CreateActionAppShell;
@@ -220,6 +224,9 @@ void activateCB_edit_icon (Widget wid, XtPointer client_data,
   return;
 }
 
+/* We use this so we can reuse an open help dialog window. */
+static Widget  mainHelpDialog = NULL;
+
 /******************************************************************************/
 /*                                                                            */
 /* closeCB_mainHelpDialog                                                     */
@@ -234,6 +241,7 @@ void closeCB_mainHelpDialog(Widget wid, XtPointer client_data,
                            XtPointer *cbs)
 {
   XtDestroyWidget(wid);
+  mainHelpDialog = NULL;
 }
 
 /******************************************************************************/
@@ -248,7 +256,6 @@ void closeCB_mainHelpDialog(Widget wid, XtPointer client_data,
 /******************************************************************************/
 void DisplayHelpDialog(Widget wid, XtPointer client_data, XtPointer cbs)
 {
-  static Widget  mainHelpDialog = NULL;
   Widget  parent;
   int     i;
   Arg     args[10];
@@ -264,8 +271,7 @@ void DisplayHelpDialog(Widget wid, XtPointer client_data, XtPointer cbs)
   sprintf(pszTitle, "%s  -  %s", GETMESSAGE(3, 10, "Create Action"),
           GETMESSAGE(2, 53, "Help"));
   */
-  sprintf(pszTitle, "%s  -  ", GETMESSAGE(3, 10, "Create Action"));
-  strcat(pszTitle, GETMESSAGE(2, 53, "Help"));
+  snprintf(pszTitle, sizeof(pszTitle), "%s  -  %s", GETMESSAGE(3, 10, "Create Action"), GETMESSAGE(2, 53, "Help"));
   XtSetArg(args[i], XmNtitle, pszTitle); i++;
 
   /***********************************************************************/
@@ -275,7 +281,7 @@ void DisplayHelpDialog(Widget wid, XtPointer client_data, XtPointer cbs)
   XtSetArg(args[i], DtNhelpVolume, "CreatAct"); i++;
   XtSetArg(args[i], DtNlocationId, pszTopic); i++;
 
-  switch ((int)client_data) {
+  switch ((XtArgVal)client_data) {
      case HELP_OVERVIEW:
                          strcpy(pszTopic, "_hometopic");
                          break;