summaryrefslogtreecommitdiff
path: root/src/Convert.c
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-14 16:48:49 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-14 16:48:49 +0000
commitbdc0667ef29e24b1a2188b11546d843a7d3e5ef6 (patch)
treee0a23167aca0fb1127f4cd78edf458b633b31eac /src/Convert.c
parent6a13c9e08bb042c81ae904c44a38a50d785c824e (diff)
Diffstat (limited to 'src/Convert.c')
-rw-r--r--src/Convert.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/Convert.c b/src/Convert.c
index 08d461f..544eb80 100644
--- a/src/Convert.c
+++ b/src/Convert.c
@@ -32,6 +32,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
+/* $XFree86: xc/lib/Xt/Convert.c,v 3.7 2001/12/14 19:56:09 dawes Exp $ */
/*
@@ -61,6 +62,7 @@ in this Software without prior written authorization from The Open Group.
#include "IntrinsicI.h"
#include "StringDefs.h"
+#include "Intrinsic.h"
/* Conversion procedure hash table */
@@ -610,12 +612,8 @@ static void ComputeArgs(widget, convert_args, num_args, args)
break;
case XtBaseOffset:
-#if defined(CRAY1) && !defined(__STDC__)
args[i].addr =
- (XPointer)((int)widget + (int)convert_args[i].address_id);
-#else
- args[i].addr = (XPointer)((char *)widget + (int)convert_args[i].address_id);
-#endif
+ (XPointer)((char *)widget + (long)convert_args[i].address_id);
break;
case XtWidgetBaseOffset:
@@ -626,13 +624,8 @@ static void ComputeArgs(widget, convert_args, num_args, args)
ancestor = _XtWindowedAncestor(widget);
}
-#if defined(CRAY1) && !defined(__STDC__)
- args[i].addr =
- (XPointer)((int)ancestor + (int)convert_args[i].address_id);
-#else
args[i].addr =
- (XPointer)((char *)ancestor + (int)convert_args[i].address_id);
-#endif
+ (XPointer)((char *)ancestor + (long)convert_args[i].address_id);
break;
case XtImmediate:
@@ -648,25 +641,21 @@ static void ComputeArgs(widget, convert_args, num_args, args)
/* Convert in place for next usage */
convert_args[i].address_mode = XtResourceQuark;
convert_args[i].address_id =
- (XtPointer)XrmStringToQuark((String)convert_args[i].address_id);
+ (XtPointer)(long)XrmStringToQuark((String)convert_args[i].address_id);
/* Fall through */
case XtResourceQuark:
if (! ResourceQuarkToOffset(widget->core.widget_class,
- (XrmQuark) convert_args[i].address_id, &offset)) {
+ (XrmQuark)(long) convert_args[i].address_id, &offset)) {
params[0]=
- XrmQuarkToString((XrmQuark) convert_args[i].address_id);
+ XrmQuarkToString((XrmQuark)(long) convert_args[i].address_id);
XtAppWarningMsg(XtWidgetToApplicationContext(widget),
"invalidResourceName","computeArgs",XtCXtToolkitError,
"Cannot find resource name %s as argument to conversion",
params,&num_params);
offset = 0;
}
-#if defined(CRAY1) && !defined(__STDC__)
- args[i].addr = (XPointer)((int)widget + offset);
-#else
args[i].addr = (XPointer)((char *)widget + offset);
-#endif
break;
default:
params[0] = XtName(widget);
@@ -693,7 +682,7 @@ void XtDirectConvert(converter, args, num_args, from, to)
LOCK_PROCESS;
/* Try to find cache entry for conversion */
- hash = ((int)(converter) >> 2) + from->size + *((char *) from->addr);
+ hash = ((long) converter >> 2) + from->size + *((char *) from->addr);
if (from->size > 1) hash += ((char *) from->addr)[1];
for (p = cacheHashTable[hash & CACHEHASHMASK]; p; p = p->next) {
@@ -791,7 +780,7 @@ CallConverter(dpy, converter,
LOCK_PROCESS;
/* Try to find cache entry for conversion */
- hash = ((int)(converter) >> 2) + from->size + *((char *) from->addr);
+ hash = ((long)(converter) >> 2) + from->size + *((char *) from->addr);
if (from->size > 1) hash += ((char *) from->addr)[1];
if (cP->cache_type != XtCacheNone) {