Skip to content

Commit c4fc176

Browse files
committed
prefixed TRUE/FALSE with FPP_
1 parent 6ebd6b3 commit c4fc176

File tree

11 files changed

+232
-232
lines changed

11 files changed

+232
-232
lines changed

Diff for: cpp.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
#define tolower(c) ((c) + ('a' - 'A'))
4343
#endif /* no tolower */
4444

45-
#ifndef TRUE
46-
#define TRUE 1
47-
#define FALSE 0
45+
#ifndef FPP_TRUE
46+
#define FPP_TRUE 1
47+
#define FPP_FALSE 0
4848
#endif
4949
#ifndef EOS
5050
/*
@@ -139,9 +139,9 @@
139139
/*
140140
* These bits are set in ifstack[]
141141
*/
142-
#define WAS_COMPILING 1 /* TRUE if compile set at entry */
143-
#define ELSE_SEEN 2 /* TRUE when #else processed */
144-
#define TRUE_SEEN 4 /* TRUE when #if TRUE processed */
142+
#define WAS_COMPILING 1 /* FPP_TRUE if compile set at entry */
143+
#define ELSE_SEEN 2 /* FPP_TRUE when #else processed */
144+
#define FPP_TRUE_SEEN 4 /* FPP_TRUE when #if FPP_TRUE processed */
145145

146146
/*
147147
* Define bits for the basic types and their adjectives

Diff for: cpp1.c

+29-29
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,17 @@ int fppPreProcess(struct fppTag *tags)
5555
global->wrongline=0;
5656
global->errors=0;
5757
global->recursion=0;
58-
global->rec_recover=TRUE;
59-
global->instring=FALSE;
60-
global->inmacro=FALSE;
58+
global->rec_recover=FPP_TRUE;
59+
global->instring=FPP_FALSE;
60+
global->inmacro=FPP_FALSE;
6161
global->workp=NULL;
62-
global->keepcomments = FALSE; /* Write out comments flag */
63-
global->cflag = FALSE; /* -C option (keep comments) */
64-
global->eflag = FALSE; /* -E option (never fail) */
62+
global->keepcomments = FPP_FALSE; /* Write out comments flag */
63+
global->cflag = FPP_FALSE; /* -C option (keep comments) */
64+
global->eflag = FPP_FALSE; /* -E option (never fail) */
6565
global->nflag = 0; /* -N option (no predefines) */
66-
global->wflag = FALSE; /* -W option (write #defines) */
66+
global->wflag = FPP_FALSE; /* -W option (write #defines) */
6767

68-
global->ifstack[0]=TRUE; /* #if information */
68+
global->ifstack[0]=FPP_TRUE; /* #if information */
6969
global->ifptr = global->ifstack;
7070
global->incend = global->incdir;
7171

@@ -106,23 +106,23 @@ int fppPreProcess(struct fppTag *tags)
106106
global->first_file=NULL;
107107
global->userdata=NULL;
108108

109-
global->linelines=TRUE;
110-
global->warnillegalcpp = FALSE;
111-
global->outputLINE = TRUE;
112-
global->warnnoinclude = TRUE;
113-
global->showversion = TRUE;
114-
global->showincluded = FALSE;
115-
global->showspace = FALSE;
116-
global->nestcomments = FALSE;
117-
global->warnnestcomments = FALSE;
118-
global->outputfile = TRUE;
109+
global->linelines=FPP_TRUE;
110+
global->warnillegalcpp = FPP_FALSE;
111+
global->outputLINE = FPP_TRUE;
112+
global->warnnoinclude = FPP_TRUE;
113+
global->showversion = FPP_TRUE;
114+
global->showincluded = FPP_FALSE;
115+
global->showspace = FPP_FALSE;
116+
global->nestcomments = FPP_FALSE;
117+
global->warnnestcomments = FPP_FALSE;
118+
global->outputfile = FPP_TRUE;
119119
global->included = 0;
120120

