dtcm: Resolve CID 87562
[oweals/cde.git] / cde / programs / dtcm / dtcm / print.c
index e1e9e0c38550c3e331cf505fe6928775b138d2b8..64eff5265e91e8b5766c520f6cd934a19b15f0f0 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
+ */
 /* $XConsortium: print.c /main/18 1996/11/25 10:23:05 rswiston $ */
 /*
  *  (c) Copyright 1993, 1994 Hewlett-Packard Company
@@ -7,6 +29,7 @@
  */
 
 #include <EUSCompat.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <ctype.h>
@@ -849,6 +872,7 @@ clearSetupData(_DtCmPrintData *pd)
 static void
 createPrintShell(Calendar *c)
 {
+#if defined(PRINTING_SUPPORTED)
   _DtCmPrintData *pd = (_DtCmPrintData *)c->print_data;
 
 #ifdef GR_DEBUG
@@ -873,6 +897,7 @@ createPrintShell(Calendar *c)
     XtAddCallback(pd->printShell, XmNpdmNotificationCallback,
                  pdm_notify_cb, (XtPointer)c);
   }
+#endif  /* PRINTING_SUPPORTED */
 }
 
 void
@@ -960,7 +985,7 @@ create_print_dialog(Calendar *c)
           */
          pd->report_type = PR_DAY_VIEW;
          pd->report_type_option = XmVaCreateSimpleOptionMenu(pd->form,
-               "TypeOptionMenu", view, NULL,
+               "TypeOptionMenu", view, 0,
                pd->report_type, report_option_cb,
                XmVaPUSHBUTTON,         day_view, NULL, NULL, NULL,
                XmVaPUSHBUTTON,         week_view, NULL, NULL, NULL,
@@ -1229,6 +1254,7 @@ report_error(Calendar *c, char *title, char *errText)
 static void
 pdm_notify_cb(Widget w, XtPointer uData, XtPointer cbData)
 {
+#if defined(PRINTING_SUPPORTED)
   XmPrintShellCallbackStruct *cbStruct =
     (XmPrintShellCallbackStruct *)cbData;
   Calendar *c = (Calendar *)uData;
@@ -1256,6 +1282,7 @@ pdm_notify_cb(Widget w, XtPointer uData, XtPointer cbData)
     XtFree(title);
     XtFree(errText);
   }
+#endif  /* PRINTING_SUPPORTED */
 }
 
 /*
@@ -1305,6 +1332,7 @@ print_cb(Widget w, XtPointer data, XtPointer cbDataP)
 static void
 print_setup_cb(Widget w, XtPointer uData, XtPointer cbData)
 {
+#if defined(PRINTING_SUPPORTED)
   Calendar *c = (Calendar *)uData;
   _DtCmPrintData *pd = (_DtCmPrintData *)c->print_data;
   DtPrintSetupCallbackStruct *cbStruct =
@@ -1335,6 +1363,7 @@ print_setup_cb(Widget w, XtPointer uData, XtPointer cbData)
   }
 
   clearSetupData(pd);
+#endif  /* PRINTING_SUPPORTED */
 }
 
 /*
@@ -1461,7 +1490,7 @@ print_report(Calendar *c)
 static void
 report_option_cb(Widget w, XtPointer client_data, XtPointer call_data)
 {
-  int choice = (int) client_data;
+  int choice = (int) (intptr_t) client_data;
   Calendar *c = calendar;
 
   pd_set_report_managed(c, choice);