summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
90975d2)
Use fseek and ftell on WIN32 instead of fseeko and ftello.
WIDTHOPT=
FULL_WARNINGS = \
WIDTHOPT=
FULL_WARNINGS = \
-fsigned-char \
-fno-builtin \
-fno-unroll-loops \
-fpeephole \
-fno-keep-inline-functions \
-fsigned-char \
-fno-builtin \
-fno-unroll-loops \
-fpeephole \
-fno-keep-inline-functions \
-Wcast-qual \
-Wall \
-Wwrite-strings \
-Wcast-qual \
-Wall \
-Wwrite-strings \
@echo " The file 'fth/pfdicdat.h' is generated by pForth. It contains a binary image of the Forth dictionary."
@echo " It allows pForth to work as a standalone image that does not need to load a dictionary file."
@echo " The file 'fth/pfdicdat.h' is generated by pForth. It contains a binary image of the Forth dictionary."
@echo " It allows pForth to work as a standalone image that does not need to load a dictionary file."
+test: $(PFORTHAPP)
+ cd $(FTHDIR); ../pforth_standalone -q t_corex.fth
+ cd $(FTHDIR); ../pforth_standalone -q t_strings.fth
+ cd $(FTHDIR); ../pforth_standalone -q t_locals.fth
+ cd $(FTHDIR); ../pforth_standalone -q t_alloc.fth
+ cd $(FTHDIR); ../pforth_standalone -q t_floats.fth
clean:
rm -f $(PFOBJS) $(PFEMBOBJS)
clean:
rm -f $(PFOBJS) $(PFEMBOBJS)
gVarEcho = 0; /* Echo input. */\r
gVarTraceLevel = 0; /* Trace Level for Inner Interpreter. */\r
gVarTraceFlags = 0; /* Enable various internal debug messages. */\r
gVarEcho = 0; /* Echo input. */\r
gVarTraceLevel = 0; /* Trace Level for Inner Interpreter. */\r
gVarTraceFlags = 0; /* Enable various internal debug messages. */\r
- gVarQuiet = 0; /* Suppress unnecessary messages, OK, etc. */\r
gVarReturnCode = 0; /* Returned to caller of Forth, eg. UNIX shell. */\r
gIncludeIndex = 0;\r
\r
gVarReturnCode = 0; /* Returned to caller of Forth, eg. UNIX shell. */\r
gIncludeIndex = 0;\r
\r
* to (ucell_t) on 16 bit systems.\r
*/\r
#define DIC_ALIGNMENT_SIZE ((ucell_t)(0x10))\r
* to (ucell_t) on 16 bit systems.\r
*/\r
#define DIC_ALIGNMENT_SIZE ((ucell_t)(0x10))\r
-#define DIC_ALIGN(addr) ((uint8_t *)((((ucell_t)(addr)) + DIC_ALIGNMENT_SIZE - 1) & ~(DIC_ALIGNMENT_SIZE - 1)))\r
+#define DIC_ALIGN(addr) ((((ucell_t)(addr)) + DIC_ALIGNMENT_SIZE - 1) & ~(DIC_ALIGNMENT_SIZE - 1))\r
\r
/* Allocate memory for header. */\r
if( HeaderSize > 0 )\r
{\r
\r
/* Allocate memory for header. */\r
if( HeaderSize > 0 )\r
{\r
- dic->dic_HeaderBaseUnaligned = ( uint8_t * ) pfAllocMem( (ucell_t) HeaderSize + DIC_ALIGNMENT_SIZE );\r
+ dic->dic_HeaderBaseUnaligned = (ucell_t) pfAllocMem( (ucell_t) HeaderSize + DIC_ALIGNMENT_SIZE );\r
if( !dic->dic_HeaderBaseUnaligned ) goto nomem;\r
/* Align header base. */\r
dic->dic_HeaderBase = DIC_ALIGN(dic->dic_HeaderBaseUnaligned);\r
if( !dic->dic_HeaderBaseUnaligned ) goto nomem;\r
/* Align header base. */\r
dic->dic_HeaderBase = DIC_ALIGN(dic->dic_HeaderBaseUnaligned);\r
- pfSetMemory( dic->dic_HeaderBase, 0xA5, (ucell_t) HeaderSize);\r
+ pfSetMemory( (char *) dic->dic_HeaderBase, 0xA5, (ucell_t) HeaderSize);\r
dic->dic_HeaderLimit = dic->dic_HeaderBase + HeaderSize;\r
dic->dic_HeaderPtr = dic->dic_HeaderBase;\r
}\r
else\r
{\r
dic->dic_HeaderLimit = dic->dic_HeaderBase + HeaderSize;\r
dic->dic_HeaderPtr = dic->dic_HeaderBase;\r
}\r
else\r
{\r
- dic->dic_HeaderBase = NULL;\r
+ dic->dic_HeaderBase = 0;\r
}\r
\r
/* Allocate memory for code. */\r
}\r
\r
/* Allocate memory for code. */\r
- dic->dic_CodeBaseUnaligned = ( uint8_t * ) pfAllocMem( (ucell_t) CodeSize + DIC_ALIGNMENT_SIZE );\r
+ dic->dic_CodeBaseUnaligned = (ucell_t) pfAllocMem( (ucell_t) CodeSize + DIC_ALIGNMENT_SIZE );\r
if( !dic->dic_CodeBaseUnaligned ) goto nomem;\r
dic->dic_CodeBase = DIC_ALIGN(dic->dic_CodeBaseUnaligned);\r
if( !dic->dic_CodeBaseUnaligned ) goto nomem;\r
dic->dic_CodeBase = DIC_ALIGN(dic->dic_CodeBaseUnaligned);\r
- pfSetMemory( dic->dic_CodeBase, 0x5A, (ucell_t) CodeSize);\r
+ pfSetMemory( (char *) dic->dic_CodeBase, 0x5A, (ucell_t) CodeSize);\r
\r
dic->dic_CodeLimit = dic->dic_CodeBase + CodeSize;\r
\r
dic->dic_CodeLimit = dic->dic_CodeBase + CodeSize;\r
- dic->dic_CodePtr.Byte = dic->dic_CodeBase + QUADUP(NUM_PRIMITIVES); \r
+ dic->dic_CodePtr.Byte = ((uint8_t *) (dic->dic_CodeBase + QUADUP(NUM_PRIMITIVES))); \r
\r
return (PForthDictionary) dic;\r
nomem:\r
\r
return (PForthDictionary) dic;\r
nomem:\r
{\r
pfSetCurrentTask( cftd );\r
\r
{\r
pfSetCurrentTask( cftd );\r
\r
- if( !pfQueryQuiet() )\r
{\r
MSG( "PForth V"PFORTH_VERSION );\r
if( IsHostLittleEndian() ) MSG("-LE");\r
{\r
MSG( "PForth V"PFORTH_VERSION );\r
if( IsHostLittleEndian() ) MSG("-LE");\r
}\r
}\r
if( dic == NULL ) goto error2;\r
}\r
}\r
if( dic == NULL ) goto error2;\r
+ \r
+ if( !gVarQuiet )\r
+ {\r
+ EMIT_CR;\r
+ }\r
+ \r
pfDebugMessage("pfDoForth: try AUTO.INIT\n");\r
Result = pfExecIfDefined("AUTO.INIT");\r
if( Result != 0 )\r
pfDebugMessage("pfDoForth: try AUTO.INIT\n");\r
Result = pfExecIfDefined("AUTO.INIT");\r
if( Result != 0 )\r
error2:\r
MSG("pfDoForth: Error occured.\n");\r
pfDeleteTask( cftd );\r
error2:\r
MSG("pfDoForth: Error occured.\n");\r
pfDeleteTask( cftd );\r
- // Terminate so we restore normal shell tty mode.\r
+ /* Terminate so we restore normal shell tty mode. */\r
pfTerm();\r
\r
#ifdef PF_USER_INIT\r
pfTerm();\r
\r
#ifdef PF_USER_INIT\r
ucell_t dic_HeaderPtr;\r
ucell_t dic_HeaderLimit;\r
/* Code segment contains tokenized code and data. */\r
ucell_t dic_HeaderPtr;\r
ucell_t dic_HeaderLimit;\r
/* Code segment contains tokenized code and data. */\r
ucell_t dic_CodeBaseUnaligned;\r
ucell_t dic_CodeBaseUnaligned;\r
ucell_t dic_CodeBase;\r
union\r
{\r
ucell_t dic_CodeBase;\r
union\r
{\r
#define IN_DICS(addr) (IN_CODE_DIC(addr) || IN_NAME_DIC(addr))\r
\r
/* Address conversion */\r
#define IN_DICS(addr) (IN_CODE_DIC(addr) || IN_NAME_DIC(addr))\r
\r
/* Address conversion */\r
-#define ABS_TO_NAMEREL( a ) ((cell_t) (((uint8_t *) a) - NAME_BASE ))\r
-#define ABS_TO_CODEREL( a ) ((cell_t) (((uint8_t *) a) - CODE_BASE ))\r
-#define NAMEREL_TO_ABS( a ) ((char *) (((cell_t) a) + NAME_BASE))\r
-#define CODEREL_TO_ABS( a ) ((cell_t *) (((cell_t) a) + CODE_BASE))\r
+#define ABS_TO_NAMEREL( a ) ((cell_t) (((ucell_t) a) - NAME_BASE ))\r
+#define ABS_TO_CODEREL( a ) ((cell_t) (((ucell_t) a) - CODE_BASE ))\r
+#define NAMEREL_TO_ABS( a ) ((ucell_t) (((cell_t) a) + NAME_BASE))\r
+#define CODEREL_TO_ABS( a ) ((ucell_t) (((cell_t) a) + CODE_BASE))\r
\r
/* The check for >0 is only needed for CLONE testing. !!! */\r
#define IsTokenPrimitive(xt) ((xt<gNumPrimitives) && (xt>=0))\r
\r
\r
/* The check for >0 is only needed for CLONE testing. !!! */\r
#define IsTokenPrimitive(xt) ((xt<gNumPrimitives) && (xt>=0))\r
\r
-#define FREE_VAR(v) { if (v) { pfFreeMem(v); v = NULL; } }\r
+#define FREE_VAR(v) { if (v) { pfFreeMem((void *)(v)); v = 0; } }\r
\r
#define DATA_STACK_DEPTH (gCurrentTask->td_StackBase - gCurrentTask->td_StackPtr)\r
#define DROP_DATA_STACK (gCurrentTask->td_StackPtr++)\r
\r
#define DATA_STACK_DEPTH (gCurrentTask->td_StackBase - gCurrentTask->td_StackPtr)\r
#define DROP_DATA_STACK (gCurrentTask->td_StackPtr++)\r
sdSeekFile( FileID, 0, PF_SEEK_END );\r
endposition = sdTellFile( FileID );\r
M_PUSH(endposition);\r
sdSeekFile( FileID, 0, PF_SEEK_END );\r
endposition = sdTellFile( FileID );\r
M_PUSH(endposition);\r
- // Just use a 0 if they are the same size.\r
+ /* Just use a 0 if they are the same size. */\r
offsetHi = (sizeof(off_t) > sizeof(cell_t)) ? (endposition >> (8*sizeof(cell_t))) : 0 ;\r
M_PUSH(offsetHi);\r
sdSeekFile( FileID, original, PF_SEEK_SET );\r
offsetHi = (sizeof(off_t) > sizeof(cell_t)) ? (endposition >> (8*sizeof(cell_t))) : 0 ;\r
M_PUSH(offsetHi);\r
sdSeekFile( FileID, original, PF_SEEK_SET );\r
\r
case ID_FILE_REPOSITION: /* ( ud fid -- ior ) */ \r
{\r
\r
case ID_FILE_REPOSITION: /* ( ud fid -- ior ) */ \r
{\r
FileID = (FileStream *) TOS;\r
FileID = (FileStream *) TOS;\r
- off_t offset = M_POP;\r
- // Avoid compiler warnings on Mac.\r
+ offset = M_POP;\r
+ /* Avoid compiler warnings on Mac. */\r
offset = (sizeof(off_t) > sizeof(cell_t)) ? (offset << 8*sizeof(cell_t)) : 0 ;\r
offset += M_POP;\r
TOS = sdSeekFile( FileID, offset, PF_SEEK_SET );\r
offset = (sizeof(off_t) > sizeof(cell_t)) ? (offset << 8*sizeof(cell_t)) : 0 ;\r
offset += M_POP;\r
TOS = sdSeekFile( FileID, offset, PF_SEEK_SET );\r
\r
case ID_FILE_POSITION: /* ( fid -- ud ior ) */\r
{\r
\r
case ID_FILE_POSITION: /* ( fid -- ud ior ) */\r
{\r
off_t offsetHi;\r
FileID = (FileStream *) TOS;\r
off_t offsetHi;\r
FileID = (FileStream *) TOS;\r
- off_t position = sdTellFile( FileID );\r
+ position = sdTellFile( FileID );\r
- // Just use a 0 if they are the same size.\r
+ /* Just use a 0 if they are the same size. */\r
offsetHi = (sizeof(off_t) > sizeof(cell_t)) ? (position >> (8*sizeof(cell_t))) : 0 ;\r
M_PUSH(offsetHi);\r
TOS = (position < 0) ? -4 : 0 ; /* !!! err num */\r
offsetHi = (sizeof(off_t) > sizeof(cell_t)) ? (position >> (8*sizeof(cell_t))) : 0 ;\r
M_PUSH(offsetHi);\r
TOS = (position < 0) ? -4 : 0 ; /* !!! err num */\r
case ID_RESIZE: /* ( addr1 u -- addr2 result ) */\r
{\r
cell_t *Addr1 = (cell_t *) M_POP;\r
case ID_RESIZE: /* ( addr1 u -- addr2 result ) */\r
{\r
cell_t *Addr1 = (cell_t *) M_POP;\r
- // Point to validator below users address.\r
+ /* Point to validator below users address. */\r
cell_t *FreePtr = Addr1 - 1;\r
if( ((ucell_t)*FreePtr) != ((ucell_t)FreePtr ^ PF_MEMORY_VALIDATOR))\r
{\r
cell_t *FreePtr = Addr1 - 1;\r
if( ((ucell_t)*FreePtr) != ((ucell_t)FreePtr ^ PF_MEMORY_VALIDATOR))\r
{\r
- // 090218 - Fixed bug, was returning zero.\r
+ /* 090218 - Fixed bug, was returning zero. */\r
M_PUSH( Addr1 );\r
TOS = -3;\r
}\r
M_PUSH( Addr1 );\r
TOS = -3;\r
}\r
/* Copy memory including validation. */\r
pfCopyMemory( (char *) CellPtr, (char *) FreePtr, TOS + sizeof(cell_t) );\r
*CellPtr = (cell_t)(((ucell_t)CellPtr) ^ (ucell_t)PF_MEMORY_VALIDATOR);\r
/* Copy memory including validation. */\r
pfCopyMemory( (char *) CellPtr, (char *) FreePtr, TOS + sizeof(cell_t) );\r
*CellPtr = (cell_t)(((ucell_t)CellPtr) ^ (ucell_t)PF_MEMORY_VALIDATOR);\r
- // 090218 - Fixed bug that was incrementing the address twice. Thanks Reinhold Straub.\r
- // Increment past validator to user address.\r
+ /* 090218 - Fixed bug that was incrementing the address twice. Thanks Reinhold Straub. */\r
+ /* Increment past validator to user address. */\r
M_PUSH( (cell_t) (CellPtr + 1) );\r
M_PUSH( (cell_t) (CellPtr + 1) );\r
- TOS = 0; // Result code.\r
- // Mark old cell as dead so we can't free it twice.\r
+ TOS = 0; /* Result code. */\r
+ /* Mark old cell as dead so we can't free it twice. */\r
FreePtr[0] = 0xDeadBeef;\r
pfFreeMem((char *) FreePtr);\r
}\r
else\r
{\r
FreePtr[0] = 0xDeadBeef;\r
pfFreeMem((char *) FreePtr);\r
}\r
else\r
{\r
- // 090218 - Fixed bug, was returning zero.\r
+ /* 090218 - Fixed bug, was returning zero. */\r
M_PUSH( Addr1 );\r
TOS = -4; /* FIXME Fix error code. */\r
}\r
M_PUSH( Addr1 );\r
TOS = -4; /* FIXME Fix error code. */\r
}\r
#define sdFlushFile fflush\r
#define sdReadFile fread\r
#define sdWriteFile fwrite\r
#define sdFlushFile fflush\r
#define sdReadFile fread\r
#define sdWriteFile fwrite\r
- #define sdSeekFile fseeko\r
- #define sdTellFile ftello\r
+ #if WIN32\r
+ /* TODO To support 64-bit file offset we probably need fseeki64(). */\r
+ #define sdSeekFile fseek\r
+ #define sdTellFile ftell\r
+ #else\r
+ #define sdSeekFile fseeko\r
+ #define sdTellFile ftello\r
+ #endif\r
#define sdCloseFile fclose\r
#define sdInputChar fgetc\r
\r
#define sdCloseFile fclose\r
#define sdInputChar fgetc\r
\r
argc = ccommand(&argv);\r
#endif\r
\r
argc = ccommand(&argv);\r
#endif\r
\r
/* Parse command line. */\r
for( i=1; i<argc; i++ )\r
{\r
/* Parse command line. */\r
for( i=1; i<argc; i++ )\r
{\r
\r
case 'd':\r
if( *s != '\0' ) DicName = s;\r
\r
case 'd':\r
if( *s != '\0' ) DicName = s;\r
- // Allow space after -d (Thanks Aleksej Saushev)\r
- // Make sure there is another argument.\r
+ /* Allow space after -d (Thanks Aleksej Saushev) */\r
+ /* Make sure there is another argument. */\r
else if( (i+1) < argc )\r
{\r
DicName = argv[++i];\r
else if( (i+1) < argc )\r
{\r
DicName = argv[++i];\r
/***************************************************************/\r
void WriteCellBigEndian( uint8_t *addr, ucell_t data )\r
{\r
/***************************************************************/\r
void WriteCellBigEndian( uint8_t *addr, ucell_t data )\r
{\r
- // Write should be in order of increasing address\r
- // to optimize for burst writes to DRAM.\r
+ /* Write should be in order of increasing address \r
+ * to optimize for burst writes to DRAM. */\r
if( sizeof(ucell_t) == 8 )\r
{\r
*addr++ = (uint8_t) (data>>56);\r
if( sizeof(ucell_t) == 8 )\r
{\r
*addr++ = (uint8_t) (data>>56);\r
/***************************************************************/\r
void WriteCellLittleEndian( uint8_t *addr, ucell_t data )\r
{\r
/***************************************************************/\r
void WriteCellLittleEndian( uint8_t *addr, ucell_t data )\r
{\r
- // Write should be in order of increasing address\r
- // to optimize for burst writes to DRAM.\r
+ /* Write should be in order of increasing address \r
+ * to optimize for burst writes to DRAM. */\r
if( sizeof(ucell_t) == 8 )\r
{\r
if( sizeof(ucell_t) == 8 )\r
{\r
- *addr++ = (uint8_t) data; // LSB at near end\r
+ *addr++ = (uint8_t) data; /* LSB at near end */\r
data = data >> 8;\r
*addr++ = (uint8_t) data;\r
data = data >> 8;\r
data = data >> 8;\r
*addr++ = (uint8_t) data;\r
data = data >> 8;\r
gCurrentDictionary = dic;\r
if( sd->sd_NameSize > 0 )\r
{\r
gCurrentDictionary = dic;\r
if( sd->sd_NameSize > 0 )\r
{\r
- gVarContext = (char *) NAMEREL_TO_ABS(sd->sd_RelContext); /* Restore context. */\r
+ gVarContext = NAMEREL_TO_ABS(sd->sd_RelContext); /* Restore context. */\r
gCurrentDictionary->dic_HeaderPtr = (ucell_t)(uint8_t *)\r
NAMEREL_TO_ABS(sd->sd_RelHeaderPtr);\r
}\r
gCurrentDictionary->dic_HeaderPtr = (ucell_t)(uint8_t *)\r
NAMEREL_TO_ABS(sd->sd_RelHeaderPtr);\r
}\r
pfReportError("pfLoadDictionary", PF_ERR_NO_SHELL );\r
goto error;\r
#else\r
pfReportError("pfLoadDictionary", PF_ERR_NO_SHELL );\r
goto error;\r
#else\r
- if( NAME_BASE == NULL )\r
{\r
pfReportError("pfLoadDictionary", PF_ERR_NO_NAMES );\r
goto error;\r
{\r
pfReportError("pfLoadDictionary", PF_ERR_NO_NAMES );\r
goto error;\r
pfReportError("pfLoadDictionary", PF_ERR_TOO_BIG);\r
goto error;\r
}\r
pfReportError("pfLoadDictionary", PF_ERR_TOO_BIG);\r
goto error;\r
}\r
- numr = sdReadFile( NAME_BASE, 1, ChunkSize, fid );\r
+ numr = sdReadFile( (char *) NAME_BASE, 1, ChunkSize, fid );\r
if( numr != ChunkSize ) goto read_error;\r
BytesLeft -= ChunkSize;\r
#endif /* PF_NO_SHELL */\r
if( numr != ChunkSize ) goto read_error;\r
BytesLeft -= ChunkSize;\r
#endif /* PF_NO_SHELL */\r
pfReportError("pfLoadDictionary", PF_ERR_TOO_BIG);\r
goto error;\r
}\r
pfReportError("pfLoadDictionary", PF_ERR_TOO_BIG);\r
goto error;\r
}\r
- numr = sdReadFile( CODE_BASE, 1, ChunkSize, fid );\r
+ numr = sdReadFile( (uint8_t *) CODE_BASE, 1, ChunkSize, fid );\r
if( numr != ChunkSize ) goto read_error;\r
BytesLeft -= ChunkSize;\r
break;\r
if( numr != ChunkSize ) goto read_error;\r
BytesLeft -= ChunkSize;\r
break;\r
\r
sdCloseFile( fid );\r
\r
\r
sdCloseFile( fid );\r
\r
- if( NAME_BASE != NULL)\r
{\r
cell_t Result;\r
/* Find special words in dictionary for global XTs. */\r
{\r
cell_t Result;\r
/* Find special words in dictionary for global XTs. */\r
gCurrentDictionary = dic = pfCreateDictionary( NewNameSize, NewCodeSize );\r
if( !dic ) goto nomem_error;\r
\r
gCurrentDictionary = dic = pfCreateDictionary( NewNameSize, NewCodeSize );\r
if( !dic ) goto nomem_error;\r
\r
- pfCopyMemory( dic->dic_HeaderBase, MinDicNames, sizeof(MinDicNames) );\r
- pfCopyMemory( dic->dic_CodeBase, MinDicCode, sizeof(MinDicCode) );\r
+ pfCopyMemory( (uint8_t *) dic->dic_HeaderBase, MinDicNames, sizeof(MinDicNames) );\r
+ pfCopyMemory( (uint8_t *) dic->dic_CodeBase, MinDicCode, sizeof(MinDicCode) );\r
DBUG(("Static data copied to newly allocated dictionaries.\n"));\r
\r
dic->dic_CodePtr.Byte = (uint8_t *) CODEREL_TO_ABS(CODEPTR);\r
gNumPrimitives = NUM_PRIMITIVES;\r
\r
DBUG(("Static data copied to newly allocated dictionaries.\n"));\r
\r
dic->dic_CodePtr.Byte = (uint8_t *) CODEREL_TO_ABS(CODEPTR);\r
gNumPrimitives = NUM_PRIMITIVES;\r
\r
- if( NAME_BASE != NULL)\r
{\r
/* Setup name space. */\r
dic->dic_HeaderPtr = (ucell_t)(uint8_t *) NAMEREL_TO_ABS(HEADERPTR);\r
{\r
/* Setup name space. */\r
dic->dic_HeaderPtr = (ucell_t)(uint8_t *) NAMEREL_TO_ABS(HEADERPTR);\r
- gVarContext = (char *) NAMEREL_TO_ABS(RELCONTEXT); /* Restore context. */\r
+ gVarContext = NAMEREL_TO_ABS(RELCONTEXT); /* Restore context. */\r
\r
/* Find special words in dictionary for global XTs. */\r
if( (Result = FindSpecialXTs()) < 0 )\r
\r
/* Find special words in dictionary for global XTs. */\r
if( (Result = FindSpecialXTs()) < 0 )\r
gCurrentDictionary->dic_HeaderPtr += sizeof(cfNameLinks);\r
\r
/* Laydown name. */\r
gCurrentDictionary->dic_HeaderPtr += sizeof(cfNameLinks);\r
\r
/* Laydown name. */\r
- gVarContext = (char *) gCurrentDictionary->dic_HeaderPtr;\r
- pfCopyMemory( (char *)gCurrentDictionary->dic_HeaderPtr, FName, (*FName)+1 );\r
+ gVarContext = gCurrentDictionary->dic_HeaderPtr;\r
+ pfCopyMemory( (uint8_t *) gCurrentDictionary->dic_HeaderPtr, FName, (*FName)+1 );\r
gCurrentDictionary->dic_HeaderPtr += (*FName)+1;\r
\r
/* Set flags. */\r
gCurrentDictionary->dic_HeaderPtr += (*FName)+1;\r
\r
/* Set flags. */\r
/* DBUG(("\nNameToPrevious: RelNamePtr = 0x%x\n", (cell_t) RelNamePtr )); */\r
if( RelNamePtr )\r
{\r
/* DBUG(("\nNameToPrevious: RelNamePtr = 0x%x\n", (cell_t) RelNamePtr )); */\r
if( RelNamePtr )\r
{\r
- return ( NAMEREL_TO_ABS( RelNamePtr ) );\r
+ return ( (ForthString *) NAMEREL_TO_ABS( RelNamePtr ) );\r
cell_t Result = 0;\r
ExecToken TempXT;\r
\r
cell_t Result = 0;\r
ExecToken TempXT;\r
\r
- NameField = gVarContext;\r
+ NameField = (ForthString *) gVarContext;\r
DBUGX(("\ffCodeToName: gVarContext = 0x%x\n", gVarContext));\r
\r
do\r
DBUGX(("\ffCodeToName: gVarContext = 0x%x\n", gVarContext));\r
\r
do\r
WordLen = (uint8_t) ((ucell_t)*WordName & 0x1F);\r
WordChar = WordName+1;\r
\r
WordLen = (uint8_t) ((ucell_t)*WordName & 0x1F);\r
WordChar = WordName+1;\r
\r
- NameField = gVarContext;\r
+ NameField = (ForthString *) gVarContext;\r
DBUG(("\nffFindNFA: WordLen = %d, WordName = %*s\n", WordLen, WordLen, WordChar ));\r
DBUG(("\nffFindNFA: gVarContext = 0x%x\n", gVarContext));\r
do\r
DBUG(("\nffFindNFA: WordLen = %d, WordName = %*s\n", WordLen, WordLen, WordChar ));\r
DBUG(("\nffFindNFA: gVarContext = 0x%x\n", gVarContext));\r
do\r
if ( flag && !gVarQuiet)\r
{\r
ioType( FName+1, (cell_t) *FName );\r
if ( flag && !gVarQuiet)\r
{\r
ioType( FName+1, (cell_t) *FName );\r
- MSG( " redefined.\n" ); // FIXME - allow user to run off this warning.\r
+ MSG( " redefined.\n" ); /* FIXME - allow user to run off this warning. */\r
** If your loader supports global initialization (most do.) then just\r
** create the table like this.\r
*/\r
** If your loader supports global initialization (most do.) then just\r
** create the table like this.\r
*/\r
-void *CustomFunctionTable[] =\r
+CFunc0 CustomFunctionTable[] =\r
{\r
(CFunc0) CTest0,\r
(CFunc0) CTest1\r
{\r
(CFunc0) CTest0,\r
(CFunc0) CTest1\r
- Delete object directories in Makefile clean.
- Fixed "Issue 4: Filehandle remains locked upon INCLUDE error".
http://code.google.com/p/pforth/issues/detail?id=4&can=1
- Delete object directories in Makefile clean.
- Fixed "Issue 4: Filehandle remains locked upon INCLUDE error".
http://code.google.com/p/pforth/issues/detail?id=4&can=1
- - Fixed scambled HISTORY on 64-bit systems. Was using CELL+ but really needed 4 +.
+ - Fixed scrambled HISTORY on 64-bit systems. Was using CELL+ but really needed 4 +.
- Fixed floating point input. Now accepts "1E" as 1.0. Was Issue #2.
- Fixed floating point input. Now accepts "1E" as 1.0. Was Issue #2.
+ - Fixed lots of warning and made code compatible with C89 and ANSI with -pedantic.
+ - Use fseek and ftell on WIN32 instead of fseeko and ftello.
\r
V26 5/20/2010
- 64-bit support for M* UM/MOD etc by Aleksej Saushev. Thanks Aleksej!
\r
V26 5/20/2010
- 64-bit support for M* UM/MOD etc by Aleksej Saushev. Thanks Aleksej!