Fix warnings on FreeBSD
[oweals/cde.git] / cde / programs / ttsnoop / messageProps_stubs.C.src
index f7132a007166f5f8d9397ab82e228ca483af61b5..e759859cdb7c9384ce41de7d837e479853dd4bfd 100644 (file)
@@ -21,6 +21,7 @@
  *  ** DELETE THE GENERATED COMMENTS!                                 **
  */
 
+#include <stdint.h>
 #include <stdio.h>
 #include <Xm/Xm.h>
 #include "dtb_utils.h"
  *** Add include files, types, macros, externs, and user functions here.
  ***/
 
+#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
+#include <strstream>
+#else
 #include <strstream.h>
+#endif
+
 #include <Xm/TextF.h>
 #include <Dt/SpinBox.h>
 #include "DtTt.h"
 
-int            DtTtMsgWidgetKey        = (int)DtTtMessageWidget;
+int            DtTtMsgWidgetKey        = (int) (long) DtTtMessageWidget;
 int            DtTtMsgUpdateCBKey      = DtTtMsgWidgetKey + 1;
 int            DtTtMsgInfoKey          = DtTtMsgWidgetKey + 2;
 
@@ -91,7 +97,7 @@ messageProps2Msg(
 {
        Tt_message msg;
        XtVaGetValues( instance->messageProps_shellform,
-                      XmNuserData, &msg, 0 );
+                      XmNuserData, &msg, NULL );
        return msg;
 }
 
