Short is 16bits by default now
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 3 Jul 2001 15:02:29 +0000 (15:02 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 3 Jul 2001 15:02:29 +0000 (15:02 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1007 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCglobl.h
src/SDCCmain.c
src/SDCCsymt.c
src/avr/main.c
src/ds390/main.c
src/mcs51/main.c
src/pic/main.c
src/z80/main.c

index 0b40379940d7bace55420d6d4400a9bf6aadcd5b..fbe02e14bdf140dcb155b5fcda3854bbb1f84980 100644 (file)
@@ -217,7 +217,7 @@ struct options
     int nostdlib;              /* Don't use standard lib files */
     int nostdinc;              /* Don't use standard include files */
     int verbose;               /* Show what the compiler is doing */
-    int shortisint;             /* treat short like int or char */
+    int shortis8bits;           /* treat short like int or char */
 
     char *calleeSaves[128];    /* list of functions using callee save */
     char *excludeRegs[32];     /* registers excluded from saving */
index 3479f6c6b453f1e164aa76d26d2ba135106237ed..a87109afb9b5282ba0a648d9e7f7368591ddc5c0 100644 (file)
@@ -108,7 +108,7 @@ char DefaultExePath[128];
 #define OPTION_NO_LOOP_IND     "--noinduction"
 #define OPTION_LESS_PEDANTIC   "--lesspedantic"
 #define OPTION_NO_GCSE         "--nogcse"
-#define OPTION_SHORT_IS_CHAR   "--short-is-char"
+#define OPTION_SHORT_IS_8BITS  "--short-is-8bits"
 
 /** Table of all options supported by all ports.
     This table provides:
@@ -198,8 +198,7 @@ optionsTable[] = {
     { 0,    "--nostdinc",           &options.nostdinc, NULL },
     { 0,    "--verbose",            &options.verbose, "Trace calls to the preprocessor, assembler, and linker" },
     { 0,    OPTION_LESS_PEDANTIC,   NULL, "Disable some of the more pedantic warnings" },
-    { 0,    "--short-is-int",      &options.shortisint, "Make short the same size as int" },
-    { 0,    OPTION_SHORT_IS_CHAR,   NULL, "Make short the same size as char (default)" }
+    { 0,    OPTION_SHORT_IS_8BITS,   NULL, "Make short 8bits (for old times sake)" }
 };
 
 /** Table of all unsupported options and help text to display when one
@@ -439,7 +438,7 @@ setDefaultOptions ()
   options.nostdlib = 0;
   options.nostdinc = 0;
   options.verbose = 0;
-  options.shortisint = 0;
+  options.shortis8bits = 1;
 
   options.stack10bit=0;
 
@@ -863,8 +862,8 @@ parseCmdLine (int argc, char **argv)
                   continue;
               }
 
-         if (strcmp (&argv[i][1], OPTION_SHORT_IS_CHAR) == 0) {
-           options.shortisint=0;
+         if (strcmp (&argv[i][1], OPTION_SHORT_IS_8BITS) == 0) {
+           options.shortis8bits=1;
            continue;
          }
           
index 51e3e844520b5e26d682207021777512c12076e7..9ff910f0c10790d4279b79d872100bab8d166377 100644 (file)
@@ -499,7 +499,7 @@ void checkTypeSanity(sym_link *etype, char *name) {
 
   // special case for "short"
   if (etype->select.s._short) {
-    SPEC_NOUN(etype) = options.shortisint ? V_INT : V_CHAR;
+    SPEC_NOUN(etype) = options.shortis8bits ? V_CHAR : V_INT;
     etype->select.s._short = 0;
   }
 
index c17fac1d69f0734dc64868d4937e1b487b326b3f..6685a116bafbcfe76777bc83e8337f99f5d4ba98 100644 (file)
@@ -168,7 +168,7 @@ PORT avr_port = {
         _defaultRules},
        {
         /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
-        1, 1, 2, 4, 2, 2, 3, 1, 4, 4},
+        1, 2, 2, 4, 2, 2, 3, 1, 4, 4},
        {
         "XSEG",
         "STACK",
index 3ec508892699618900211cb5a70750faf8a94a0d..fb90dbb44f7395ed78dfacf3444ee1516552ee2a 100644 (file)
@@ -224,7 +224,7 @@ PORT ds390_port =
   },
   {
        /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
-    1, 1, 2, 4, 1, 2, 3, 1, 4, 4
+    1, 2, 2, 4, 1, 2, 3, 1, 4, 4
   },
   {
     "XSEG    (XDATA)",
index 8da7d39d651c5fb0014a664c5eb3083ffee2cfd7..f2ced3e291068338e2cbc6f0f864309109398178 100644 (file)
@@ -164,7 +164,7 @@ PORT mcs51_port =
   },
   {
        /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
-    1, 1, 2, 4, 1, 2, 3, 1, 4, 4
+    1, 2, 2, 4, 1, 2, 3, 1, 4, 4
   },
   {
     "XSEG    (XDATA)",
index f355cd4406f23abd1ad8c1b25740908c4edf5946..2e41a00e6160e44120b712b043693973a9df8147 100644 (file)
@@ -244,7 +244,7 @@ PORT pic_port =
   },
   {
        /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
-    1, 1, 2, 4, 1, 2, 1, 1, 4, 4
+    1, 2, 2, 4, 1, 2, 1, 1, 4, 4
        /* TSD - I changed the size of gptr from 3 to 1. However, it should be
           2 so that we can accomodate the PIC's with 4 register banks (like the
           16f877)
index 8822dfbb8bf17998e4da21799bb93c7e98f8fe9b..4438c1ff12535bfd15efbdde0accf12c058bd4f6 100644 (file)
@@ -342,7 +342,7 @@ PORT z80_port =
   },
   {
        /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
-    1, 1, 2, 4, 2, 2, 2, 1, 4, 4
+    1, 2, 2, 4, 2, 2, 2, 1, 4, 4
   },
   {
     "XSEG",