From 994605ba5c8b657fac1563cd44707f679a85967e Mon Sep 17 00:00:00 2001 From: johanknol Date: Tue, 3 Jul 2001 15:02:29 +0000 Subject: [PATCH] Short is 16bits by default now git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1007 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCglobl.h | 2 +- src/SDCCmain.c | 11 +++++------ src/SDCCsymt.c | 2 +- src/avr/main.c | 2 +- src/ds390/main.c | 2 +- src/mcs51/main.c | 2 +- src/pic/main.c | 2 +- src/z80/main.c | 2 +- 8 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/SDCCglobl.h b/src/SDCCglobl.h index 0b403799..fbe02e14 100644 --- a/src/SDCCglobl.h +++ b/src/SDCCglobl.h @@ -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 */ diff --git a/src/SDCCmain.c b/src/SDCCmain.c index 3479f6c6..a87109af 100644 --- a/src/SDCCmain.c +++ b/src/SDCCmain.c @@ -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; } diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index 51e3e844..9ff910f0 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -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; } diff --git a/src/avr/main.c b/src/avr/main.c index c17fac1d..6685a116 100644 --- a/src/avr/main.c +++ b/src/avr/main.c @@ -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", diff --git a/src/ds390/main.c b/src/ds390/main.c index 3ec50889..fb90dbb4 100644 --- a/src/ds390/main.c +++ b/src/ds390/main.c @@ -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)", diff --git a/src/mcs51/main.c b/src/mcs51/main.c index 8da7d39d..f2ced3e2 100644 --- a/src/mcs51/main.c +++ b/src/mcs51/main.c @@ -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)", diff --git a/src/pic/main.c b/src/pic/main.c index f355cd44..2e41a00e 100644 --- a/src/pic/main.c +++ b/src/pic/main.c @@ -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) diff --git a/src/z80/main.c b/src/z80/main.c index 8822dfbb..4438c1ff 100644 --- a/src/z80/main.c +++ b/src/z80/main.c @@ -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", -- 2.30.2