WIP to make dtbuilder work on 64bit.
authorPascal Stumpf <Pascal.Stumpf@cubes.de>
Mon, 13 Aug 2012 15:35:34 +0000 (17:35 +0200)
committerJon Trulson <jon@radscan.com>
Tue, 14 Aug 2012 01:42:44 +0000 (19:42 -0600)
Fixes many, though not all 64bit-warnings.  In lots of places, pointers are
cast to ints to be then used as array subscripts.  The only way to deal with
this is to change them to long.  Additionally, use calloc() to allocate the
int_array in istr.c and drop the (wrong) macro patch to istr.h.  Should make
dtbuilder work on 32bit again.

29 files changed:
cde/programs/dtappbuilder/src/ab/abobj_layout.c
cde/programs/dtappbuilder/src/ab/attch_ed_stubs.c
cde/programs/dtappbuilder/src/ab/connP.h
cde/programs/dtappbuilder/src/ab/conn_obj.c
cde/programs/dtappbuilder/src/ab/conn_stubs.c
cde/programs/dtappbuilder/src/ab/message_ed_stubs.c
cde/programs/dtappbuilder/src/abmf/abmf.c
cde/programs/dtappbuilder/src/abmf/abmfP.h
cde/programs/dtappbuilder/src/abmf/args.c
cde/programs/dtappbuilder/src/abmf/connect.c
cde/programs/dtappbuilder/src/abmf/stubs_c_file.c
cde/programs/dtappbuilder/src/libABil/abuil_load.c
cde/programs/dtappbuilder/src/libABil/abuil_resource_attr_map.c
cde/programs/dtappbuilder/src/libABil/abuil_trav.c
cde/programs/dtappbuilder/src/libABil/bil.c
cde/programs/dtappbuilder/src/libABil/bil_loadatt.c
cde/programs/dtappbuilder/src/libABil/bil_store.c
cde/programs/dtappbuilder/src/libABil/gil_loadobj.c
cde/programs/dtappbuilder/src/libABobj/obj_fields.c
cde/programs/dtappbuilder/src/libABobj/obj_list.c
cde/programs/dtappbuilder/src/libABobj/obj_names_list.c
cde/programs/dtappbuilder/src/libABobj/obj_scoped.c
cde/programs/dtappbuilder/src/libABobj/obj_utils.c
cde/programs/dtappbuilder/src/libABobjXm/objxm_args.c
cde/programs/dtappbuilder/src/libABobjXm/objxm_strs.c
cde/programs/dtappbuilder/src/libABobjXm/objxm_util.c
cde/programs/dtappbuilder/src/libAButil/istr.c
cde/programs/dtappbuilder/src/libAButil/strlist.c
cde/programs/dtappbuilder/src/libAButil/strlist.h

index c4c2daa46eda7f5a37e400d5e6711641a97b63a5..45a95bb2ca331d26993591daaaec710fe200f5b2 100644 (file)
@@ -110,7 +110,7 @@ abobj_calculate_new_layout(
     Position    x, y;
     Dimension   width, height;
     Dimension   p_width, p_height;
-    int                gridpos;
+    long       gridpos;
 
     if ((attachments = obj->attachments) == NULL)
         return -1;
index 41d18ef5247c3e21b68e13dbf6055b7a71b4f552..bbea9ccf280d2f48cddd0c47617e6253106d1dc9 100644 (file)
@@ -258,7 +258,7 @@ static void set_attach_values(
                    PropOptionsSetting          objlist_setting,
                    int                         offset_value,
                    int                         position_value,
-                   int                         objlist_value
+                   XtPointer                   objlist_value
                );
 
 static void    change_attach_type(
@@ -2642,7 +2642,7 @@ set_attach_values(
     PropOptionsSetting         objlist_setting,
     int                                offset_value,
     int                                position_value,
-    int                                objlist_value
+    XtPointer                  objlist_value
 )
 {
     switch (attach_type)
@@ -2945,7 +2945,7 @@ convert_offset_position(
     /*
     set_attach_values(attach_type, 
                offset_setting, position_setting, objlist_setting, 
-               offset_value, position_value, (int)sibling_obj);
+               offset_value, position_value, (XtPointer)sibling_obj);
     */
     
     *ret_offset = offset_value;
@@ -3068,7 +3068,7 @@ change_attach_type(
      */
     set_attach_values(attach_type, 
                offset_setting, position_setting, objlist_setting, 
-               offset, position, (int)attach_obj);
+               offset, position, (XtPointer)attach_obj);
 }
 
 
@@ -3263,7 +3263,7 @@ change_opp_attach_type(
          */
         set_attach_values(opp_attach_type, 
                opp_offset_setting, opp_position_setting, opp_objlist_setting, 
-               offset, position, (int)attach_obj);
+               offset, position, (XtPointer)attach_obj);
     }
 }
 
@@ -3335,7 +3335,7 @@ attach_obj_changed(
                        &offset, &position);
         set_attach_values(attach_type, 
                offset_setting, position_setting, objlist_setting, 
-               offset, position, (int)attach_obj);
+               offset, position, (XtPointer)attach_obj);
     }
 }
 
