Cleaned up MSVC specific stuff
authorjtvolpe <jtvolpe@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 20 Apr 2001 02:06:42 +0000 (02:06 +0000)
committerjtvolpe <jtvolpe@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 20 Apr 2001 02:06:42 +0000 (02:06 +0000)
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

15 files changed:
as/mcs51/asexpr.c
as/mcs51/asm.h
as/mcs51/asmain.c
as/mcs51/i8051.h
as/mcs51/lkarea.c
as/mcs51/lkdata.c
as/mcs51/lkeval.c
as/mcs51/lkhead.c
as/mcs51/lkihx.c
as/mcs51/lklex.c
as/mcs51/lklibr.c
as/mcs51/lklist.c
as/mcs51/lkmain.c
as/mcs51/lknoice.c
as/mcs51/lkrloc.c

index 46265f98f0f7812d115a8711c1a5e6ed6b9a931f..26aea4b0a015f474d23a3f33ae7e8533c999e942 100644 (file)
@@ -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 == '~') {
index 6704afae7421909ccae83b33e63eed700f313390..2b2639e8d4848fd12a5d78a1e16d01c0ecf51e1e 100644 (file)
@@ -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) */
index 57707cd53b7276038f9cc96df9c2ce30e56fb863..3bbfcc194283b741425d7cdbf1d73221b221619a 100644 (file)
  * 29-Oct-97 JLH pass ";!" comments to output file
  */
 
+#include <stdlib.h>
 #include <stdio.h>
 #include <setjmp.h>
 #include <string.h>
 
 #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
index ac3e726aec75e7e6745e97c17d128a9e13982fb3..890fb8492dd406ede14f7aba092e44f38359bf7a 100644 (file)
@@ -113,6 +113,5 @@ extern struct PreDef preDef[];
 
        /* i51mch.c */
 extern int             comma();
-extern VOID            machin();
 extern VOID            minit();
 extern int             reg();
index 29fa00b6a7daef3d603f43d002d5d6fb7c5b12ef..cdc3c071f43079a3787e48dcba8335ab66aa1c2f 100644 (file)
@@ -15,9 +15,6 @@
 
 #include <stdio.h>
 #include <string.h>
-//#if !defined(_MSC_VER)
-//#include <alloc.h>
-//#endif
 #include "aslink.h"
 
 /*)Module      lkarea.c
index 607b946df762499980a644bcd731478155e83ea2..dae15e71e610fcc008737e46c6c111cbdb275fbb 100644 (file)
@@ -16,9 +16,6 @@
 
 #include <stdio.h>
 #include <string.h>
-//#if !defined(_MSC_VER)
-//#include <alloc.h>
-//#endif
 #include "aslink.h"
 
 /*)Module      lkdata.c
index 0a980df37291ad8250d6a028e02add252ca3a966..90df00311fd86d95a2fd4fc5f32f893e0ec6db8b 100644 (file)
@@ -11,9 +11,6 @@
 
 #include <stdio.h>
 #include <string.h>
-//#if !defined(_MSC_VER)
-//#include <alloc.h>
-//#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));
index 898d7fe82d685bb3c2b36fb50e2acf9f59817273..1cd390ab0af05f37aed3289a4147b64fe0302b01 100644 (file)
@@ -11,9 +11,6 @@
 
 #include <stdio.h>
 #include <string.h>
-//#if !defined(_MSC_VER)
-//#include <alloc.h>
-//#endif
 #include "aslink.h"
 
 /*Module       lkhead.c
index 6058fa49219898fe838671de64035d75a491ed0a..461d56799f74290d5ac477691043d1b44e8968ad 100644 (file)
@@ -11,9 +11,6 @@
 
 #include <stdio.h>
 #include <string.h>
-//#if !defined(_MSC_VER)
-//#include <alloc.h>
-//#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);
 }
index 7466cabe74ce35f9d70354f49dc529197d4570e7..d7e4271bc94faed6e010008f6aec6a64926e3464 100644 (file)
@@ -11,9 +11,6 @@
 
 #include <stdio.h>
 #include <string.h>
-//#if !defined(_MSC_VER)
-//#include <alloc.h>
-//#endif
 #include "aslink.h"
 
 /*)Module      lklex.c
index 84032719038eda114d6117ca2ee63d8a1e9c0fd6..8c8ccd2debbb60d4d4877dc65bc1e3910415359a 100644 (file)
  *
  */
 
+#include <malloc.h>
 #include <stdio.h>
 #include <string.h>
-//#if defined(_MSC_VER)
-//#include <malloc.h>
-//#else
-//#include <alloc.h>
-//#endif
 #include "aslink.h"
 
 /*)Module      lklibr.c
index 11d7adc3d484fa796802d573486036ec5fa9e1ae..3743240db34a19bbaa43cca3fa7a3ae0dcb4a148 100644 (file)
@@ -17,9 +17,6 @@
 
 #include <stdio.h>
 #include <string.h>
-//#if !defined(_MSC_VER)
-//#include <alloc.h>
-//#endif
 #include <stdlib.h>
 #include "aslink.h"
 
index 44a8f13f0b83758f506d369bc84d791b97ec8c55..66464a45b2c880f69cfaf1129bb5f24099732293 100644 (file)
  *           - use a_type == 0 as "virgin area" flag: set == 1 if -b
  */
 
+#include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-//#if defined(_MSC_VER)
-//#include <stdlib.h>
-//#else
-//#include <alloc.h>
-//#endif
 #include "aslink.h"
 
 /* yuck - but including unistd.h causes problems on Cygwin by redefining
index dd4c86f3cf2cf6895eb08ad9632ce3dcf610c47f..744bda0f78450d764f919cade9c61d67394fd666 100644 (file)
@@ -11,9 +11,6 @@
 #include <stdio.h>
 #include <setjmp.h>
 #include <string.h>
-//#if !defined(_MSC_VER)
-//#include <alloc.h>
-//#endif
 #include "aslink.h"
 
 static void DefineGlobal( char *name, Addr_T value, int page );
index 7a9dbcfb9dc05c6c2f3a4edaa8e150aa2377f6fa..fecf9f8f6b143e1277b7358496df72330a3111c3 100644 (file)
@@ -16,9 +16,6 @@
 
 #include <stdio.h>
 #include <string.h>
-//#if !defined(_MSC_VER)
-//#include <alloc.h>
-//#endif
 #include "aslink.h"
 
 /*)Module      lkrloc.c