home: hub: 9ficl

Download patch

ref: 6c465b66dbeae1f3181045552ed71db07ef0fac1
parent: d8d895490817c7d9cd8c2bdf67ff61aebf101901
author: asau <asau@ficl.sf.net>
date: Wed Oct 20 08:31:31 CDT 2010

When printing, convert pointers to uintmax_t,
convert FICL integers to intmax_t or uintmax_t as appropriate.

--- a/float.c
+++ b/float.c
@@ -4,7 +4,7 @@
 ** ANS Forth FLOAT word-set written in C
 ** Author: Guy Carver & John Sadler (john_sadler@alum.mit.edu)
 ** Created: Apr 2001
-** $Id: float.c,v 1.10 2010/09/13 18:43:04 asau Exp $
+** $Id: float.c,v 1.11 2010/10/20 13:31:31 asau Exp $
 *******************************************************************/
 /*
 ** Copyright (c) 1997-2001 John Sadler (john_sadler@alum.mit.edu)
@@ -159,7 +159,7 @@
 {
     struct stackContext *context = (struct stackContext *)c;
     char buffer[64];
-    sprintf(buffer, "[0x%08x %3d] %16f (0x%08x)\n", cell, context->count++, (double)(cell->f), cell->i);
+    sprintf(buffer, "[0x%08jx %3d] %16f (0x%08jx)\n", (uintmax_t)cell, context->count++, (double)(cell->f), (uintmax_t)cell->u);
     ficlVmTextOut(context->vm, buffer);
 	return FICL_TRUE;
 }
--- a/tools.c
+++ b/tools.c
@@ -3,7 +3,7 @@
 ** Forth Inspired Command Language - programming tools
 ** Author: John Sadler (john_sadler@alum.mit.edu)
 ** Created: 20 June 2000
-** $Id: tools.c,v 1.12 2010/08/12 13:57:22 asau Exp $
+** $Id: tools.c,v 1.13 2010/10/20 13:31:31 asau Exp $
 *******************************************************************/
 /*
 ** Copyright (c) 1997-2001 John Sadler (john_sadler@alum.mit.edu)
@@ -567,7 +567,7 @@
 {
     struct stackContext *context = (struct stackContext *)c;
     char buffer[64];
-    sprintf(buffer, "[0x%08x %3d]: %12d (0x%08x)\n", cell, context->count++, cell->i, cell->i);
+    sprintf(buffer, "[0x%08jx %3d]: %12jd (0x%08jx)\n", (uintmax_t)cell, context->count++, (intmax_t)cell->i, (uintmax_t)cell->i);
 	ficlVmTextOut(context->vm, buffer);
 	return FICL_TRUE;
 }
@@ -580,7 +580,7 @@
 
     FICL_STACK_CHECK(stack, 0, 0);
 
-	sprintf(buffer, "[%s stack has %d entries, top at 0x%08x]\n", stack->name, ficlStackDepth(stack), stack->top);
+	sprintf(buffer, "[%s stack has %d entries, top at 0x%08jx]\n", stack->name, ficlStackDepth(stack), (uintmax_t)stack->top);
 	ficlVmTextOut(vm, buffer);
 
     if (callback == NULL)
@@ -592,7 +592,7 @@
     }
 	ficlStackWalk(stack, callback, context, FICL_FALSE);
 
-	sprintf(buffer, "[%s stack base at 0x%08x]\n", stack->name, stack->base);
+	sprintf(buffer, "[%s stack base at 0x%08jx]\n", stack->name, (uintmax_t)stack->base);
 	ficlVmTextOut(vm, buffer);
 
     return;
@@ -612,7 +612,7 @@
 {
     struct stackContext *context = (struct stackContext *)c;
     char buffer[32];
-    sprintf(buffer, "%s%d", context->count ? " " : "", cell->i);
+    sprintf(buffer, "%s%jd", context->count ? " " : "", (intmax_t)cell->i);
     context->count++;
     ficlVmTextOut(context->vm, buffer);
 	return FICL_TRUE;
@@ -644,7 +644,7 @@
     struct stackContext *context = (struct stackContext *)c;
     char buffer[128];
 
-    sprintf(buffer, "[0x%08x %3d] %12d (0x%08x)", cell, context->count++, cell->i, cell->i);
+    sprintf(buffer, "[0x%08jx %3d] %12jd (0x%08jx)", (uintmax_t)cell, context->count++, (intmax_t)cell->i, (uintmax_t)cell->i);
 
     /*
     ** Attempt to find the word that contains the return