index aa3f351209a3b6aa04ecbeffa8b0033bebac854f..e63db24bcd3eb49c65a7c3b0647ffe4d35b5a4da 100644 (file)
@@ -108,7 +108,7 @@ extern char **              connP_get_when_labels(
 extern char **         connP_get_act_labels(
                            int *num_labels
                        );
-extern int             connP_get_obj_type_index(
+extern long            connP_get_obj_type_index(
                            AB_OBJECT_TYPE      ab_type,
                            int                 ab_subtype
                        );
@@ -181,7 +181,7 @@ extern int          connP_objtype_needs_subtype(
                            AB_OBJECT_TYPE      obj_type,
                            int                 obj_subtype
                        );
-extern int             connP_obj_enabled(
+extern long            connP_obj_enabled(
                            AB_OBJECT_TYPE      obj_type,
                            int                 obj_subtype
                        );
index a4fe7e601c184ae097bf73e604fe3b369a40b72c..78751a1a13137375d2c56526dbaa2df1c4ef7633 100644 (file)
@@ -926,7 +926,7 @@ connP_make_conn_string(
 )
 {
     register int       i;
-    int                        si;
+    long               si;
     static char                conn_string[BUFSIZ];
     char               buf[BUFSIZ];
     AB_ACTION_INFO     *action_info;
@@ -1041,13 +1041,13 @@ connP_make_conn_string(
     return(conn_string);
 }
 
-extern int
+extern long
 connP_get_obj_type_index(
     AB_OBJECT_TYPE     ab_type,
     int                        ab_subtype
 )
 {
-    register int       i;
+    register long      i;
 
     if (connP_objtype_needs_subtype(ab_type, ab_subtype))
     {
@@ -1093,8 +1093,8 @@ connP_guess_when_action(
     AB_BUILTIN_ACTION  *act_ret
 )
 {
-    int     i = connP_get_obj_type_index(source_type, source_subtype);
-    int     j = connP_get_obj_type_index(target_type, target_subtype);
+    long     i = connP_get_obj_type_index(source_type, source_subtype);
+    long     j = connP_get_obj_type_index(target_type, target_subtype);
 
     if (ConnP_conn_objs[i].when_list != NULL)
        *when_ret = ConnP_conn_objs[i].default_when;
@@ -1197,7 +1197,7 @@ assign_when_list(
     int                        source_subtype
 )
 {
-    int                i;
+    long       i;
     int                n;
     ConnObj    *src_conn_obj;
     
@@ -1232,7 +1232,7 @@ assign_action_list(
     int                        target_subtype
 )
 {
-    int                i;
+    long       i;
     int                n;
     ConnObj    *trg_conn_obj;
     
@@ -1286,7 +1286,7 @@ connP_objtype_needs_subtype(
     return(0);
 }
 
-extern int
+extern long
 connP_obj_enabled(
     AB_OBJECT_TYPE     obj_type,
     int                        obj_subtype
index 26a4918768b993d921a18daad111ac6394aa5e22..e1b82e6173785b61f1e33954e94e8c0184a91d92 100644 (file)
@@ -129,7 +129,7 @@ static Widget       exec_code_dialog = NULL;
 static Widget  exec_code_textpane = NULL;
 
 static Widget  ConnP_view_source_obj = NULL; /* View:'s "Source Object" PushButton */
-static int     ConnP_view_filter = -1;
+static long    ConnP_view_filter = -1;
 
 static STRING  CodeFragBuf = NULL;
 static STRING  action_type_labels[ACTION_TYPE_NUM_VALUES];             
@@ -496,7 +496,7 @@ populate_view_menu(
     XtPointer  call_data
 )
 {
-    int                i;
+    long       i;
     Widget     w;
 
 
@@ -526,7 +526,7 @@ setup_source(
     ABObj              source
 )
 {
-    int        i = connP_get_obj_type_index(source_type, source_subtype);
+    long       i = connP_get_obj_type_index(source_type, source_subtype);
 
     if (i < 0) return;
 
@@ -544,7 +544,7 @@ setup_target(
     ABObj              target
 )
 {
-    int        i = connP_get_obj_type_index(target_type, target_subtype);
+    long       i = connP_get_obj_type_index(target_type, target_subtype);
 
     if (i < 0) return;
 
@@ -949,9 +949,9 @@ set_view_filter(
     XtPointer  call_data
 )
 {
-    if (ConnP_view_filter != (int)client_data)
+    if (ConnP_view_filter != (long)client_data)
     {
-       ConnP_view_filter = (int)client_data;
+       ConnP_view_filter = (long)client_data;
        populate_connection_list(NULL);
     }
 }
@@ -1551,7 +1551,7 @@ set_standard_action_type(
 )
 {
     XmString   xm_label_str;
-    int                i = 0;
+    long               i = 0;
     BOOL       found = FALSE;
 
     connP_set_action_type(AB_FUNC_BUILTIN);
@@ -3832,7 +3832,7 @@ update_conn_ed_controls(void)
     int                        source_subtype = -1;
     AB_OBJECT_TYPE      target_type = AB_TYPE_UNDEF; 
     int                        target_subtype = -1;
-    int                i = -1, j = -1;
+    long               i = -1, j = -1;
 
     source_type = connP_get_source_type();
     source_subtype = connP_get_source_subtype();
index a2c8faef2588f80bf780204f5c12c46d1205962e..c3501bc1bc2b71496d00a7289ac8260dfb63a0f9 100644 (file)
@@ -877,7 +877,7 @@ typeCB(
            }
 
            /* Set the default button to be Action1 */
-           if ((int)prop_options_get_value(&(mes->default_btn)) != AB_DEFAULT_BTN_ACTION1)     
+           if ((XtPointer)prop_options_get_value(&(mes->default_btn)) != AB_DEFAULT_BTN_ACTION1)       
            {
                prop_options_set_value(&(mes->default_btn), 
                                (XtPointer)AB_DEFAULT_BTN_ACTION1, True);
@@ -928,7 +928,7 @@ typeCB(
            }
 
             /* Set the default button to be Cancel */ 
-           if ((int)prop_options_get_value(&(mes->default_btn)) != AB_DEFAULT_BTN_CANCEL)      
+           if ((XtPointer)prop_options_get_value(&(mes->default_btn)) != AB_DEFAULT_BTN_CANCEL)        
            {
                prop_options_set_value(&(mes->default_btn), 
                                 (XtPointer)AB_DEFAULT_BTN_CANCEL, True);
@@ -979,7 +979,7 @@ typeCB(
            }
 
             /* Set the default button to be Action2 */ 
-           if ((int)prop_options_get_value(&(mes->default_btn)) != AB_DEFAULT_BTN_ACTION2)     
+           if ((XtPointer)prop_options_get_value(&(mes->default_btn)) != AB_DEFAULT_BTN_ACTION2)       
            {
                prop_options_set_value(&(mes->default_btn), 
                                 (XtPointer)AB_DEFAULT_BTN_ACTION2, True);
@@ -1031,7 +1031,7 @@ typeCB(
            }
 
             /* Set the default button to be Action1 */ 
-           if ((int)prop_options_get_value(&(mes->default_btn)) != AB_DEFAULT_BTN_ACTION1)     
+           if ((XtPointer)prop_options_get_value(&(mes->default_btn)) != AB_DEFAULT_BTN_ACTION1)       
            {
                prop_options_set_value(&(mes->default_btn), 
                                 (XtPointer)AB_DEFAULT_BTN_ACTION1, True);
@@ -1079,7 +1079,7 @@ typeCB(
            }
 
             /* Set the default button to be Action1 */ 
-           if ((int)prop_options_get_value(&(mes->default_btn)) != AB_DEFAULT_BTN_ACTION1)     
+           if ((XtPointer)prop_options_get_value(&(mes->default_btn)) != AB_DEFAULT_BTN_ACTION1)       
            {
                prop_options_set_value(&(mes->default_btn), 
                                 (XtPointer)AB_DEFAULT_BTN_ACTION1, True);
index 2cf4877f4a8afbda3e99af2ad3fb558c4822e31c..a6025c194e581f29652e899c4772d861065a349f 100644 (file)
@@ -174,6 +174,7 @@ nl_catd Dtb_project_catd;
 
 
 /* ARGSUSED */
+int
 main(int argc, STRING *argv)
 {
     int                        exitValue = 0;
@@ -939,7 +940,7 @@ mark_modules_to_load_and_write(
        {
            fileName = strlist_get_str(fileNames, i, &wasFoundVoidPtr);
            assert(fileName != NULL);
-           wasFound = (BOOL)(unsigned)wasFoundVoidPtr;
+           wasFound = (BOOL)(unsigned long)wasFoundVoidPtr;
            if (!wasFound)
            {
                util_printf_err("module not found in project: %s\n", fileName);
index dbaf0ab6515de93c12a4996429dd4e3a8b22e58a..bc1facf38008232f448168ff31454a36ac032ca4 100644 (file)
@@ -162,7 +162,7 @@ typedef CGenAnyData CGenData;
 
 #define mfobj_set_proj_data(_obj,_data) \
        ( mfobj_set_flags(_obj, CGenFlagDataIsProj), \
-         ((int)(mfobj_data(_obj)->info.proj = (_data))) \
+         ((long)(mfobj_data(_obj)->info.proj = (_data))) \
        )
 
 #define mfobj_get_proj_data(obj) \
index 3b3c5ee096501d4e5e135b3ddf694215cf0f10b8..23d09fbde5a856376e30a14ac2792a753d21cbc0 100644 (file)
@@ -1485,7 +1485,7 @@ get_wclass_and_res_value(
     BOOL       foundEm = FALSE;
 
     *wClassOut = NULL;
-    *resValueOut = NULL;
+    *resValueOut = 0;
 
     if (wClass == NULL)
     {
index f53758adf7e195debdc11236f9b1750801432989..c33e43b290613482870294fbb2955e11a0a42c0e 100644 (file)
@@ -205,7 +205,7 @@ abmfP_get_connect_includes(StringList includeFiles, ABObj projOrModule)
     assert(project != NULL);
     if (project == NULL)
     {
-       return NULL;
+       return 0;
     }
 
     for (trav_open(&trav, projOrModule, AB_TRAV_ACTIONS_FOR_OBJ);
index 6440a7642147581ede172636414956648d5b947d..0470543371968b0cb1e4b805d54a19a19cd9994d 100644 (file)
@@ -282,7 +282,7 @@ printf_setval(GenCodeInfo genCodeInfo, ABObj obj, ...)
 #if defined(__osf__) || defined(linux) || defined(CSRG_BASED)
 /* OSF/1 define va_list in <va_list.h> as structure of char ** and int
  * Sun define va_list as void * */
-    va_list             paramList = { NULL, 0 };
+    va_list             paramList = { 0, 0 };
 #else
     va_list             paramList = NULL;
 #endif /* __osf__ */
index 6dc59ea6a6792872fd4a6aa444cec39b0068af84..bed2474a4b7b6b0061d7f0ca0b4ea83d794d5695 100644 (file)
@@ -605,7 +605,7 @@ widget_into_module(
        /*
         * Store ABObj reference in uil widget node
         */
-       uil_widget->header.user_data = (int)ab_widget;
+       uil_widget->header.user_data = (long)ab_widget;
 
        /*
         * Populate arguments and callbacks
@@ -630,7 +630,7 @@ widget_into_module(
        /*
         * Store ABObj reference in uil widget node
         */
-       uil_widget->header.user_data = (int)ab_widget;
+       uil_widget->header.user_data = (long)ab_widget;
     }
 
 
index 91324a895631aaa6962631ec7e18e3722cab069b..b21be9dfb390b1127786b5035e858937ce6818f2 100644 (file)
@@ -3355,7 +3355,7 @@ attach_context_store(
     AttachmentContext  *attach_context = (AttachmentContext *)context;
     STRING             attach_str;
     AB_ATTACH_TYPE     att_type;
-    int                        att_pos = 0, att_off = 0, offset = 0;
+    long               att_pos = 0, att_off = 0, offset = 0;
     void               *value  = NULL;
     BOOL               need_val = TRUE;
     ObjRef             *obj_ref;
@@ -3480,7 +3480,7 @@ val_set_rows_proc(
                    XtPointer   res_value
 )
 {
-    if(obj_set_num_rows(obj,(int)res_value)) return(FALSE);
+    if(obj_set_num_rows(obj,(long)res_value)) return(FALSE);
     else return(TRUE);
 }
 
@@ -3492,7 +3492,7 @@ val_set_columns_proc(
                    XtPointer   res_value
 )
 {
-    if(obj_set_num_columns(obj,(int)res_value)) return(FALSE);
+    if(obj_set_num_columns(obj,(long)res_value)) return(FALSE);
     else return(TRUE);
 }
 
@@ -3504,7 +3504,7 @@ val_set_maximum_proc(
                    XtPointer   res_value
 )
 {
-    if(obj_set_max_value(obj,(int)res_value)) return(FALSE);
+    if(obj_set_max_value(obj,(long)res_value)) return(FALSE);
     else return(TRUE);
 }
 
@@ -3516,7 +3516,7 @@ val_set_minimum_proc(
                    XtPointer   res_value
 )
 {
-    if(obj_set_min_value(obj,(int)res_value)) return(FALSE);
+    if(obj_set_min_value(obj,(long)res_value)) return(FALSE);
     else return(TRUE);
 }
 
@@ -3528,7 +3528,7 @@ val_set_numcols_proc(
                    XtPointer   res_value
 )
 {
-    if(obj_set_num_columns(obj,(int)res_value)) return(FALSE);
+    if(obj_set_num_columns(obj,(long)res_value)) return(FALSE);
     else return(TRUE);
 }
 
@@ -3697,7 +3697,7 @@ val_set_maxlen_proc(
                    XtPointer   res_value
 )
 {
-    if(obj_set_max_length(obj,(int)res_value)) return(FALSE);
+    if(obj_set_max_length(obj,(long)res_value)) return(FALSE);
     else return(TRUE);
 }
 
@@ -3709,7 +3709,7 @@ val_set_panemax_proc(
                    XtPointer   res_value
 )
 {
-    if(obj_set_pane_max(obj,(int)res_value)) return(FALSE);
+    if(obj_set_pane_max(obj,(long)res_value)) return(FALSE);
     else return(TRUE);
 }
 
@@ -3721,7 +3721,7 @@ val_set_panemin_proc(
                    XtPointer   res_value
 )
 {
-    if(obj_set_pane_min(obj,(int)res_value)) return(FALSE);
+    if(obj_set_pane_min(obj,(long)res_value)) return(FALSE);
     else return(TRUE);
 }
 
@@ -3733,7 +3733,7 @@ val_set_intvalue_proc(
                    XtPointer   res_value
 )
 {
-    if(obj_set_initial_value_int(obj,(int)res_value)) return(FALSE);
+    if(obj_set_initial_value_int(obj,(long)res_value)) return(FALSE);
     else return(TRUE);
 }
 
@@ -3757,7 +3757,7 @@ val_set_increment_proc(
                    XtPointer   res_value
 )
 {
-    if(obj_set_increment(obj,(int)res_value)) return(FALSE);
+    if(obj_set_increment(obj,(long)res_value)) return(FALSE);
     else return(TRUE);
 }
 
@@ -3769,7 +3769,7 @@ val_set_decpts_proc(
                    XtPointer   res_value
 )
 {
-    if(obj_set_decimal_points(obj,(int)res_value)) return(FALSE);
+    if(obj_set_decimal_points(obj,(long)res_value)) return(FALSE);
     else return(TRUE);
 }
 
index 41c474d1a926189a92ba81ced5ef9b511756be32..accdc454320ba37fa4abea214dbabeec2bb3e01b 100644 (file)
@@ -826,7 +826,7 @@ common_special_type:
                          get_charset_text(az_value_entry->b_charset));
        else
            printf("  font  charset: userdefined(%x)",
-                get_charset_text((int) az_value_entry->az_charset_value));
+                get_charset_text((long) az_value_entry->az_charset_value));
 
        goto check_for_table_value;
 
index 9a49d9950e9956f50378b8c06c0232ead6d037bc..6e39ede98b19f091ee2cf195c76a47c287397b53 100644 (file)
@@ -1275,22 +1275,22 @@ static BOOL                     bil_token_table_inited = FALSE;
 /* 
  * Compares to entries (for qsort)
  */
-static int
+static long
 bil_token_entry_compare(const void *leftEntry, const void *rightEntry)
 {
-    return ((int)(((BilTokenIndexEntry)leftEntry)->string))
-               - ((int)(((BilTokenIndexEntry)rightEntry)->string));
+    return ((long)(((BilTokenIndexEntry)leftEntry)->string))
+               - ((long)(((BilTokenIndexEntry)rightEntry)->string));
 }
 
 
 /*
  * Compares a key to an entry (for bsearch)
  */
-static int
+static long
 bil_token_key_compare(const void *voidIstr, const void *voidEntry)
 {
-    return ((int)((ISTRING)(voidIstr)))
-               - ((int)(((BilTokenIndexEntry)voidEntry)->string));
+    return ((long)((ISTRING)(voidIstr)))
+               - ((long)(((BilTokenIndexEntry)voidEntry)->string));
 }
 
 
@@ -1720,9 +1720,9 @@ BIL_TOKEN
 bilP_string_to_token(STRING strToken)
 {
     ISTRING             istrToken = istr_create(strToken);
-    register int       midDiff;
-    register int       midIndex; 
-    int                        minIndex, maxIndex;
+    register long      midDiff;
+    register long      midIndex; 
+    long               minIndex, maxIndex;
     bil_token_table_check_init();
 
     /*
@@ -1733,8 +1733,8 @@ bilP_string_to_token(STRING strToken)
     while (minIndex < maxIndex)
     {
        midIndex = ((minIndex + maxIndex)>>1);
-       midDiff = (((int)bil_token_table_index[midIndex].string)
-                       - ((int)istrToken));
+       midDiff = (((long)bil_token_table_index[midIndex].string)
+                       - ((long)istrToken));
        if (midDiff < 0)
        {
            /* mid is too small - take upper half */
index 9098f8a6de9a4ba1a022acf0f2cec37384a1aeba..a9a7e5459a66f89a7ef71ee5c572da5202746d93 100644 (file)
@@ -2417,7 +2417,7 @@ bilP_load_attachment_value(BIL_TOKEN valueToken)
 {
     ABObj               target = NULL;
     STRING              name = NULL;
-    int                 value = 0;
+    long                value = 0;
     AB_COMPASS_POINT    cp = AB_CP_UNDEF;
 
     util_dprintf(3, "bilP_load_attachment_value: %d/%s\n\t%d/%s\n",
index f387334bfbdcac0801b0a703c8471f79a5960bed..c70771b6597a97a424da99ee7c67c2f382603ac3 100644 (file)
@@ -2304,7 +2304,7 @@ store_attribute(
         {
             AB_ARG_TYPE        type = AB_ARG_UNDEF;
  
-            if ((type = obj_get_arg_type(obj)) != NULL)
+            if ((type = obj_get_arg_type(obj)) != 0)
            {
                switch (type)
                {
@@ -2382,7 +2382,7 @@ store_attribute(
                    break;
                 case AB_ATTACH_GRIDLINE:
                 case AB_ATTACH_CENTER_GRIDLINE:
-                   abio_put_integer(outFile, (int)obj_get_attach_value(obj, AB_CP_NORTH));
+                   abio_put_integer(outFile, (long)obj_get_attach_value(obj, AB_CP_NORTH));
                    break;
                case AB_ATTACH_POINT:
                case AB_ATTACH_NONE:
@@ -2415,7 +2415,7 @@ store_attribute(
                     break;
                 case AB_ATTACH_GRIDLINE:
                 case AB_ATTACH_CENTER_GRIDLINE:
-                    abio_put_integer(outFile, (int)obj_get_attach_value(obj, AB_CP_SOUTH));
+                    abio_put_integer(outFile, (long)obj_get_attach_value(obj, AB_CP_SOUTH));
                     break;
                 default:
                    abio_put_integer(outFile, 0);
@@ -2447,7 +2447,7 @@ store_attribute(
                     break;
                 case AB_ATTACH_GRIDLINE:
                 case AB_ATTACH_CENTER_GRIDLINE:
-                    abio_put_integer(outFile, (int)obj_get_attach_value(obj, AB_CP_EAST));
+                    abio_put_integer(outFile, (long)obj_get_attach_value(obj, AB_CP_EAST));
                     break;
                 default:
                    abio_put_integer(outFile, 0);
@@ -2479,7 +2479,7 @@ store_attribute(
                     break;
                 case AB_ATTACH_GRIDLINE:
                 case AB_ATTACH_CENTER_GRIDLINE:
-                    abio_put_integer(outFile, (int)obj_get_attach_value(obj, AB_CP_WEST));
+                    abio_put_integer(outFile, (long)obj_get_attach_value(obj, AB_CP_WEST));
                     break;
                 default:
                    abio_put_integer(outFile, 0);
index 95f7e94cbd2c550ff785c1d53bb0a7f8724f22bd..857b7e90bae64b69b2003cfb7d3e521cd1fccf10 100644 (file)
@@ -116,7 +116,7 @@ gilP_load_object2(FILE * inFile, ABObj obj, ABObj parent)
 
             attr = gilP_string_to_att(istr_string(keyword));
             if ((rc = gilP_load_attribute_value(
-                                        inFile, obj, attr, parent)) != NULL)
+                                        inFile, obj, attr, parent)) != 0)
             {
                 return_value = rc;
                 goto epilogue;
index 225d958b58839b0b55acabe866dd75970565d848..65c4032a674ea8312829b0c8443084707b18c61c 100644 (file)
@@ -2443,7 +2443,7 @@ obj_set_to(ABObj obj, ABObj to)
     if (!obj_is_action(obj))
     {
        member_error(obj, "to");
-       return NULL;
+       return 0;
     }
     obj->info.action.to = to;
     return 0;
@@ -2468,7 +2468,7 @@ obj_set_from(ABObj obj, ABObj from)
     if (!obj_is_action(obj))
     {
        member_error(obj, "from");
-       return NULL;
+       return 0;
     }
     obj->info.action.from = from;
     return 0;
@@ -2686,7 +2686,7 @@ obj_set_when(ABObj obj, AB_WHEN when)
     if (obj->type != AB_TYPE_ACTION)
     {
        member_error(obj, "when");
-       return NULL;
+       return 0;
     }
     obj->info.action.when = when;
     return 0;
@@ -2978,7 +2978,7 @@ obj_get_attach_offset(
     default:
        if (util_get_verbosity() > 0)
            fprintf(stderr, "obj_get_attach_offset: invalid direction\n");
-       return NULL;
+       return 0;
 
     }
 }
@@ -3879,6 +3879,8 @@ obj_set_help_button(ABObj obj, BOOL has_button)
     obj->info.message.help_button = has_button;
     return 0;
 }
+
+int
 obj_set_tooltalk_level(ABObj obj, AB_TOOLTALK_LEVEL tt_level)
 {
     verify_for_write(obj);
index 24ba6787ef399ad89400f4c14f2fe42f921b93c5..6f5eba30953591276b79cfdf8c2a47f7998e768a 100644 (file)
@@ -74,7 +74,7 @@ static int objlistP_build_user_data_array(
     ((((_list)->user_datas == NULL) && ((_data) != NULL))? \
         objlistP_build_user_data_array(_list, _index, _data) \
     : \
-        ((int)((_list)->user_datas[(_index)] = (_data))) \
+        ((long)((_list)->user_datas[(_index)] = (_data))) \
     )
 */
        
@@ -85,7 +85,7 @@ static int objlistP_build_user_data_array(
        : \
             objlistP_build_user_data_array(_list, _index, _data)) \
     : \
-        ((int)((_list)->user_datas[(_index)] = (_data))) \
+        ((long)((_list)->user_datas[(_index)] = (_data))) \
     )
        
 #define objlistP_get_user_data(_list,_index) \
@@ -260,7 +260,7 @@ objlist_add_obj(ABObjList list, ABObj obj, void *clientData)
      */
     if (list->unique)
     {
-       int index = objlist_get_obj_index(list, obj);
+       long index = objlist_get_obj_index(list, obj);
        if (index >= 0)
        {
            objlistP_add_user_data(list, index, clientData);
index ee151c34b2001ac2a8f39e4a51e4d3736af6b40a..7dc2add431d5b7768010d7cca4ccdecabc7e54f2 100644 (file)
@@ -176,7 +176,7 @@ objP_tree_add_to_names_list(ABObj tree)
     }
     if (names == NULL)
     {
-       return NULL;
+       return 0;
     }
 
     for (trav_open(&trav, tree, AB_TRAV_ALL);
@@ -207,7 +207,7 @@ objP_tree_remove_from_names_list(ABObj tree)
     }
     if (names == NULL)
     {
-       return NULL;
+       return 0;
     }
 
     for (trav_open(&trav, tree, AB_TRAV_ALL);
index 423baeb9a1c0a3bcc5663ba73e47a96f6746112b..2442ac91400de07ae6160854a87bb22836a49b6a 100644 (file)
@@ -115,7 +115,7 @@ obj_scoped_find_by_name(ABObj searchFirstObj, STRING objName)
        moduleNameEndChar = *moduleNameEndPtr;
        *moduleNameEndPtr = 0;
     }
-    while (((*objNamePtr) != NULL) && (isspace(*objNamePtr)))
+    while (((*objNamePtr) != 0) && (isspace(*objNamePtr)))
     {
        ++objNamePtr;
     }
index fbd44da171eaf7c11c474c809f558fced0f62117..cd08c837ccf263c3c9daee327f4954fd435db118 100644 (file)
@@ -196,7 +196,7 @@ ab_ident_is_ok(STRING ident)
     {
        return FALSE;
     }
-    for (cp = ident; *cp != NULL; ++cp)
+    for (cp = ident; *cp != 0; ++cp)
     {
        if (isspace(*cp))
        {
@@ -789,7 +789,7 @@ obj_scoped_name_split(
        moduleNameEndChar = *module_name_end_ptr;
        *module_name_end_ptr = 0;
     }
-    while (((*obj_name_ptr) != NULL) && (isspace(*obj_name_ptr)))
+    while (((*obj_name_ptr) != 0) && (isspace(*obj_name_ptr)))
     {
        ++obj_name_ptr;
     }
@@ -1146,7 +1146,7 @@ obj_verify(ABObj obj)
                obj_name, (_fieldName)))
 
 #define check_str(obj, _field) \
-    ( ((int)(last_field = #_field)), \
+    ( ((long)(last_field = #_field)), \
       (istr_verify(obj->_field) >= 0)? \
        (0) \
     : \
index bb01f3abcaa0319ac36e6f9d0c23cb8dc2ddbf65..a85f8af57deca1c911ffef33cef9e58997206fe1 100644 (file)
@@ -1382,7 +1382,7 @@ objxm_dump_arglist_indented(
            case AB_ARG_WIDGET:
                if (cgen_args)
                {
-                   util_dprintf(0,"%s ", args[i].value != NULL?
+                   util_dprintf(0,"%s ", args[i].value != 0?
                        istr_string((ISTRING)(args[i].value)) : "NULL");
                }
                else
index dc6cc127893cfdb6950cc0c41f26037e5a1929c0..89a98cce25bf4c5d589ea18470644c6d1e601a59 100644 (file)
@@ -68,7 +68,7 @@
  */
 typedef struct
 {
-    int                rec_num;        /* record # (offset) in table */
+    long               rec_num;        /* record # (offset) in table */
 } TableIndexEntryRec, *TableIndexEntry, *TableIndex;
 
 
@@ -519,7 +519,7 @@ objxm_get_enum_xmdef(
     ISTRING    strdef
 )
 {
-    unsigned char      xmdef = NULL;
+    unsigned char      xmdef = 0;
     int                i;
     ObjxmEnumTable     *enum_table = NULL;
     ISTRING            istr_xmname = istr_dup_existing(xmname);
@@ -1052,12 +1052,12 @@ load_res_table(
 }
 
 
-static int
+static long
 xm_res_table_entry_xmname_compare(const void *leftEntry, const void *rightEntry)
 {
     return 
-       ((int)xm_res_table[((TableIndexEntry)leftEntry)->rec_num].xmname)
-           - ((int)xm_res_table[((TableIndexEntry)rightEntry)->rec_num].xmname);
+       ((long)xm_res_table[((TableIndexEntry)leftEntry)->rec_num].xmname)
+           - ((long)xm_res_table[((TableIndexEntry)rightEntry)->rec_num].xmname);
 }
 
 
@@ -1115,7 +1115,7 @@ find_res_entry_by_xmname(ISTRING istr_xmname)
         midIndex = ((minIndex + maxIndex)>>1);
        entry = get_indexed_entry(
                    xm_res_table,xm_res_table_xmname_index,midIndex);
-        midDiff = ((int)(entry->xmname)) - ((int)istr_xmname);
+        midDiff = ((long)(entry->xmname)) - ((long)istr_xmname);
         if (midDiff < 0)
         {
             /* mid is too small - take upper half */
index 0c0c220629c8fd9d297b0ed70b8d4f29d26bf173..263cdeb11817c662bb4420db778fafda29dedb2c 100644 (file)
@@ -142,7 +142,7 @@ objxm_color_exists(
     String     colorname
 )
 {
-    static Colormap     colormap = NULL;
+    static Colormap     colormap = 0;
     static Display     *display = NULL;
     XColor              color;
     XColor              exact_color;
@@ -194,7 +194,7 @@ objxm_filebase_to_pixmap(
     if (util_strempty(filebase))
         return ERR_BAD_PARAM2;
 
-    *pixmap_p = NULL;
+    *pixmap_p = 0;
 
     /* Use Pixmap conversion callback if it exists */
     if (ObjxmP_filename_to_pixmap_cb != NULL)
@@ -308,7 +308,7 @@ convert_file_to_pixmap(
     Pixel       fgPixel = 0;
     Pixel       bgPixel = 0; 
 
-    *pixmap_p = NULL;
+    *pixmap_p = 0;
 
     /*
      * Get default values
@@ -329,7 +329,7 @@ convert_file_to_pixmap(
      * In CDE, XmGetPixmap handles .xpm files, as well.
      */
     *pixmap_p = XmGetPixmap(screen, filename, fgPixel, bgPixel);
-    if ((*pixmap_p == NULL) || (*pixmap_p == XmUNSPECIFIED_PIXMAP))
+    if ((*pixmap_p == 0) || (*pixmap_p == XmUNSPECIFIED_PIXMAP))
     {
        return -1;
     }
index b972c4b35752168fa620d1a543e082d7a0a48e8a..81af6d10b6b5106321a5f84045c344bcf4cd5990 100644 (file)
@@ -85,7 +85,7 @@ typedef struct BUCKET
  */
 STRING Istr_null_string= "(nil)";
 STRN   *int_array= NULL;       /* unique number array  */
-int    num_count  = 1;      /* unique number counter */
+long   num_count  = 1;         /* unique number counter */
 
 static BucketRec       hashtable[NUMBUCKETS];
 
@@ -94,10 +94,10 @@ STRN *debug_istr= NULL;             /* debugging shortcut for clients (see */
                                /* comment at top of this file) */
 #endif /* DEBUG */
 
-static int *freelist;           /* freelist for unused numbers */
+static long *freelist;           /* freelist for unused numbers */
 
-static int freecount  = 0;      /* freelist count */
-static int hash_count = 0;      /* total number that has been inserted */
+static long freecount  = 0;      /* freelist count */
+static long hash_count = 0;      /* total number that has been inserted */
 
 static unsigned        hashing(
                    char *p
@@ -125,7 +125,7 @@ static int  istrP_errmsg_noexist(int istr_value);
 #define int_array_set(ptr)     (int_array = (ptr))
 #endif
 #define istrP_int_to_client(intVal)    ((ISTRING)(intVal))
-#define istrP_client_to_int(istrVal)   ((int)(istrVal))
+#define istrP_client_to_int(istrVal)   ((long)(istrVal))
 #define return_istr(x)                 return istrP_int_to_client(x)
 
 /*****************************************************************************/
@@ -142,7 +142,7 @@ istr_create (
 )
 {
     int hashval;
-    int str_exists;
+    long str_exists;
     Bucket     new_bucket;
     int i;
     Bucket     entry;
@@ -310,7 +310,7 @@ istrP_create_alloced_impl(
 )
 {
     int hashval;
-    int str_exists;
+    long str_exists;
     Bucket     new_bucket;
     int i;
     Bucket     entry;
@@ -487,7 +487,7 @@ istr_create_const(
 )
 {
     int hashval;
-    int str_exists;
+    long str_exists;
     Bucket     new_bucket;
     int i;
     Bucket     entry;
@@ -668,7 +668,7 @@ istr_dup_existing(
 )
 {
     int hashval;
-    int str_exists;
+    long str_exists;
 
     if (string == NULL)
     {
@@ -696,7 +696,7 @@ istrP_destroy_impl(
     ISTRING *istringClientPtr
 )
 {
-    int istring = (int)(*istringClientPtr);
+    long istring = (long)(*istringClientPtr);
     int val;                 /* hashing value */
     int i;
     Bucket     entry;
@@ -712,7 +712,7 @@ istrP_destroy_impl(
         (int_array[istring].read_const == 0)))
     {
        istrP_errmsg_noexist(istring);
-        return NULL;
+        return 0;
     }
     if (int_array[istring].read_const == 1)  /* const entry */
     {
@@ -752,13 +752,13 @@ istrP_destroy_impl(
 /* put unused int_array location of the freelist */
         if(free_num == 0)
         {
-            freelist = (int *)malloc(ARRAYSIZE * sizeof(int));
+            freelist = (long *)malloc(ARRAYSIZE * sizeof(long));
             if (freelist == NULL)
             {
                 fprintf(stderr,
                    catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 3,
                    "ISTR: error in allocating memory\n") );
-                return NULL ;
+                return 0 ;
             }  
             free_num = 1;
         }
@@ -771,15 +771,15 @@ istrP_destroy_impl(
         else  /* need more freelist space */
         { 
             free_num++;
-            freelist = (int *)realloc(freelist,
-                (ARRAYSIZE * free_num) * sizeof(int));
+            freelist = (long *)realloc(freelist,
+                (ARRAYSIZE * free_num) * sizeof(long));
            assert(freelist != NULL);
             if (freelist == NULL)
             {
                 fprintf(stderr,
                    catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 3,
                    "ISTR: error in allocating memory\n") );
-                return NULL ;
+                return 0 ;
             }  
             freelist[freecount] = istring;
             freecount++;
@@ -789,7 +789,7 @@ istrP_destroy_impl(
     /*
      * Set the client's variable to NULL
      */
-    istring = NULL;
+    istring = 0;
     (*istringClientPtr) = istrP_int_to_client(istring);
     return 1;
 }
@@ -804,7 +804,7 @@ istr_dup(
     ISTRING istringClientVal
 )
 {
-    int                istring= istrP_client_to_int(istringClientVal);
+    long       istring= istrP_client_to_int(istringClientVal);
 
     if(istring == 0) 
     {
@@ -831,7 +831,7 @@ istrP_get_string_verify(
     ISTRING istringClientVal
 )
 {
-    int                istring = istrP_client_to_int(istringClientVal);
+    long       istring = istrP_client_to_int(istringClientVal);
 
     if(istring == 0) 
     {
@@ -932,13 +932,13 @@ insert_array(
 
     if(hash_count == 0)
     {
-        int_array_set((STRN *)malloc(ARRAYSIZE * sizeof(STRN)));
+        int_array_set((STRN *)calloc(ARRAYSIZE, sizeof(STRN)));
         if (int_array == NULL)
         {
             fprintf(stderr,
                catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 3,
                "ISTR: error in allocating memory\n") );
-            return NULL ;
+            return 0 ;
         }  
         array_num = 1;
     }
@@ -973,7 +973,7 @@ insert_array(
             fprintf(stderr,
                catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 3,
                "ISTR: error in allocating memory\n") );
-            return NULL ;
+            return 0 ;
         }  
         int_array[val].refcount =1;
         if (flag == 1)
index 09b46b4ed9cbeea4c4750591f488b83ea05e7d18..a402a324052107a2d80062bb6df45885ad66e495 100644 (file)
@@ -69,7 +69,7 @@ static int strlistP_build_user_data_array(
     ((((_list)->user_datas == NULL) && ((_data) != NULL))? \
         strlistP_build_user_data_array(_list, _index, _data) \
     : \
-        ((int)((_list)->user_datas[(_index)] = (_data))) \
+        ((long)((_list)->user_datas[(_index)] = (_data))) \
     )
        
 
@@ -189,10 +189,10 @@ strlist_istr_exists(StringList list, ISTRING istring)
 }
 
 
-int
+long
 strlist_set_istr_data(StringList list, ISTRING istring, void *data)
 {
-    int                index = strlist_get_istr_index(list, istring);
+    long               index = strlist_get_istr_index(list, istring);
     if (index < 0)
     {
        return index;
@@ -215,10 +215,10 @@ strlist_get_istr_data(StringList list, ISTRING istring)
 /*
  * Returns the index of the given string, or -1 if it doesn't exist
  */
-int
+long
 strlist_get_istr_index(StringList list, ISTRING string)
 {
-    int                        index = -1;
+    long               index = -1;
     int                 i = 0;
     int                 num_strings = list->num_strings;
 
@@ -293,10 +293,10 @@ epilogue:
 }
 
 
-int
+long
 strlist_remove_istr(StringList list, ISTRING istring)
 {
-    int                index = strlist_get_istr_index(list, istring);
+    long       index = strlist_get_istr_index(list, istring);
     if (index < 0)
     {
        return 0;
@@ -485,10 +485,10 @@ strlist_str_exists(StringList list, STRING string)
 }
 
 
-int
+long
 strlist_get_str_index(StringList list, STRING string)
 {
-    int                index = -1;
+    long               index = -1;
     ISTRING    istring = istr_create(string);
     if (istring != NULL)
     {
@@ -506,10 +506,10 @@ strlist_get_str(StringList list, int whichString, void **clientDataOut)
 }
 
 
-int
+long
 strlist_remove_str(StringList list, STRING string)
 {
-    int                return_value = 0;
+    long               return_value = 0;
     ISTRING    istring = istr_dup_existing(string);
     if (istring != NULL)
     {
@@ -520,10 +520,10 @@ strlist_remove_str(StringList list, STRING string)
 }
 
 
-int
+long
 strlist_set_str_data(StringList list, STRING string, void *data)
 {
-    int                return_value = 0;
+    long               return_value = 0;
     ISTRING    istring = istr_dup_existing(string);
     if (istring != NULL)
     {
@@ -571,6 +571,7 @@ strlist_dup(StringList list)
 **************************************************************************/
 
 
+int
 strlistP_shrink_array(StringList list, int sizeDiff)
 {
     int                return_value = 0;
index 941328212c0a01e063b50bf5095fd379828f6096..9c505196e91cc7f6ebc69f4d8ed889c9a81fd9ec 100644 (file)
@@ -104,12 +104,12 @@ int               strlist_dump(StringList list);
  * STRING interfaces
  */
 int            strlist_add_str(StringList, STRING s, void *userData);
-int            strlist_remove_str(StringList, STRING s);
+long           strlist_remove_str(StringList, STRING s);
 BOOL           strlist_str_exists(StringList list, STRING s);
-int            strlist_get_str_index(StringList list, STRING s);
+long           strlist_get_str_index(StringList list, STRING s);
 STRING         strlist_get_str(StringList, 
                                int whichString, void **userDataOut);
-int            strlist_set_str_data(StringList, STRING string, void *data);
+long           strlist_set_str_data(StringList, STRING string, void *data);
 void           *strlist_get_str_data(StringList, STRING string);
 StringList     strlist_dup(StringList);
 
@@ -120,14 +120,14 @@ StringList        strlist_dup(StringList);
  * The STRINGs and ISTRING are kept in the same list, and behave identically
  */
 int            strlist_add_istr(StringList, ISTRING s, void *userData);
-int            strlist_add_index_istr(StringList, 
+long           strlist_add_index_istr(StringList, 
                                int index, ISTRING s, void *userData);
 BOOL           strlist_istr_exists(StringList list, ISTRING s);
-int            strlist_get_istr_index(StringList list, ISTRING s);
+long           strlist_get_istr_index(StringList list, ISTRING s);
 ISTRING                strlist_get_istr(StringList, 
                                int whichString, void **userDataOut);
-int            strlist_set_istr_data(StringList, ISTRING istring, void *data);
+long           strlist_set_istr_data(StringList, ISTRING istring, void *data);
 void           *strlist_get_istr_data(StringList, ISTRING istring);
-int            strlist_remove_istr(StringList, ISTRING s);
+long           strlist_remove_istr(StringList, ISTRING s);
 
 #endif /* _ABUTIL_STRLIST_H_ */