From c74d8ef6f193cb2be876c920c5cb7f599dd5418a Mon Sep 17 00:00:00 2001 From: ggn Date: Sun, 30 Aug 2015 21:12:34 +0300 Subject: [PATCH] Visual Studio 2015 project files. A few warnings about unused variables fixed. Signed-off-by: Shamus Hammons --- Vs2015/68ktab/68ktab.vcxproj | 155 ++++++++++++++++++++++++ Vs2015/68ktab/68ktab.vcxproj.user | 4 + Vs2015/VS2015.sln | 48 ++++++++ Vs2015/kwgen/kwgen.vcxproj | 154 ++++++++++++++++++++++++ Vs2015/kwgen/kwgen.vcxproj.user | 7 ++ Vs2015/rmac/rmac.vcxproj | 190 ++++++++++++++++++++++++++++++ Vs2015/rmac/rmac.vcxproj.user | 4 + macro.c | 19 ++- object.c | 2 +- rmac.h | 12 +- sect.c | 52 ++++---- symbol.h | 1 + token.c | 8 +- 13 files changed, 623 insertions(+), 33 deletions(-) create mode 100644 Vs2015/68ktab/68ktab.vcxproj create mode 100644 Vs2015/68ktab/68ktab.vcxproj.user create mode 100644 Vs2015/VS2015.sln create mode 100644 Vs2015/kwgen/kwgen.vcxproj create mode 100644 Vs2015/kwgen/kwgen.vcxproj.user create mode 100644 Vs2015/rmac/rmac.vcxproj create mode 100644 Vs2015/rmac/rmac.vcxproj.user diff --git a/Vs2015/68ktab/68ktab.vcxproj b/Vs2015/68ktab/68ktab.vcxproj new file mode 100644 index 0000000..9c25e05 --- /dev/null +++ b/Vs2015/68ktab/68ktab.vcxproj @@ -0,0 +1,155 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + {0D200546-CF83-49B6-9893-42DD6AEC94F0} + Win32Proj + My68ktab + 8.1 + 68kgen + + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\.. + + + true + $(SolutionDir)\.. + + + false + $(SolutionDir)\.. + + + false + $(SolutionDir)\.. + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + + + + + + + Level3 + Disabled + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + true + true + + + + + + \ No newline at end of file diff --git a/Vs2015/68ktab/68ktab.vcxproj.user b/Vs2015/68ktab/68ktab.vcxproj.user new file mode 100644 index 0000000..abe8dd8 --- /dev/null +++ b/Vs2015/68ktab/68ktab.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Vs2015/VS2015.sln b/Vs2015/VS2015.sln new file mode 100644 index 0000000..e2625f5 --- /dev/null +++ b/Vs2015/VS2015.sln @@ -0,0 +1,48 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rmac", "rmac\rmac.vcxproj", "{D8A382B9-8BD4-4953-B780-95010C41AFC8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kwgen", "kwgen\kwgen.vcxproj", "{AAEB066A-F264-4AEC-A606-EDE5DE47FDDF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "68ktab", "68ktab\68ktab.vcxproj", "{0D200546-CF83-49B6-9893-42DD6AEC94F0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D8A382B9-8BD4-4953-B780-95010C41AFC8}.Debug|x64.ActiveCfg = Debug|x64 + {D8A382B9-8BD4-4953-B780-95010C41AFC8}.Debug|x64.Build.0 = Debug|x64 + {D8A382B9-8BD4-4953-B780-95010C41AFC8}.Debug|x86.ActiveCfg = Debug|Win32 + {D8A382B9-8BD4-4953-B780-95010C41AFC8}.Debug|x86.Build.0 = Debug|Win32 + {D8A382B9-8BD4-4953-B780-95010C41AFC8}.Release|x64.ActiveCfg = Release|x64 + {D8A382B9-8BD4-4953-B780-95010C41AFC8}.Release|x64.Build.0 = Release|x64 + {D8A382B9-8BD4-4953-B780-95010C41AFC8}.Release|x86.ActiveCfg = Release|Win32 + {D8A382B9-8BD4-4953-B780-95010C41AFC8}.Release|x86.Build.0 = Release|Win32 + {AAEB066A-F264-4AEC-A606-EDE5DE47FDDF}.Debug|x64.ActiveCfg = Debug|x64 + {AAEB066A-F264-4AEC-A606-EDE5DE47FDDF}.Debug|x64.Build.0 = Debug|x64 + {AAEB066A-F264-4AEC-A606-EDE5DE47FDDF}.Debug|x86.ActiveCfg = Debug|Win32 + {AAEB066A-F264-4AEC-A606-EDE5DE47FDDF}.Debug|x86.Build.0 = Debug|Win32 + {AAEB066A-F264-4AEC-A606-EDE5DE47FDDF}.Release|x64.ActiveCfg = Release|x64 + {AAEB066A-F264-4AEC-A606-EDE5DE47FDDF}.Release|x64.Build.0 = Release|x64 + {AAEB066A-F264-4AEC-A606-EDE5DE47FDDF}.Release|x86.ActiveCfg = Release|Win32 + {AAEB066A-F264-4AEC-A606-EDE5DE47FDDF}.Release|x86.Build.0 = Release|Win32 + {0D200546-CF83-49B6-9893-42DD6AEC94F0}.Debug|x64.ActiveCfg = Debug|x64 + {0D200546-CF83-49B6-9893-42DD6AEC94F0}.Debug|x64.Build.0 = Debug|x64 + {0D200546-CF83-49B6-9893-42DD6AEC94F0}.Debug|x86.ActiveCfg = Debug|Win32 + {0D200546-CF83-49B6-9893-42DD6AEC94F0}.Debug|x86.Build.0 = Debug|Win32 + {0D200546-CF83-49B6-9893-42DD6AEC94F0}.Release|x64.ActiveCfg = Release|x64 + {0D200546-CF83-49B6-9893-42DD6AEC94F0}.Release|x64.Build.0 = Release|x64 + {0D200546-CF83-49B6-9893-42DD6AEC94F0}.Release|x86.ActiveCfg = Release|Win32 + {0D200546-CF83-49B6-9893-42DD6AEC94F0}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Vs2015/kwgen/kwgen.vcxproj b/Vs2015/kwgen/kwgen.vcxproj new file mode 100644 index 0000000..7c07b0f --- /dev/null +++ b/Vs2015/kwgen/kwgen.vcxproj @@ -0,0 +1,154 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + {AAEB066A-F264-4AEC-A606-EDE5DE47FDDF} + Win32Proj + kwgen + 8.1 + + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\.. + + + true + $(SolutionDir)\.. + + + false + $(SolutionDir)\.. + + + false + $(SolutionDir)\.. + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + + + + + + + Level3 + Disabled + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + true + true + + + + + + \ No newline at end of file diff --git a/Vs2015/kwgen/kwgen.vcxproj.user b/Vs2015/kwgen/kwgen.vcxproj.user new file mode 100644 index 0000000..46c3ca8 --- /dev/null +++ b/Vs2015/kwgen/kwgen.vcxproj.user @@ -0,0 +1,7 @@ + + + + "kw <kwtab >kwtab.h" + WindowsLocalDebugger + + \ No newline at end of file diff --git a/Vs2015/rmac/rmac.vcxproj b/Vs2015/rmac/rmac.vcxproj new file mode 100644 index 0000000..a127bd8 --- /dev/null +++ b/Vs2015/rmac/rmac.vcxproj @@ -0,0 +1,190 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {D8A382B9-8BD4-4953-B780-95010C41AFC8} + Win32Proj + rmac + 8.1 + + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\.. + + + true + $(SolutionDir)\.. + + + false + $(SolutionDir)\.. + + + false + $(SolutionDir)\.. + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + + + + + + + Level3 + Disabled + WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + true + true + + + + + + \ No newline at end of file diff --git a/Vs2015/rmac/rmac.vcxproj.user b/Vs2015/rmac/rmac.vcxproj.user new file mode 100644 index 0000000..abe8dd8 --- /dev/null +++ b/Vs2015/rmac/rmac.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/macro.c b/macro.c index 5aaa842..4232f1a 100644 --- a/macro.c +++ b/macro.c @@ -53,7 +53,12 @@ void InitMacro(void) // int ExitMacro(void) { -#warning !!! Bad macro exiting !!! +#ifndef _MSC_VER +#pragma message !!! Bad macro exiting !!! +#else +#pragma WARNING(!!! Bad macro exiting !!!) +#endif + /* This is a problem. Currently, the argument logic just keeps the current arguments and doesn't save anything if a new macro is called in the middle @@ -110,8 +115,8 @@ int defmac2(char * argname) // int defmac1(char * ln, int notEndFlag) { - PTR p; - LONG len; +// PTR p; +// LONG len; if (list_flag) { @@ -248,7 +253,11 @@ int defr1(char * ln, int kwno) rptlevel++; default: //MORE stupidity here... -#warning "!!! Casting (char *) as LONG !!!" +#ifndef _MSC_VER +#pragma warning "!!! Casting (char *) as LONG !!!" +#else +#pragma WARNING(!!! Casting (char *) as LONG !!!) +#endif addln: // Allocate length of line + 1('\0') + LONG len = strlen(ln) + 1 + sizeof(LONG); @@ -448,7 +457,7 @@ int InvokeMacro(SYM * mac, WORD siz) TOKEN * dest; int stringNum = 0; int argumentNum = 0; - int i; +// int i; for(dry_run=1; ; dry_run--) { diff --git a/object.c b/object.c index 2702c54..3412740 100644 --- a/object.c +++ b/object.c @@ -187,7 +187,7 @@ char * constr_symtab(register char * buf, SYM * sym, int globflag) // int WriteObject(int fd) { - LONG t; // Scratch long +// LONG t; // Scratch long LONG tds; // TEXT & DATA segment size int i; // Temporary int CHUNK * cp; // Chunk (for gather) diff --git a/rmac.h b/rmac.h index faa176c..5ef9953 100644 --- a/rmac.h +++ b/rmac.h @@ -12,7 +12,7 @@ // // TARGET SPECIFIC BUILD SETTINGS // -#ifdef WIN32 +#if defined(WIN32) || defined (WIN64) // Release platform - windows #define PLATFORM "Win32" #define _OPEN_FLAGS _O_TRUNC|_O_CREAT|_O_BINARY|_O_RDWR @@ -22,6 +22,15 @@ #if _MSC_VER > 1000 #pragma warning(disable:4996) #endif + + //Makes warnings double clickable on visual studio + #define STRINGIZE_HELPER(x) #x + #define STRINGIZE(x) STRINGIZE_HELPER(x) + #define WARNING(desc) message(__FILE__ "(" STRINGIZE(__LINE__) ") : Warning: " #desc) + + // usage: + //#pragma WARNING(FIXME: Code removed because...) + #endif #include #include @@ -31,6 +40,7 @@ #include #include #include + #else #ifdef __GCCUNIX__ // Release platform - mac OS-X or linux diff --git a/sect.c b/sect.c index 7331cb3..64ccb44 100644 --- a/sect.c +++ b/sect.c @@ -274,7 +274,11 @@ int AddFixup(WORD attr, LONG loc, TOKEN * fexpr) SECT * p; // Shamus: Expression lengths are voodoo ATM (variable "i"). Need to fix // this. -#warning "!!! AddFixup() is filled with VOODOO !!!" +#ifndef _MSC_VER +#pragma warning "!!! AddFixup() is filled with VOODOO !!!" +#else +#pragma WARNING(!!! AddFixup() is filled with VOODOO !!!) +#endif DEBUG printf("FIXUP@$%X: $%X\n", loc, attr); // Compute length of expression (could be faster); determine if it's the @@ -380,27 +384,6 @@ int AddFixup(WORD attr, LONG loc, TOKEN * fexpr) } -// -// Resolve all fixups -// -int ResolveAllFixups(void) -{ - unsigned i; - char buf[EBUFSIZ]; - - // Make undefined symbols GLOBL - if (glob_flag) - ForceUndefinedSymbolsGlobal(); - - DEBUG printf("Resolving TEXT sections...\n"); - ResolveFixups(TEXT); - DEBUG printf("Resolving DATA sections...\n"); - ResolveFixups(DATA); - - return 0; -} - - // // Resolve fixups in a section // @@ -422,8 +405,8 @@ int ResolveFixups(int sno) WORD flags; unsigned page_jump = 0; unsigned address = 0; - unsigned j; - char buf[EBUFSIZ]; + //unsigned j; + //char buf[EBUFSIZ]; SECT * sc = §[sno]; CHUNK * ch = sc->sffix; @@ -915,3 +898,24 @@ range: return 0; } +// +// Resolve all fixups +// +int ResolveAllFixups(void) +{ + //unsigned i; + //char buf[EBUFSIZ]; + + // Make undefined symbols GLOBL + if (glob_flag) + ForceUndefinedSymbolsGlobal(); + + DEBUG printf("Resolving TEXT sections...\n"); + ResolveFixups(TEXT); + DEBUG printf("Resolving DATA sections...\n"); + ResolveFixups(DATA); + + return 0; +} + + diff --git a/symbol.h b/symbol.h index 485ed88..bd32a5e 100644 --- a/symbol.h +++ b/symbol.h @@ -39,6 +39,7 @@ SYM // Globals, externals, etc. extern int curenv; extern char subttl[]; +extern int eject(void); // Exported functions SYM * lookup(char *, int, int); diff --git a/token.c b/token.c index ca38406..1cd9eba 100644 --- a/token.c +++ b/token.c @@ -617,7 +617,7 @@ overflow: // char * GetNextMacroLine(void) { - unsigned source_addr; +// unsigned source_addr; IMACRO * imacro = cur_inobj->inobj.imacro; // LONG * strp = imacro->im_nextln; @@ -1547,7 +1547,11 @@ int d_goto(WORD unused) // Compare names (sleazo string compare) // This string compare is not right. Doesn't check for lengths. // (actually it does, but in a crappy, unclear way.) -#warning "!!! Bad string comparison !!!" +#ifndef _MSC_VER + #warning "!!! Bad string comparison !!!" +#else + #pragma WARNING(!!!! Bad string comparison !!!) +#endif s1 = sym; // s2 = (char *)(defln + 1) + 1; s2 = defln->line; -- 2.37.2