121-
global->comment = FALSE;
122-
global->rightconcat = FALSE;
121+
global->comment = FPP_FALSE;
122+
global->rightconcat = FPP_FALSE;
123123
global->work[0] = '\0';
124124
global->initialfunc = NULL;
125-
global->allowincludelocal = TRUE;
125+
global->allowincludelocal = FPP_TRUE;
126126

127127
memset(global->symtab, 0, SBSIZE * sizeof(DEFBUF *));
128128

@@ -209,7 +209,7 @@ ReturnCode cppmain(struct Global *global)
209209
sharp(global);
210210
/*
211211
* This loop is started "from the top" at the beginning of each line
212-
* wrongline is set TRUE in many places if it is necessary to write
212+
* wrongline is set FPP_TRUE in many places if it is necessary to write
213213
* a #line record. (But we don't write them when expanding macros.)
214214
*
215215
* The counter variable has two different uses: at
@@ -225,13 +225,13 @@ ReturnCode cppmain(struct Global *global)
225225
include = global->included;
226226

227227
while(include--) {
228-
openinclude(global, global->include[(unsigned)include], TRUE);
228+
openinclude(global, global->include[(unsigned)include], FPP_TRUE);
229229
}
230230

231231
for (;;) {
232232
counter = 0; /* Count empty lines */
233233
for (;;) { /* For each line, ... */
234-
global->comment = FALSE; /* No comment yet! */
234+
global->comment = FPP_FALSE; /* No comment yet! */
235235
global->chpos = 0; /* Count whitespaces */
236236
while (type[(c = get(global))] == SPA) /* Skip leading blanks */
237237
if(global->showspace) {
@@ -248,7 +248,7 @@ ReturnCode cppmain(struct Global *global)
248248
++counter; /* Do nothing now */
249249
}
250250
else if (c == '#') { /* Is 1st non-space '#' */
251-
global->keepcomments = FALSE; /* Don't pass comments */
251+
global->keepcomments = FPP_FALSE; /* Don't pass comments */
252252
ret = control(global, &counter); /* Yes, do a #command */
253253
if(ret)
254254
return(ret);
@@ -388,7 +388,7 @@ ReturnCode cppmain(struct Global *global)
388388
if(a==global->excluded) {
389389
expstuff(global, "__brace__", "{");
390390
expstuff(global, "__init_func__", global->initialfunc);
391-
initfunc = TRUE;
391+
initfunc = FPP_TRUE;
392392
}
393393
}
394394

@@ -475,7 +475,7 @@ ReturnCode cppmain(struct Global *global)
475475
if (c == '\n') { /* Compiling at EOL? */
476476
Putchar(global, '\n'); /* Output newline, if */
477477
if (global->infile->fp == NULL) /* Expanding a macro, */
478-
global->wrongline = TRUE; /* Output # line later */
478+
global->wrongline = FPP_TRUE; /* Output # line later */
479479
}
480480
} /* Continue until EOF */
481481

@@ -491,7 +491,7 @@ ReturnCode cppmain(struct Global *global)
491491
}
492492
}
493493
if (global->wflag) {
494-
global->out = TRUE; /* enable output */
494+
global->out = FPP_TRUE; /* enable output */
495495
outdefines(global); /* Write out #defines */
496496
}
497497
return(FPP_OK);
@@ -592,6 +592,6 @@ void sharp(struct Global *global)
592592
}
593593
}
594594
Putchar(global, '\n');
595-
global->wrongline = FALSE;
595+
global->wrongline = FPP_FALSE;
596596
return;
597597
}

Diff for: cpp2.c

+16-16
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ ReturnCode control( struct Global *global,
243243
global->infile->progname = savestring( global, tp );
244244
}
245245

246-
global->wrongline = TRUE; /* Force output later */
246+
global->wrongline = FPP_TRUE; /* Force output later */
247247
break;
248248

