shithub: 9ferno

Download patch

ref: 3f5999b1c26a1122ab6eb4da915837014a986495
parent: b9b3baa39ef278fcaf53302031c251432d430acd
author: joe9 <joe9mail@gmail.com>
date: Sat Feb 13 00:24:10 EST 2021

changing WORD to intptr

--- a/9front/amd64/include/u.h
+++ b/9front/amd64/include/u.h
@@ -1,1 +1,3 @@
 #include "/amd64/include/u.h"
+typedef intptr WORD;
+typedef uintptr        UWORD;
--- a/include/interp.h
+++ b/include/interp.h
@@ -1,6 +1,8 @@
 typedef uchar		BYTE;		/* 8  bits */
-typedef int		WORD;		/* 32 bits */
-typedef unsigned int	UWORD;		/* 32 bits */
+/* moved the WORD and UWORD to 9front/amd64/include/u.h
+	with the goal of making it architecture specific */
+/*typedef int		WORD;*/		/* 32 bits */
+/*typedef unsigned int	UWORD;*/		/* 32 bits */
 typedef vlong		LONG;		/* 64 bits */
 typedef uvlong		ULONG;		/* 64 bits */
 typedef double		REAL;		/* 64 double IEEE754 */
--- a/include/isa.h
+++ b/include/isa.h
@@ -223,7 +223,7 @@
 	REGRET	= 4,
 	NREG	= 5,
 
-	IBY2WD	= 4,
+	IBY2WD	= (sizeof(intptr)) /* 4 */,
 	IBY2FT	= 8,
 	IBY2LG	= 8,
 
--- a/libinterp/math.c
+++ b/libinterp/math.c
@@ -696,7 +696,7 @@
 
 	f = fp;
 
-	f->ret->t1 = __ieee754_lgamma_r(f->x, &f->ret->t0);
+	f->ret->t1 = __ieee754_lgamma_r(f->x, (int*)&f->ret->t0);
 }
 
 void
--- a/limbo/ecom.c
+++ b/limbo/ecom.c
@@ -1380,9 +1380,9 @@
 			if(left->ty->tof == treal)
 				op = IINDF;
 			break;
-		case IBY2WD:
+/*		case IBY2WD: TODO make this into an if from case to check the sizeof intptr
 			op = IINDW;
-			break;
+			break; */
 		case 1:
 			op = IINDB;
 			break;