WIP to make dtbuilder work on 64bit.
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.
This commit is contained in:
committed by
Jon Trulson
parent
50e6c86bf4
commit
1177e21080
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user