X-Git-Url: http://git.subgeniuskitty.com/pforth/.git/blobdiff_plain/271cd1f5a106bb0978b451457161b1df391c4c9e..c1a87b8298475c3fdd007b14a1413d2a6fd0fa61:/csrc/pf_save.c diff --git a/csrc/pf_save.c b/csrc/pf_save.c index 03f4ce8..830eaee 100644 --- a/csrc/pf_save.c +++ b/csrc/pf_save.c @@ -315,7 +315,7 @@ cell_t ffSaveForth( const char *FileName, ExecToken EntryPoint, cell_t NameSize, /***************************************************************/ static int Write32ToFile( FileStream *fid, uint32_t Val ) { - int numw; + size_t numw; uint8_t pad[4]; Write32BigEndian(pad,Val); @@ -332,8 +332,10 @@ static cell_t WriteChunkToFile( FileStream *fid, cell_t ID, char *Data, int32_t EvenNumW = EVENUP(NumBytes); - if( Write32ToFile( fid, ID ) < 0 ) goto error; - if( Write32ToFile( fid, EvenNumW ) < 0 ) goto error; + assert(ID <= UINT32_MAX); + if( Write32ToFile( fid, (uint32_t)ID ) < 0 ) goto error; + assert(EvenNumW <= UINT32_MAX); + if( Write32ToFile( fid, (uint32_t)EvenNumW ) < 0 ) goto error; numw = sdWriteFile( Data, 1, EvenNumW, fid ); if( numw != EvenNumW ) goto error; @@ -515,7 +517,7 @@ error: /***************************************************************/ static int32_t Read32FromFile( FileStream *fid, uint32_t *ValPtr ) { - int32_t numr; + cell_t numr; uint8_t pad[4]; numr = sdReadFile( pad, 1, sizeof(pad), fid ); if( numr != sizeof(pad) ) return -1; @@ -533,7 +535,7 @@ PForthDictionary pfLoadDictionary( const char *FileName, ExecToken *EntryPointPt uint32_t ChunkSize; uint32_t FormSize; uint32_t BytesLeft; - uint32_t numr; + cell_t numr; int isDicBigEndian; DBUG(("pfLoadDictionary( %s )\n", FileName )); @@ -726,7 +728,7 @@ DBUG(("pfLoadDictionary( %s )\n", FileName )); /* Find special words in dictionary for global XTs. */ if( (Result = FindSpecialXTs()) < 0 ) { - pfReportError("pfLoadDictionary: FindSpecialXTs", Result); + pfReportError("pfLoadDictionary: FindSpecialXTs", (Err)Result); goto error; } }