From: jtvolpe Date: Fri, 20 Apr 2001 02:06:42 +0000 (+0000) Subject: Cleaned up MSVC specific stuff X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=0678d63e45c69dfe0da26fc39942936578724432;p=fw%2Fsdcc Cleaned up MSVC specific stuff Fixed unary minus on unsigneds and implicit function definitions git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@743 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/as/mcs51/asexpr.c b/as/mcs51/asexpr.c index 46265f98..26aea4b0 100644 --- a/as/mcs51/asexpr.c +++ b/as/mcs51/asexpr.c @@ -338,7 +338,7 @@ register struct expr *esp; if (c == '-') { expr(esp, 100); abscheck(esp); - esp->e_addr = -esp->e_addr; + esp->e_addr = 0-esp->e_addr; return; } if (c == '~') { diff --git a/as/mcs51/asm.h b/as/mcs51/asm.h index 6704afae..2b2639e8 100644 --- a/as/mcs51/asm.h +++ b/as/mcs51/asm.h @@ -656,8 +656,8 @@ extern struct mne mne[]; /* Machine dependent functions */ -extern VOID machin(); extern VOID minit(); +extern VOID machine(struct mne *); /* SD added THIS define to change strcmpi --> strcmp (strcmpi is NOT ANSI) */ diff --git a/as/mcs51/asmain.c b/as/mcs51/asmain.c index 57707cd5..3bbfcc19 100644 --- a/as/mcs51/asmain.c +++ b/as/mcs51/asmain.c @@ -11,13 +11,13 @@ * 29-Oct-97 JLH pass ";!" comments to output file */ +#include #include #include #include #include "asm.h" -extern VOID machine(struct mne *); /*)Module asmain.c * * The module asmain.c includes the command argument parser, @@ -451,7 +451,7 @@ int i; * char getnb() aslex.c * VOID getst() aslex.c * sym * lookup() assym.c - * VOID machin() ___mch.c + * VOID machine() ___mch.c * mne * mlookup() assym.c * int more() aslex.c * VOID * new() assym.c diff --git a/as/mcs51/i8051.h b/as/mcs51/i8051.h index ac3e726a..890fb849 100644 --- a/as/mcs51/i8051.h +++ b/as/mcs51/i8051.h @@ -113,6 +113,5 @@ extern struct PreDef preDef[]; /* i51mch.c */ extern int comma(); -extern VOID machin(); extern VOID minit(); extern int reg(); diff --git a/as/mcs51/lkarea.c b/as/mcs51/lkarea.c index 29fa00b6..cdc3c071 100644 --- a/as/mcs51/lkarea.c +++ b/as/mcs51/lkarea.c @@ -15,9 +15,6 @@ #include #include -//#if !defined(_MSC_VER) -//#include -//#endif #include "aslink.h" /*)Module lkarea.c diff --git a/as/mcs51/lkdata.c b/as/mcs51/lkdata.c index 607b946d..dae15e71 100644 --- a/as/mcs51/lkdata.c +++ b/as/mcs51/lkdata.c @@ -16,9 +16,6 @@ #include #include -//#if !defined(_MSC_VER) -//#include -//#endif #include "aslink.h" /*)Module lkdata.c diff --git a/as/mcs51/lkeval.c b/as/mcs51/lkeval.c index 0a980df3..90df0031 100644 --- a/as/mcs51/lkeval.c +++ b/as/mcs51/lkeval.c @@ -11,9 +11,6 @@ #include #include -//#if !defined(_MSC_VER) -//#include -//#endif #include "aslink.h" /*)Module lkeval.c @@ -229,7 +226,7 @@ term() return(v); } if (c == '-') { - return(-expr(100)); + return(0-expr(100)); } if (c == '~') { return(~expr(100)); diff --git a/as/mcs51/lkhead.c b/as/mcs51/lkhead.c index 898d7fe8..1cd390ab 100644 --- a/as/mcs51/lkhead.c +++ b/as/mcs51/lkhead.c @@ -11,9 +11,6 @@ #include #include -//#if !defined(_MSC_VER) -//#include -//#endif #include "aslink.h" /*Module lkhead.c diff --git a/as/mcs51/lkihx.c b/as/mcs51/lkihx.c index 6058fa49..461d5679 100644 --- a/as/mcs51/lkihx.c +++ b/as/mcs51/lkihx.c @@ -11,9 +11,6 @@ #include #include -//#if !defined(_MSC_VER) -//#include -//#endif #include "aslink.h" /*)Module lkihx.c @@ -148,7 +145,7 @@ ihx(i) fprintf(ofp, "00"); } } - fprintf(ofp, "%02X\n", (-chksum) & 0xff); + fprintf(ofp, "%02X\n", (0-chksum) & 0xff); } else { fprintf(ofp, ":00000001FF\n"); } @@ -184,5 +181,5 @@ ihxEntendedLinearAddress(Addr_T a) */ chksum = 2 + 4 + (a & 0xff) + ((a >> 8) & 0xff); - fprintf(ofp, ":02000004%04X%02X\n", a & 0xffff, (-chksum) & 0xff); + fprintf(ofp, ":02000004%04X%02X\n", a & 0xffff, (0-chksum) & 0xff); } diff --git a/as/mcs51/lklex.c b/as/mcs51/lklex.c index 7466cabe..d7e4271b 100644 --- a/as/mcs51/lklex.c +++ b/as/mcs51/lklex.c @@ -11,9 +11,6 @@ #include #include -//#if !defined(_MSC_VER) -//#include -//#endif #include "aslink.h" /*)Module lklex.c diff --git a/as/mcs51/lklibr.c b/as/mcs51/lklibr.c index 84032719..8c8ccd2d 100644 --- a/as/mcs51/lklibr.c +++ b/as/mcs51/lklibr.c @@ -15,13 +15,9 @@ * */ +#include #include #include -//#if defined(_MSC_VER) -//#include -//#else -//#include -//#endif #include "aslink.h" /*)Module lklibr.c diff --git a/as/mcs51/lklist.c b/as/mcs51/lklist.c index 11d7adc3..3743240d 100644 --- a/as/mcs51/lklist.c +++ b/as/mcs51/lklist.c @@ -17,9 +17,6 @@ #include #include -//#if !defined(_MSC_VER) -//#include -//#endif #include #include "aslink.h" diff --git a/as/mcs51/lkmain.c b/as/mcs51/lkmain.c index 44a8f13f..66464a45 100644 --- a/as/mcs51/lkmain.c +++ b/as/mcs51/lkmain.c @@ -14,13 +14,9 @@ * - use a_type == 0 as "virgin area" flag: set == 1 if -b */ +#include #include #include -//#if defined(_MSC_VER) -//#include -//#else -//#include -//#endif #include "aslink.h" /* yuck - but including unistd.h causes problems on Cygwin by redefining diff --git a/as/mcs51/lknoice.c b/as/mcs51/lknoice.c index dd4c86f3..744bda0f 100644 --- a/as/mcs51/lknoice.c +++ b/as/mcs51/lknoice.c @@ -11,9 +11,6 @@ #include #include #include -//#if !defined(_MSC_VER) -//#include -//#endif #include "aslink.h" static void DefineGlobal( char *name, Addr_T value, int page ); diff --git a/as/mcs51/lkrloc.c b/as/mcs51/lkrloc.c index 7a9dbcfb..fecf9f8f 100644 --- a/as/mcs51/lkrloc.c +++ b/as/mcs51/lkrloc.c @@ -16,9 +16,6 @@ #include #include -//#if !defined(_MSC_VER) -//#include -//#endif #include "aslink.h" /*)Module lkrloc.c