History

c67: remove global #define's for TRUE/FALSE/BOOL

Also use uppercase TRUE/FALSE instead of true/false

grischka committed 13 years ago

Commit 263dc931 parent f7152075 files · +32 −32Browse files

Unified · Split

5 files
  1. c67-gen.c +25 −19
  2. libtcc.c +2 −2
  3. tcc.c +1 −1
  4. tcc.h +0 −6
  5. tcccoff.c +4 −4
c67-gen.c+25−19
@@ -174,11 +174,18 @@ int TranslateStackToReg[NoCallArgsPassedOnStack]; · 173 unmodified lines
174174 int ParamLocOnStack[NoCallArgsPassedOnStack];
175175 int TotalBytesPushedOnStack;
176176
177+#ifndef FALSE
178+# define FALSE 0
179+# define TRUE 1
180+#endif
181+
182+#undef BOOL
183+#define BOOL int
184+
177185 /******************************************************/
178186 static unsigned long func_sub_sp_offset;
179187 static int func_ret_sub;
180188
181−
182189 static BOOL C67_invert_test;
183190 static int C67_compare_reg;
184191
@@ -186,7 +193,6 @@ static int C67_compare_reg; · 1 unmodified line
186193 FILE *f = NULL;
187194 #endif
188195
189−
190196 void C67_g(int c)
191197 {
192198 int ind1;
@@ -1556,7 +1562,7 @@ void C67_SHR(int r, int v) · 1363 unmodified lines
15561562 void load(int r, SValue * sv)
15571563 {
15581564 int v, t, ft, fc, fr, size = 0, element;
1559− BOOL Unsigned = false;
1565+ BOOL Unsigned = FALSE;
15601566 SValue v1;
15611567
15621568 fr = sv->r;
@@ -2182,34 +2188,34 @@ void gen_opi(int op) · 619 unmodified lines
21822188
21832189 if (op == TOK_LT) {
21842190 C67_CMPLT(r, fr, C67_B2);
2185− C67_invert_test = false;
2191+ C67_invert_test = FALSE;
21862192 } else if (op == TOK_GE) {
21872193 C67_CMPLT(r, fr, C67_B2);
2188− C67_invert_test = true;
2194+ C67_invert_test = TRUE;
21892195 } else if (op == TOK_GT) {
21902196 C67_CMPGT(r, fr, C67_B2);
2191− C67_invert_test = false;
2197+ C67_invert_test = FALSE;
21922198 } else if (op == TOK_LE) {
21932199 C67_CMPGT(r, fr, C67_B2);
2194− C67_invert_test = true;
2200+ C67_invert_test = TRUE;
21952201 } else if (op == TOK_EQ) {
21962202 C67_CMPEQ(r, fr, C67_B2);
2197− C67_invert_test = false;
2203+ C67_invert_test = FALSE;
21982204 } else if (op == TOK_NE) {
21992205 C67_CMPEQ(r, fr, C67_B2);
2200− C67_invert_test = true;
2206+ C67_invert_test = TRUE;
22012207 } else if (op == TOK_ULT) {
22022208 C67_CMPLTU(r, fr, C67_B2);
2203− C67_invert_test = false;
2209+ C67_invert_test = FALSE;
22042210 } else if (op == TOK_UGE) {
22052211 C67_CMPLTU(r, fr, C67_B2);
2206− C67_invert_test = true;
2212+ C67_invert_test = TRUE;
22072213 } else if (op == TOK_UGT) {
22082214 C67_CMPGTU(r, fr, C67_B2);
2209− C67_invert_test = false;
2215+ C67_invert_test = FALSE;
22102216 } else if (op == TOK_ULE) {
22112217 C67_CMPGTU(r, fr, C67_B2);
2212− C67_invert_test = true;
2218+ C67_invert_test = TRUE;
22132219 } else if (op == '+')
22142220 C67_ADD(fr, r); // ADD r,fr,r
22152221 else if (op == '-')
@@ -2344,42 +2350,42 @@ void gen_opf(int op) · 128 unmodified lines
23442350 else
23452351 C67_CMPLTSP(r, fr, C67_B2);
23462352
2347− C67_invert_test = false;
2353+ C67_invert_test = FALSE;
23482354 } else if (op == TOK_GE) {
23492355 if ((ft & VT_BTYPE) == VT_DOUBLE)
23502356 C67_CMPLTDP(r, fr, C67_B2);
23512357 else
23522358 C67_CMPLTSP(r, fr, C67_B2);
23532359
2354− C67_invert_test = true;
2360+ C67_invert_test = TRUE;
23552361 } else if (op == TOK_GT) {
23562362 if ((ft & VT_BTYPE) == VT_DOUBLE)
23572363 C67_CMPGTDP(r, fr, C67_B2);
23582364 else
23592365 C67_CMPGTSP(r, fr, C67_B2);
23602366
2361− C67_invert_test = false;
2367+ C67_invert_test = FALSE;
23622368 } else if (op == TOK_LE) {
23632369 if ((ft & VT_BTYPE) == VT_DOUBLE)
23642370 C67_CMPGTDP(r, fr, C67_B2);
23652371 else
23662372 C67_CMPGTSP(r, fr, C67_B2);
23672373
2368− C67_invert_test = true;
2374+ C67_invert_test = TRUE;
23692375 } else if (op == TOK_EQ) {
23702376 if ((ft & VT_BTYPE) == VT_DOUBLE)
23712377 C67_CMPEQDP(r, fr, C67_B2);
23722378 else
23732379 C67_CMPEQSP(r, fr, C67_B2);
23742380
2375− C67_invert_test = false;
2381+ C67_invert_test = FALSE;
23762382 } else if (op == TOK_NE) {
23772383 if ((ft & VT_BTYPE) == VT_DOUBLE)
23782384 C67_CMPEQDP(r, fr, C67_B2);
23792385 else
23802386 C67_CMPEQSP(r, fr, C67_B2);
23812387
2382− C67_invert_test = true;
2388+ C67_invert_test = TRUE;
23832389 } else {
23842390 ALWAYS_ASSERT(FALSE);
23852391 }
libtcc.c+2−2
@@ -1493,9 +1493,9 @@ PUB_FUNC const char * tcc_set_linker(TCCState *s, char *option, int multi) · 1492 unmodified lines
14931493 while (option && *option) {
14941494 end = NULL;
14951495 if (link_option(option, "Bsymbolic", &p)) {
1496− s->symbolic = TRUE;
1496+ s->symbolic = 1;
14971497 } else if (link_option(option, "nostdlib", &p)) {
1498− s->nostdlib = TRUE;
1498+ s->nostdlib = 1;
14991499 } else if (link_option(option, "fini=", &p)) {
15001500 s->fini_symbol = p;
15011501 if (s->warn_unsupported)
tcc.c+1−1
@@ -469,7 +469,7 @@ static int parse_args(TCCState *s, int argc, char **argv) · 468 unmodified lines
469469 }
470470 }
471471 }
472− if (NULL != (r1 = tcc_set_linker(s, (char *) linker_arg.data, TRUE)))
472+ if (NULL != (r1 = tcc_set_linker(s, (char *) linker_arg.data, 1)))
473473 tcc_error("unsupported linker option '%s'", r1);
474474 /* fixme: these options could be different on your platform */
475475 if (was_pthread && output_type != TCC_OUTPUT_OBJ) {
tcc.h+0−6
@@ -222,12 +222,6 @@ · 221 unmodified lines
222222
223223 /* -------------------------------------------- */
224224
225−#define FALSE 0
226−#define false 0
227−#define TRUE 1
228−#define true 1
229−typedef int BOOL;
230−
231225 #define INCLUDE_STACK_SIZE 32
232226 #define IFDEF_STACK_SIZE 64
233227 #define VSTACK_SIZE 256
tcccoff.c+4−4
@@ -38,7 +38,7 @@ int EndAddress[MAX_FUNCS]; · 37 unmodified lines
3838 int LastLineNo[MAX_FUNCS];
3939 int FuncEntries[MAX_FUNCS];
4040
41−BOOL OutputTheSection(Section * sect);
41+int OutputTheSection(Section * sect);
4242 short int GetCoffFlags(const char *s);
4343 void SortSymbolTable(void);
4444 Section *FindSection(TCCState * s1, const char *sname);
@@ -814,14 +814,14 @@ int FindCoffSymbolIndex(const char *func_name) · 769 unmodified lines
814814 return n; // total number of symbols
815815 }
816816
817−BOOL OutputTheSection(Section * sect)
817+int OutputTheSection(Section * sect)
818818 {
819819 const char *s = sect->name;
820820
821821 if (!strcmp(s, ".text"))
822− return true;
822+ return 1;
823823 else if (!strcmp(s, ".data"))
824− return true;
824+ return 1;
825825 else
826826 return 0;
827827 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t