@@ -100,7 +106,7 @@ _DtTtMessageUpdating(
        Tt_message msg
 )
 {
-       void *updating = tt_message_user( msg, (int)_DtTtMessageUpdating );
+       void *updating = tt_message_user( msg, (int) (long) _DtTtMessageUpdating );
        if (tt_is_err( tt_ptr_error( updating ))) {
                return False;
        }
@@ -113,8 +119,8 @@ _DtTtMessageSetUpdating(
        Boolean                         updating
 )
 {
-       tt_message_user_set( msg, (int)_DtTtMessageUpdating,
-                            (void *)updating );
+       tt_message_user_set( msg, (int) (long) _DtTtMessageUpdating,
+                            (void *) (intptr_t)updating );
 }
 
 typedef enum {
@@ -135,7 +141,7 @@ _DtTtMessageWidgetUpdate(
        if (tt_is_err( status )) {
                printout = tt_status_message( status );
        }
-       XtVaSetValues( instance->messageText, XmNvalue, printout, 0 );
+       XtVaSetValues( instance->messageText, XmNvalue, printout, NULL );
        if (level == _DtTtMessageRePrint) {
                return;
        }
@@ -199,7 +205,7 @@ _DtTtMessageWidgetUpdate(
        }
 
        int val = tt_message_status( msg );
-       XtVaSetValues( instance->statusBox, DtNposition, val, 0 );
+       XtVaSetValues( instance->statusBox, DtNposition, val, NULL );
        char *status_string = tt_status_string( (Tt_status)val );
        DtTtSetLabel( instance->statusLabel, status_string );
        tt_free( status_string );
@@ -220,7 +226,7 @@ _DtTtMessageWidgetUpdate(
                choice = instance->classChoice_items.OFFER_item;
                break;
        }
-       XtVaSetValues( instance->classChoice, XmNmenuHistory, choice, 0 );
+       XtVaSetValues( instance->classChoice, XmNmenuHistory, choice, NULL );
 
        switch (tt_message_address( msg )) {
            case TT_PROCEDURE:
@@ -240,7 +246,7 @@ _DtTtMessageWidgetUpdate(
                choice = instance->addressChoice_items.ADDRESS_LAST_item;
                break;
        }
-       XtVaSetValues( instance->addressChoice, XmNmenuHistory, choice, 0 );
+       XtVaSetValues( instance->addressChoice, XmNmenuHistory, choice, NULL );
 
        switch (tt_message_scope( msg )) {
            case TT_SCOPE_NONE:
@@ -260,7 +266,7 @@ _DtTtMessageWidgetUpdate(
                choice = instance->scopeChoice_items.FILE_IN_SESSION_item;
                break;
        }
-       XtVaSetValues( instance->scopeChoice, XmNmenuHistory, choice, 0 );
+       XtVaSetValues( instance->scopeChoice, XmNmenuHistory, choice, NULL );
 
        switch (tt_message_disposition( msg )) {
            case TT_DISCARD:
@@ -277,7 +283,7 @@ _DtTtMessageWidgetUpdate(
                choice = instance->dispositionChoice_items.QUEUE_START_item;
                break;
        }
-       XtVaSetValues( instance->dispositionChoice, XmNmenuHistory, choice, 0);
+       XtVaSetValues( instance->dispositionChoice, XmNmenuHistory, choice, NULL);
 
        _DtTtMessageSetUpdating( msg, False );
 }
@@ -594,7 +600,7 @@ DtTtMessageWidgetCreate(
        dtb_message_props_message_props_initialize( instance, parent );
        widget = instance->messageProps;
 
-       XtVaSetValues( instance->messageProps_shellform, XmNuserData, msg, 0 );
+       XtVaSetValues( instance->messageProps_shellform, XmNuserData, msg, NULL );
        status = tt_message_user_set( msg, DtTtMsgWidgetKey, widget );
        if (tt_is_err( status )) {
                XtDestroyWidget( widget );
@@ -603,7 +609,7 @@ DtTtMessageWidgetCreate(
        }
        if (notifyProc != 0) {
                status = tt_message_user_set( msg, DtTtMsgUpdateCBKey,
-                                             notifyProc );
+                                             (void *) notifyProc );
                if (tt_is_err( status )) {
                        XtDestroyWidget( widget );
                        return (Widget)tt_error_pointer( status );
@@ -615,11 +621,11 @@ DtTtMessageWidgetCreate(
                }
        }
 
-       ostrstream labelStream;
+       std::ostrstream labelStream;
        labelStream << "Tt_message " << (void *)msg;
        XtVaSetValues( instance->messageProps,
                       XmNtitle, labelStream.str(),
-                      0 );
+                      NULL );
        delete labelStream.str();
 
        _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
@@ -1403,7 +1409,7 @@ msgGenAction(
     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
     
     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
-    ostrstream action; // XXX when to delete .str()?
+    std::ostrstream action; // XXX when to delete .str()?
     DtbMessagePropsMessagePropsInfo instance =
            (DtbMessagePropsMessagePropsInfo)clientData;
     Tt_message msg = messageProps2Msg( instance );
@@ -1470,7 +1476,7 @@ msgGenC(
     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
     
     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
-       ostrstream code; // XXX when to delete .str()?
+       std::ostrstream code; // XXX when to delete .str()?
        DtbMessagePropsMessagePropsInfo instance =
                (DtbMessagePropsMessagePropsInfo)clientData;
        Tt_message msg = messageProps2Msg( instance );
@@ -1721,9 +1727,9 @@ setStatus(
            return;
     }
     int val;
-    XtVaGetValues( instance->statusBox, DtNposition, &val, 0 );
+    XtVaGetValues( instance->statusBox, DtNposition, &val, NULL );
     XmString statusName = DtTtStatusString( (Tt_status)val );
-    XtVaSetValues( instance->statusLabel, XmNlabelString, statusName, 0 );
+    XtVaSetValues( instance->statusLabel, XmNlabelString, statusName, NULL );
     XmStringFree( statusName );
     Tt_status status = tt_message_status_set( msg, val );
     DtTtSetLabel( instance->messageFooterLabel,
@@ -1873,7 +1879,7 @@ genObserver(
     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
     
     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
-    ostrstream ptype; // XXX when to delete .str()?
+    std::ostrstream ptype; // XXX when to delete .str()?
     DtbMessagePropsMessagePropsInfo instance =
            (DtbMessagePropsMessagePropsInfo)clientData;
     Tt_message msg = messageProps2Msg( instance );