249249
case L_include:
@@ -284,11 +284,11 @@ ReturnCode control( struct Global *global,
284284

285285
if( (*global->ifptr & WAS_COMPILING) != 0 )
286286
{
287-
if( compiling || (*global->ifptr & TRUE_SEEN) != 0 )
288-
compiling = FALSE;
287+
if( compiling || (*global->ifptr & FPP_TRUE_SEEN) != 0 )
288+
compiling = FPP_FALSE;
289289
else
290290
{
291-
compiling = TRUE;
291+
compiling = FPP_TRUE;
292292
}
293293
}
294294
break;
@@ -311,9 +311,9 @@ ReturnCode control( struct Global *global,
311311
return( FPP_OK );
312312
}
313313

314-
if( (*global->ifptr & (WAS_COMPILING | TRUE_SEEN)) != WAS_COMPILING )
314+
if( (*global->ifptr & (WAS_COMPILING | FPP_TRUE_SEEN)) != WAS_COMPILING )
315315
{
316-
compiling = FALSE; /* Done compiling stuff */
316+
compiling = FPP_FALSE; /* Done compiling stuff */
317317

318318
dump_line( global, counter ); /* Skip this clause */
319319

@@ -361,7 +361,7 @@ ReturnCode control( struct Global *global,
361361
}
362362

363363
if( !compiling && (*global->ifptr & WAS_COMPILING) != 0 )
364-
global->wrongline = TRUE;
364+
global->wrongline = FPP_TRUE;
365365

366366
compiling = ((*global->ifptr & WAS_COMPILING) != 0);
367367

@@ -464,7 +464,7 @@ ReturnCode doif(struct Global *global, int hash)
464464
* Process an #if, #ifdef, or #ifndef. The latter two are straightforward,
465465
* while #if needs a subroutine of its own to evaluate the expression.
466466
*
467-
* doif() is called only if compiling is TRUE. If false, compilation
467+
* doif() is called only if compiling is FPP_TRUE. If false, compilation
468468
* is always supressed, so we don't need to evaluate anything. This
469469
* supresses unnecessary warnings.
470470
*/
@@ -497,7 +497,7 @@ ReturnCode doif(struct Global *global, int hash)
497497
if( ret )
498498
return( ret );
499499

500-
found = (found != 0); /* Evaluate expr, != 0 is TRUE */
500+
found = (found != 0); /* Evaluate expr, != 0 is FPP_TRUE */
501501

502502
hash = L_ifdef; /* #if is now like #ifdef */
503503
}
@@ -522,12 +522,12 @@ ReturnCode doif(struct Global *global, int hash)
522522

523523
if( found == (hash == L_ifdef) )
524524
{
525-
compiling = TRUE;
525+
compiling = FPP_TRUE;
526526

527-
*global->ifptr |= TRUE_SEEN;
527+
*global->ifptr |= FPP_TRUE_SEEN;
528528
}
529529
else
530-
compiling = FALSE;
530+
compiling = FPP_FALSE;
531531

532532
return(FPP_OK);
533533
}
@@ -615,7 +615,7 @@ ReturnCode MultiAssignLoad( struct Global *global, char *incptr, char *filename,
615615

616616
ReturnCode openinclude( struct Global *global,
617617
char *filename, /* Input file name */
618-
int searchlocal ) /* TRUE if #include "file" */
618+
int searchlocal ) /* FPP_TRUE if #include "file" */
619619
{
620620
/*
621621
* Actually open an include file. This routine is only called from
@@ -690,19 +690,19 @@ int hasdirectory( char *source, /* Directory to examine */
690690
/*
691691
* If a device or directory is found in the source filename string, the
692692
* node/device/directory part of the string is copied to result and
693-
* hasdirectory returns TRUE. Else, nothing is copied and it returns FALSE.
693+
* hasdirectory returns FPP_TRUE. Else, nothing is copied and it returns FPP_FALSE.
694694
*/
695695

696696
char *tp2;
697697

698698
if( (tp2 = strrchr( source, '/' ) ) == NULL )
699-
return(FALSE);
699+
return(FPP_FALSE);
700700

701701
strncpy( result, source, tp2 - source + 1 );
702702

703703
result[tp2 - source + 1] = EOS;
704704

705-
return( TRUE );
705+
return( FPP_TRUE );
706706
}
707707

708708
#ifdef _AMIGA

0 commit comments

Comments
 (0)