Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Debug|Win32.ActiveCfg = Debug|Win32
{58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Debug|Win32.Build.0 = Debug|Win32
+ {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Debug|x64.ActiveCfg = Debug|x64
+ {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Debug|x64.Build.0 = Debug|x64
{58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Release|Win32.ActiveCfg = Release|Win32
{58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Release|Win32.Build.0 = Release|Win32
+ {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Release|x64.ActiveCfg = Release|x64
+ {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{58B76DB8-1985-4B8A-8E71-C012D8F0C518}</ProjectGuid>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>15.0.27130.2010</_ProjectFileVersion>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)..\..\..\fth\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PF_SUPPORT_FP;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ </Link>
+ </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;PF_SUPPORT_FP;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;PF_SUPPORT_FP;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ </Link>
+ </ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\csrc\pfcompil.c" />
<ClCompile Include="..\..\..\csrc\pfcustom.c" />
** Dictionary Management
***************************************************************/
-cell_t pfExecIfDefined( const char *CString )
+ThrowCode pfExecIfDefined( const char *CString )
{
- int result = 0;
+ ThrowCode result = 0;
if( NAME_BASE != (cell_t)NULL)
{
ExecToken XT;
/**************************************************************************
** Main entry point for pForth.
*/
-cell_t pfDoForth( const char *DicFileName, const char *SourceName, cell_t IfInit )
+ThrowCode pfDoForth( const char *DicFileName, const char *SourceName, cell_t IfInit )
{
pfTaskData_t *cftd;
pfDictionary_t *dic = NULL;
- cell_t Result = 0;
+ ThrowCode Result = 0;
ExecToken EntryPoint = 0;
#ifdef PF_USER_INIT
extern "C" {
#endif
-int pfCatch( ExecToken XT );
+ThrowCode pfCatch( ExecToken XT );
#ifdef __cplusplus
}
static uint64_t UdToUint64( ucell_t Lo, ucell_t Hi )
{
return (( 2 * sizeof(ucell_t) == sizeof(uint64_t) )
- ? (((uint64_t)Lo) | (((uint64_t)Hi) >> (sizeof(ucell_t) * 8)))
- : Lo );
+ ? (((uint64_t)Lo) | (((uint64_t)Hi) >> (sizeof(ucell_t) * 8)))
+ : Lo);
}
/* Return TRUE if the unsigned double cell integer LO/HI is not greater
static int UdIsUint64( ucell_t Lo, ucell_t Hi )
{
return (( 2 * sizeof(ucell_t) == sizeof(uint64_t) )
- ? TRUE
- : Hi == 0 );
+ ? TRUE
+ : Hi == 0);
}
-static const char *pfSelectFileModeCreate( int fam );
-static const char *pfSelectFileModeOpen( int fam );
+static const char *pfSelectFileModeCreate(cell_t fam );
+static const char *pfSelectFileModeOpen(cell_t fam );
/**************************************************************/
-static const char *pfSelectFileModeCreate( int fam )
+static const char *pfSelectFileModeCreate( cell_t fam )
{
const char *famText = NULL;
switch( fam )
}
/**************************************************************/
-static const char *pfSelectFileModeOpen( int fam )
+static const char *pfSelectFileModeOpen( cell_t fam )
{
const char *famText = NULL;
switch( fam )
}
/**************************************************************/
-int pfCatch( ExecToken XT )
+ThrowCode pfCatch( ExecToken XT )
{
register cell_t TopOfStack; /* Cache for faster execution. */
register cell_t *DataStackPtr;
TOS = -3; /* TODO err num? */
break;
}
- offset = offsetLow;
+ offset = (file_offset_t)offsetLow;
TOS = sdSeekFile( FileID, offset, PF_SEEK_SET );
}
endcase;
char IfInit = FALSE;
char *s;
cell_t i;
- int Result;
+ ThrowCode Result;
/* For Metroworks on Mac */
#ifdef __MWERKS__
Result = pfDoForth( DicName, SourceName, IfInit);
on_error:
- return Result;
+ return (int)Result;
}
#endif /* PF_EMBEDDED */
/***************************************************************/
static int Write32ToFile( FileStream *fid, uint32_t Val )
{
- int numw;
+ cell_t numw;
uint8_t pad[4];
Write32BigEndian(pad,Val);
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;
/***************************************************************/
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;
uint32_t ChunkSize;
uint32_t FormSize;
uint32_t BytesLeft;
- uint32_t numr;
+ cell_t numr;
int isDicBigEndian;
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;
}
}
** Compare two strings, case sensitive.
** Return zero if they match, -1 if s1<s2, +1 is s1>s2;
*/
-cell_t ffCompare( const char *s1, cell_t len1, const char *s2, int32_t len2 )
+cell_t ffCompare( const char *s1, cell_t len1, const char *s2, cell_t len2 )
{
cell_t i, result, n, diff;
char *ForthStringToC( char *dst, const char *FString, cell_t dstSize );
char *CStringToForth( char *dst, const char *CString, cell_t dstSize );
-cell_t ffCompare( const char *s1, cell_t len1, const char *s2, int32_t len2 );
+cell_t ffCompare( const char *s1, cell_t len1, const char *s2, cell_t len2 );
cell_t ffCompareText( const char *s1, const char *s2, cell_t len );
cell_t ffCompareTextCaseN( const char *s1, const char *s2, cell_t len );
***************************************************************/
Err ffPushInputStream( FileStream *InputFile )
{
- cell_t Result = 0;
+ Err Result = 0;
IncludeFrame *inf;
/* Push current input state onto special include stack. */
#ifdef PF_SUPPORT_FP
-#define FP_DHI1 (((PF_FLOAT)(1L<<(sizeof(cell_t)*8-2)))*4.0)
+#define FP_DHI1 (((PF_FLOAT)((cell_t)1<<(sizeof(cell_t)*8-2)))*4.0)
case ID_FP_D_TO_F: /* ( dlo dhi -- ) ( F: -- r ) */
PUSH_FP_TOS;
#endif
/* Main entry point to pForth. */
-cell_t pfDoForth( const char *DicName, const char *SourceName, cell_t IfInit );
+ThrowCode pfDoForth( const char *DicName, const char *SourceName, cell_t IfInit );
/* Turn off messages. */
void pfSetQuiet( cell_t IfQuiet );
ThrowCode pfQuit( void );
/* Execute a single execution token in the current task and return 0 or an error code. */
-int pfCatch( ExecToken XT );
+ThrowCode pfCatch( ExecToken XT );
/* Include the given pForth source code file. */
ThrowCode pfIncludeFile( const char *FileName );