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
174int ParamLocOnStack[NoCallArgsPassedOnStack];174int ParamLocOnStack[NoCallArgsPassedOnStack];
175int TotalBytesPushedOnStack;175int TotalBytesPushedOnStack;
176 176
177#ifndef FALSE
178# define FALSE 0
179# define TRUE 1
180#endif
181
182#undef BOOL
183#define BOOL int
184
177/******************************************************/185/******************************************************/
178static unsigned long func_sub_sp_offset;186static unsigned long func_sub_sp_offset;
179static int func_ret_sub;187static int func_ret_sub;
180 188
181
182static BOOL C67_invert_test;189static BOOL C67_invert_test;
183static int C67_compare_reg;190static int C67_compare_reg;
184 191
@@ -186,7 +193,6 @@ static int C67_compare_reg; · 1 unmodified line
186FILE *f = NULL;193FILE *f = NULL;
187#endif194#endif
188 195
189
190void C67_g(int c)196void C67_g(int c)
191{197{
192 int ind1;198 int ind1;
@@ -1556,7 +1562,7 @@ void C67_SHR(int r, int v) · 1363 unmodified lines
1556void load(int r, SValue * sv)1562void load(int r, SValue * sv)
1557{1563{
1558 int v, t, ft, fc, fr, size = 0, element;1564 int v, t, ft, fc, fr, size = 0, element;
1559 BOOL Unsigned = false;1565 BOOL Unsigned = FALSE;
1560 SValue v1;1566 SValue v1;
1561 1567
1562 fr = sv->r;1568 fr = sv->r;
@@ -2182,34 +2188,34 @@ void gen_opi(int op) · 619 unmodified lines
2182 2188
2183 if (op == TOK_LT) {2189 if (op == TOK_LT) {
2184 C67_CMPLT(r, fr, C67_B2);2190 C67_CMPLT(r, fr, C67_B2);
2185 C67_invert_test = false;2191 C67_invert_test = FALSE;
2186 } else if (op == TOK_GE) {2192 } else if (op == TOK_GE) {
2187 C67_CMPLT(r, fr, C67_B2);2193 C67_CMPLT(r, fr, C67_B2);
2188 C67_invert_test = true;2194 C67_invert_test = TRUE;
2189 } else if (op == TOK_GT) {2195 } else if (op == TOK_GT) {
2190 C67_CMPGT(r, fr, C67_B2);2196 C67_CMPGT(r, fr, C67_B2);
2191 C67_invert_test = false;2197 C67_invert_test = FALSE;
2192 } else if (op == TOK_LE) {2198 } else if (op == TOK_LE) {
2193 C67_CMPGT(r, fr, C67_B2);2199 C67_CMPGT(r, fr, C67_B2);
2194 C67_invert_test = true;2200 C67_invert_test = TRUE;
2195 } else if (op == TOK_EQ) {2201 } else if (op == TOK_EQ) {
2196 C67_CMPEQ(r, fr, C67_B2);2202 C67_CMPEQ(r, fr, C67_B2);
2197 C67_invert_test = false;2203 C67_invert_test = FALSE;
2198 } else if (op == TOK_NE) {2204 } else if (op == TOK_NE) {
2199 C67_CMPEQ(r, fr, C67_B2);2205 C67_CMPEQ(r, fr, C67_B2);
2200 C67_invert_test = true;2206 C67_invert_test = TRUE;
2201 } else if (op == TOK_ULT) {2207 } else if (op == TOK_ULT) {
2202 C67_CMPLTU(r, fr, C67_B2);2208 C67_CMPLTU(r, fr, C67_B2);
2203 C67_invert_test = false;2209 C67_invert_test = FALSE;
2204 } else if (op == TOK_UGE) {2210 } else if (op == TOK_UGE) {
2205 C67_CMPLTU(r, fr, C67_B2);2211 C67_CMPLTU(r, fr, C67_B2);
2206 C67_invert_test = true;2212 C67_invert_test = TRUE;
2207 } else if (op == TOK_UGT) {2213 } else if (op == TOK_UGT) {
2208 C67_CMPGTU(r, fr, C67_B2);2214 C67_CMPGTU(r, fr, C67_B2);
2209 C67_invert_test = false;2215 C67_invert_test = FALSE;
2210 } else if (op == TOK_ULE) {2216 } else if (op == TOK_ULE) {
2211 C67_CMPGTU(r, fr, C67_B2);2217 C67_CMPGTU(r, fr, C67_B2);
2212 C67_invert_test = true;2218 C67_invert_test = TRUE;
2213 } else if (op == '+')2219 } else if (op == '+')
2214 C67_ADD(fr, r); // ADD r,fr,r2220 C67_ADD(fr, r); // ADD r,fr,r
2215 else if (op == '-')2221 else if (op == '-')
@@ -2344,42 +2350,42 @@ void gen_opf(int op) · 128 unmodified lines
2344 else2350 else
2345 C67_CMPLTSP(r, fr, C67_B2);2351 C67_CMPLTSP(r, fr, C67_B2);
2346 2352
2347 C67_invert_test = false;2353 C67_invert_test = FALSE;
2348 } else if (op == TOK_GE) {2354 } else if (op == TOK_GE) {
2349 if ((ft & VT_BTYPE) == VT_DOUBLE)2355 if ((ft & VT_BTYPE) == VT_DOUBLE)
2350 C67_CMPLTDP(r, fr, C67_B2);2356 C67_CMPLTDP(r, fr, C67_B2);
2351 else2357 else
2352 C67_CMPLTSP(r, fr, C67_B2);2358 C67_CMPLTSP(r, fr, C67_B2);
2353 2359
2354 C67_invert_test = true;2360 C67_invert_test = TRUE;
2355 } else if (op == TOK_GT) {2361 } else if (op == TOK_GT) {
2356 if ((ft & VT_BTYPE) == VT_DOUBLE)2362 if ((ft & VT_BTYPE) == VT_DOUBLE)
2357 C67_CMPGTDP(r, fr, C67_B2);2363 C67_CMPGTDP(r, fr, C67_B2);
2358 else2364 else
2359 C67_CMPGTSP(r, fr, C67_B2);2365 C67_CMPGTSP(r, fr, C67_B2);
2360 2366
2361 C67_invert_test = false;2367 C67_invert_test = FALSE;
2362 } else if (op == TOK_LE) {2368 } else if (op == TOK_LE) {
2363 if ((ft & VT_BTYPE) == VT_DOUBLE)2369 if ((ft & VT_BTYPE) == VT_DOUBLE)
2364 C67_CMPGTDP(r, fr, C67_B2);2370 C67_CMPGTDP(r, fr, C67_B2);
2365 else2371 else
2366 C67_CMPGTSP(r, fr, C67_B2);2372 C67_CMPGTSP(r, fr, C67_B2);
2367 2373
2368 C67_invert_test = true;2374 C67_invert_test = TRUE;
2369 } else if (op == TOK_EQ) {2375 } else if (op == TOK_EQ) {
2370 if ((ft & VT_BTYPE) == VT_DOUBLE)2376 if ((ft & VT_BTYPE) == VT_DOUBLE)
2371 C67_CMPEQDP(r, fr, C67_B2);2377 C67_CMPEQDP(r, fr, C67_B2);
2372 else2378 else
2373 C67_CMPEQSP(r, fr, C67_B2);2379 C67_CMPEQSP(r, fr, C67_B2);
2374 2380
2375 C67_invert_test = false;2381 C67_invert_test = FALSE;
2376 } else if (op == TOK_NE) {2382 } else if (op == TOK_NE) {
2377 if ((ft & VT_BTYPE) == VT_DOUBLE)2383 if ((ft & VT_BTYPE) == VT_DOUBLE)
2378 C67_CMPEQDP(r, fr, C67_B2);2384 C67_CMPEQDP(r, fr, C67_B2);
2379 else2385 else
2380 C67_CMPEQSP(r, fr, C67_B2);2386 C67_CMPEQSP(r, fr, C67_B2);
2381 2387
2382 C67_invert_test = true;2388 C67_invert_test = TRUE;
2383 } else {2389 } else {
2384 ALWAYS_ASSERT(FALSE);2390 ALWAYS_ASSERT(FALSE);
2385 }2391 }
libtcc.c+2−2
@@ -1493,9 +1493,9 @@ PUB_FUNC const char * tcc_set_linker(TCCState *s, char *option, int multi) · 1492 unmodified lines
1493 while (option && *option) {1493 while (option && *option) {
1494 end = NULL;1494 end = NULL;
1495 if (link_option(option, "Bsymbolic", &p)) {1495 if (link_option(option, "Bsymbolic", &p)) {
1496 s->symbolic = TRUE;1496 s->symbolic = 1;
1497 } else if (link_option(option, "nostdlib", &p)) {1497 } else if (link_option(option, "nostdlib", &p)) {
1498 s->nostdlib = TRUE;1498 s->nostdlib = 1;
1499 } else if (link_option(option, "fini=", &p)) {1499 } else if (link_option(option, "fini=", &p)) {
1500 s->fini_symbol = p;1500 s->fini_symbol = p;
1501 if (s->warn_unsupported)1501 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
469 }469 }
470 }470 }
471 }471 }
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)))
473 tcc_error("unsupported linker option '%s'", r1);473 tcc_error("unsupported linker option '%s'", r1);
474 /* fixme: these options could be different on your platform */474 /* fixme: these options could be different on your platform */
475 if (was_pthread && output_type != TCC_OUTPUT_OBJ) {475 if (was_pthread && output_type != TCC_OUTPUT_OBJ) {
tcc.h+0−6
@@ -222,12 +222,6 @@ · 221 unmodified lines
222 222
223/* -------------------------------------------- */223/* -------------------------------------------- */
224 224
225#define FALSE 0
226#define false 0
227#define TRUE 1
228#define true 1
229typedef int BOOL;
230
231#define INCLUDE_STACK_SIZE 32225#define INCLUDE_STACK_SIZE 32
232#define IFDEF_STACK_SIZE 64226#define IFDEF_STACK_SIZE 64
233#define VSTACK_SIZE 256227#define VSTACK_SIZE 256
tcccoff.c+4−4
@@ -38,7 +38,7 @@ int EndAddress[MAX_FUNCS]; · 37 unmodified lines
38int LastLineNo[MAX_FUNCS];38int LastLineNo[MAX_FUNCS];
39int FuncEntries[MAX_FUNCS];39int FuncEntries[MAX_FUNCS];
40 40
41BOOL OutputTheSection(Section * sect);41int OutputTheSection(Section * sect);
42short int GetCoffFlags(const char *s);42short int GetCoffFlags(const char *s);
43void SortSymbolTable(void);43void SortSymbolTable(void);
44Section *FindSection(TCCState * s1, const char *sname);44Section *FindSection(TCCState * s1, const char *sname);
@@ -814,14 +814,14 @@ int FindCoffSymbolIndex(const char *func_name) · 769 unmodified lines
814 return n; // total number of symbols814 return n; // total number of symbols
815}815}
816 816
817BOOL OutputTheSection(Section * sect)817int OutputTheSection(Section * sect)
818{818{
819 const char *s = sect->name;819 const char *s = sect->name;
820 820
821 if (!strcmp(s, ".text"))821 if (!strcmp(s, ".text"))
822 return true;822 return 1;
823 else if (!strcmp(s, ".data"))823 else if (!strcmp(s, ".data"))
824 return true;824 return 1;
825 else825 else
826 return 0;826 return 0;
827}827}

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