home: hub: 9ficl

Download patch

ref: 704578d577e1bf25d018b86e07fb234957c505c0
parent: 55fabce6bc6c874a0f4bc2a55a41549faf94fb97
author: asau <asau@ficl.sf.net>
date: Wed Nov 3 09:44:38 CDT 2010

Fix types to make it work on 32-bit platfom in 64 bits.

--- a/ficl.h
+++ b/ficl.h
@@ -4,7 +4,7 @@
 ** Author: John Sadler (john_sadler@alum.mit.edu)
 ** Created: 19 July 1997
 ** Dedicated to RHS, in loving memory
-** $Id: ficl.h,v 1.27 2010/11/01 14:10:27 asau Exp $
+** $Id: ficl.h,v 1.28 2010/11/03 14:44:38 asau Exp $
 ********************************************************************
 **
 ** Copyright (c) 1997-2001 John Sadler (john_sadler@alum.mit.edu)
@@ -1039,7 +1039,7 @@
 
     ficlInstructionFourByteTrick = 0x10000000
 };
-typedef intptr_t ficlInstruction;
+typedef ficlInteger ficlInstruction;
 
 
 /* 
@@ -1595,7 +1595,7 @@
     ficlDictionary *dictionary;
     ficlDictionary *environment;
 
-    ficlWord *interpreterLoop[3];
+    ficlInstruction interpreterLoop[3];
     ficlWord *parseList[FICL_MAX_PARSE_STEPS];
 
     ficlWord *exitInnerWord;
--- a/vm.c
+++ b/vm.c
@@ -3,7 +3,7 @@
 ** Forth Inspired Command Language - virtual machine methods
 ** Author: John Sadler (john_sadler@alum.mit.edu)
 ** Created: 19 July 1997
-** $Id: vm.c,v 1.18 2010/11/01 14:10:27 asau Exp $
+** $Id: vm.c,v 1.19 2010/11/03 14:44:38 asau Exp $
 *******************************************************************/
 /*
 ** This file implements the virtual machine of Ficl. Each virtual
@@ -444,7 +444,7 @@
 		#define POP_CELL_POINTER(cp)         cell = (cp); goto POP_CELL_POINTER_MINIPROC
 
 		BRANCH_MINIPROC:
-			ip += *(int *)ip;
+			ip += *(ficlInstruction *)ip;
 			continue;
 
 		#define BRANCH()         goto BRANCH_MINIPROC
@@ -469,7 +469,7 @@
 		#define POP_CELL_POINTER_DOUBLE(cp)  cell = (cp); *cell = *dataTop--; cell[1] = *dataTop--; continue
 		#define POP_CELL_POINTER(cp)         cell = (cp); *cell = *dataTop--; continue
 
-		#define BRANCH()         ip += *(ficlInteger *)ip; continue
+		#define BRANCH()         ip += *(ficlInstruction *)ip; continue
 		#define EXIT_FUNCTION()  ip = (ficlInstruction *)((returnTop--)->p); continue
 
 #endif /* FICL_WANT_SIZE */