X-Git-Url: http://git.subgeniuskitty.com/pforth/.git/blobdiff_plain/81dfa5e08883473e73d981e38722533b386c7810..a80283a747da0ca5a791dcfc5fe1a6261feecc5c:/csrc/pfcompil.c diff --git a/csrc/pfcompil.c b/csrc/pfcompil.c index dcb386f..feb85db 100644 --- a/csrc/pfcompil.c +++ b/csrc/pfcompil.c @@ -77,8 +77,8 @@ void CreateDicEntry( ExecToken XT, const ForthStringPtr FName, ucell_t Flags ) gCurrentDictionary->dic_HeaderPtr += sizeof(cfNameLinks); /* Laydown name. */ - gVarContext = (char *) gCurrentDictionary->dic_HeaderPtr; - pfCopyMemory( (char *)gCurrentDictionary->dic_HeaderPtr, FName, (*FName)+1 ); + gVarContext = gCurrentDictionary->dic_HeaderPtr; + pfCopyMemory( (uint8_t *) gCurrentDictionary->dic_HeaderPtr, FName, (*FName)+1 ); gCurrentDictionary->dic_HeaderPtr += (*FName)+1; /* Set flags. */ @@ -117,7 +117,7 @@ const ForthString *NameToPrevious( const ForthString *NFA ) /* DBUG(("\nNameToPrevious: RelNamePtr = 0x%x\n", (cell_t) RelNamePtr )); */ if( RelNamePtr ) { - return ( NAMEREL_TO_ABS( RelNamePtr ) ); + return ( (ForthString *) NAMEREL_TO_ABS( RelNamePtr ) ); } else { @@ -408,7 +408,7 @@ cell_t ffTokenToName( ExecToken XT, const ForthString **NFAPtr ) cell_t Result = 0; ExecToken TempXT; - NameField = gVarContext; + NameField = (ForthString *) gVarContext; DBUGX(("\ffCodeToName: gVarContext = 0x%x\n", gVarContext)); do @@ -452,7 +452,7 @@ cell_t ffFindNFA( const ForthString *WordName, const ForthString **NFAPtr ) WordLen = (uint8_t) ((ucell_t)*WordName & 0x1F); WordChar = WordName+1; - NameField = gVarContext; + NameField = (ForthString *) gVarContext; DBUG(("\nffFindNFA: WordLen = %d, WordName = %*s\n", WordLen, WordLen, WordChar )); DBUG(("\nffFindNFA: gVarContext = 0x%x\n", gVarContext)); do @@ -600,7 +600,7 @@ static cell_t CheckRedefinition( const ForthStringPtr FName ) if ( flag && !gVarQuiet) { ioType( FName+1, (cell_t) *FName ); - MSG( " redefined.\n" ); // FIXME - allow user to run off this warning. + MSG( " redefined.\n" ); /* FIXME - allow user to run off this warning. */ } return flag; } @@ -927,7 +927,7 @@ ThrowCode ffOuterInterpreterLoop( void ) } /*************************************************************** -** Include a file +** Include then close a file ***************************************************************/ ThrowCode ffIncludeFile( FileStream *InputFile ) @@ -963,6 +963,9 @@ ThrowCode ffIncludeFile( FileStream *InputFile ) /* Pop file stream. */ ffPopInputStream(); +/* ANSI spec specifies that this should also close the file. */ + sdCloseFile(InputFile); + return exception; }