lists.geany.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
List overview
Commits
October 2016
----- 2025 -----
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
commits@lists.geany.org
1 participants
54 discussions
Start a n
N
ew thread
[geany/geany] 87111f: Ferite: Fix a memory leak
by Colomban Wendling
09 Oct '16
09 Oct '16
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 09 Oct 2016 10:58:44 UTC Commit: 87111f268f13f56dc9cb57ee450fb956d25e9a82
https://github.com/geany/geany/commit/87111f268f13f56dc9cb57ee450fb956d25e9…
Log Message: ----------- Ferite: Fix a memory leak Modified Paths: -------------- ctags/parsers/c.c Modified: ctags/parsers/c.c 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -1440,7 +1440,7 @@ static void makeTag (const tokenInfo *const token, if (isType (token, TOKEN_NAME) && vStringLength (token->name) > 0 /* && includeTag (type, isFileScope) */) { - vString *scope = vStringNew (); + vString *scope; tagEntryInfo e; /* take only functions which are introduced by "function ..." */ @@ -1456,6 +1456,7 @@ static void makeTag (const tokenInfo *const token, e.filePosition = token->filePosition; e.isFileScope = isFileScope; + scope = vStringNew (); findScopeHierarchy (scope, st); addOtherFields (&e, type, token, st, scope); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 7ae1d0: Merge pull request #1251 from techee/bool
by Colomban Wendling
04 Oct '16
04 Oct '16
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Tue, 04 Oct 2016 16:10:24 UTC Commit: 7ae1d031efe8dd1b967c89ee404ab6fb2172ec4c
https://github.com/geany/geany/commit/7ae1d031efe8dd1b967c89ee404ab6fb2172e…
Log Message: ----------- Merge pull request #1251 from techee/bool CTags: boolean to C99 bool conversion and vStringTerminate() removal Modified Paths: -------------- HACKING ctags/main/args.c ctags/main/args.h ctags/main/entry.c ctags/main/entry.h ctags/main/general.h ctags/main/keyword.c ctags/main/kind.h ctags/main/lcpp.c ctags/main/lcpp.h ctags/main/lregex.c ctags/main/main.c ctags/main/main.h ctags/main/mio.c ctags/main/mio.h ctags/main/options.c ctags/main/options.h ctags/main/parse.c ctags/main/parse.h ctags/main/read.c ctags/main/read.h ctags/main/routines.c ctags/main/routines.h ctags/main/sort.c ctags/main/sort.h ctags/main/strlist.c ctags/main/strlist.h ctags/main/vstring.c ctags/main/vstring.h ctags/main/xtag.c ctags/main/xtag.h ctags/parsers/abaqus.c ctags/parsers/abc.c ctags/parsers/asciidoc.c ctags/parsers/asm.c ctags/parsers/basic.c ctags/parsers/c.c ctags/parsers/conf.c ctags/parsers/css.c ctags/parsers/diff.c ctags/parsers/docbook.c ctags/parsers/erlang.c ctags/parsers/fortran.c ctags/parsers/go.c ctags/parsers/haskell.c ctags/parsers/haxe.c ctags/parsers/jscript.c ctags/parsers/json.c ctags/parsers/latex.c ctags/parsers/lua.c ctags/parsers/make.c ctags/parsers/markdown.c ctags/parsers/matlab.c ctags/parsers/nsis.c ctags/parsers/objc.c ctags/parsers/pascal.c ctags/parsers/perl.c ctags/parsers/php.c ctags/parsers/powershell.c ctags/parsers/python.c ctags/parsers/r.c ctags/parsers/rest.c ctags/parsers/ruby.c ctags/parsers/rust.c ctags/parsers/sh.c ctags/parsers/sql.c ctags/parsers/tcl.c ctags/parsers/txt2tags.c ctags/parsers/verilog.c ctags/parsers/vhdl.c Modified: HACKING 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -460,7 +460,6 @@ Bugs to watch out for * Inserting fields into structs in the plugin API instead of appending. * Not breaking the plugin ABI when necessary. * Using an idle callback that doesn't check main_status.quitting. -* Forgetting to call vStringTerminate in CTags code. * Forgetting CRLF line endings on Windows. * Not handling Tabs & Spaces indent mode. Modified: ctags/main/args.c 12 lines changed, 5 insertions(+), 7 deletions(-) =================================================================== @@ -102,7 +102,6 @@ static char* nextFileArg (FILE* const fp) vStringPut (vs, c); c = fgetc (fp); } while (c != EOF && ! isspace (c)); - vStringTerminate (vs); Assert (vStringLength (vs) > 0); result = xMalloc (vStringLength (vs) + 1, char); strcpy (result, vStringValue (vs)); @@ -127,7 +126,6 @@ static char* nextFileLine (FILE* const fp) vStringPut (vs, c); c = fgetc (fp); } - vStringTerminate (vs); if (vStringLength (vs) > 0) { result = xMalloc (vStringLength (vs) + 1, char); @@ -186,7 +184,7 @@ extern Arguments* argNewFromLineFile (FILE* const fp) Arguments* result = xMalloc (1, Arguments); memset (result, 0, sizeof (Arguments)); result->type = ARG_FILE; - result->lineMode = TRUE; + result->lineMode = true; result->u.fileArgs.fp = fp; result->item = nextFileString (result, result->u.fileArgs.fp); return result; @@ -199,22 +197,22 @@ extern char *argItem (const Arguments* const current) return current->item; } -extern boolean argOff (const Arguments* const current) +extern bool argOff (const Arguments* const current) { Assert (current != NULL); - return (boolean) (current->item == NULL); + return (bool) (current->item == NULL); } extern void argSetWordMode (Arguments* const current) { Assert (current != NULL); - current->lineMode = FALSE; + current->lineMode = false; } extern void argSetLineMode (Arguments* const current) { Assert (current != NULL); - current->lineMode = TRUE; + current->lineMode = true; } extern void argForth (Arguments* const current) Modified: ctags/main/args.h 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -37,7 +37,7 @@ typedef struct sArgs { } fileArgs; } u; char* item; - boolean lineMode; + bool lineMode; } Arguments; /* @@ -48,7 +48,7 @@ extern Arguments* argNewFromArgv (char* const* const argv); extern Arguments* argNewFromFile (FILE* const fp); extern Arguments* argNewFromLineFile (FILE* const fp); extern char *argItem (const Arguments* const current); -extern boolean argOff (const Arguments* const current); +extern bool argOff (const Arguments* const current); extern void argSetWordMode (Arguments* const current); extern void argSetLineMode (Arguments* const current); extern void argForth (Arguments* const current); Modified: ctags/main/entry.c 14 lines changed, 7 insertions(+), 7 deletions(-) =================================================================== @@ -82,7 +82,7 @@ tagFile TagFile = { NULL /* vLine */ }; -static boolean TagsToStdout = FALSE; +static bool TagsToStdout = false; /* * FUNCTION PROTOTYPES @@ -244,19 +244,19 @@ static long unsigned int updatePseudoTags (MIO *const mio) -static boolean isTagFile (const char *const filename) +static bool isTagFile (const char *const filename) { - boolean ok = FALSE; /* we assume not unless confirmed */ + bool ok = false; /* we assume not unless confirmed */ MIO *const mio = mio_new_file_full (filename, "rb", g_fopen, fclose); if (mio == NULL && errno == ENOENT) - ok = TRUE; + ok = true; else if (mio != NULL) { const char *line = readLineRaw (TagFile.vLine, mio); if (line == NULL) - ok = TRUE; + ok = true; mio_free (mio); } return ok; @@ -281,7 +281,7 @@ extern void openTagFile (void) } else { - boolean fileExists; + bool fileExists; setDefaultTagFileName (); TagFile.name = eStrdup (Option.tagFileName); @@ -404,7 +404,7 @@ extern void initTagEntry (tagEntryInfo *const e, const char *const name, const k { Assert (File.source.name != NULL); memset (e, 0, sizeof (tagEntryInfo)); - e->lineNumberEntry = (boolean) (Option.locate == EX_LINENUM); + e->lineNumberEntry = (bool) (Option.locate == EX_LINENUM); e->lineNumber = getSourceLineNumber (); e->language = getSourceLanguageName (); e->filePosition = getInputFilePosition (); Modified: ctags/main/entry.h 10 lines changed, 5 insertions(+), 5 deletions(-) =================================================================== @@ -52,13 +52,13 @@ typedef struct sTagFields { /* Information about the current tag candidate. */ typedef struct sTagEntryInfo { - boolean lineNumberEntry;/* pattern or line number entry */ + bool lineNumberEntry; /* pattern or line number entry */ unsigned long lineNumber; /* line number of tag */ MIOPos filePosition; /* file position of line containing tag */ const char* language; /* language of source file */ - boolean isFileScope; /* is tag visible only within source file? */ - boolean isFileEntry; /* is this just an entry for a file name? */ - boolean truncateLine; /* truncate tag line at end of tag name? */ + bool isFileScope; /* is tag visible only within source file? */ + bool isFileEntry; /* is this just an entry for a file name? */ + bool truncateLine; /* truncate tag line at end of tag name? */ const char *sourceFileName; /* name of source file */ const char *name; /* name of the tag */ const kindOption *kind; /* kind descriptor */ @@ -89,7 +89,7 @@ extern const char *tagFileName (void); extern void copyBytes (MIO* const fromMio, MIO* const toMio, const long size); extern void copyFile (const char *const from, const char *const to, const long size); extern void openTagFile (void); -extern void closeTagFile (const boolean resize); +extern void closeTagFile (const bool resize); extern void beginEtagsFile (void); extern void endEtagsFile (const char *const name); extern void makeTagEntry (const tagEntryInfo *const tag); Modified: ctags/main/general.h 12 lines changed, 2 insertions(+), 10 deletions(-) =================================================================== @@ -22,6 +22,8 @@ /* include unistd.h preventively because at least under MacOSX it is needed for off_t */ #include <unistd.h> +#include <stdbool.h> + /* * MACROS */ @@ -115,16 +117,6 @@ void utils_warn(const char *msg); * DATA DECLARATIONS */ -#undef FALSE -#undef TRUE -#ifdef __cplusplus -typedef bool boolean; -#define FALSE false -#define TRUE true -#else -typedef enum { FALSE, TRUE } boolean; -#endif - #if ! defined (HAVE_FGETPOS) && ! defined (fpos_t) # define fpos_t long #endif Modified: ctags/main/keyword.c 8 lines changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -42,7 +42,7 @@ static hashEntry **HashTable = NULL; static hashEntry **getHashTable (void) { - static boolean allocated = FALSE; + static bool allocated = false; if (! allocated) { @@ -53,7 +53,7 @@ static hashEntry **getHashTable (void) for (i = 0 ; i < TableSize ; ++i) HashTable [i] = NULL; - allocated = TRUE; + allocated = true; } return HashTable; } @@ -187,7 +187,7 @@ static unsigned int printBucket (const unsigned int i) hashEntry **const table = getHashTable (); hashEntry *entry = table [i]; unsigned int measure = 1; - boolean first = TRUE; + bool first = true; printf ("%2d:", i); if (entry == NULL) @@ -199,7 +199,7 @@ static unsigned int printBucket (const unsigned int i) else { printf (" "); - first = FALSE; + first = false; } printEntry (entry); entry = entry->next; Modified: ctags/main/kind.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -18,7 +18,7 @@ #define KIND_FILE_DEFAULT_LONG "file" typedef struct sKindOption { - boolean enabled; /* are tags for kind enabled? */ + bool enabled; /* are tags for kind enabled? */ char letter; /* kind letter */ const char* name; /* kind name */ const char* description; /* displayed in --help output */ Modified: ctags/main/lcpp.c 147 lines changed, 73 insertions(+), 74 deletions(-) =================================================================== @@ -43,10 +43,10 @@ enum eCppLimits { /* Defines the one nesting level of a preprocessor conditional. */ typedef struct sConditionalInfo { - boolean ignoreAllBranches; /* ignoring parent conditional branch */ - boolean singleBranch; /* choose only one branch */ - boolean branchChosen; /* branch already selected */ - boolean ignoring; /* current ignore state */ + bool ignoreAllBranches; /* ignoring parent conditional branch */ + bool singleBranch; /* choose only one branch */ + bool branchChosen; /* branch already selected */ + bool ignoring; /* current ignore state */ } conditionalInfo; enum eState { @@ -62,13 +62,13 @@ enum eState { */ typedef struct sCppState { int ungetch, ungetch2; /* ungotten characters, if any */ - boolean resolveRequired; /* must resolve if/else/elif/endif branch */ - boolean hasAtLiteralStrings; /* supports @"c:\" strings */ - boolean hasCxxRawLiteralStrings; /* supports R"xxx(...)xxx" strings */ + bool resolveRequired; /* must resolve if/else/elif/endif branch */ + bool hasAtLiteralStrings; /* supports @"c:\" strings */ + bool hasCxxRawLiteralStrings; /* supports R"xxx(...)xxx" strings */ const kindOption *defineMacroKind; struct sDirective { enum eState state; /* current directive being processed */ - boolean accept; /* is a directive syntactically permitted? */ + bool accept; /* is a directive syntactically permitted? */ vString * name; /* macro name */ unsigned int nestLevel; /* level 0 is not used */ conditionalInfo ifdef [MaxCppNestingLevel]; @@ -81,28 +81,28 @@ typedef struct sCppState { /* Use brace formatting to detect end of block. */ -static boolean BraceFormat = FALSE; +static bool BraceFormat = false; static cppState Cpp = { '\0', '\0', /* ungetch characters */ - FALSE, /* resolveRequired */ - FALSE, /* hasAtLiteralStrings */ - FALSE, /* hasCxxRawLiteralStrings */ + false, /* resolveRequired */ + false, /* hasAtLiteralStrings */ + false, /* hasCxxRawLiteralStrings */ NULL, /* defineMacroKind */ { DRCTV_NONE, /* state */ - FALSE, /* accept */ + false, /* accept */ NULL, /* tag name */ 0, /* nestLevel */ - { {FALSE,FALSE,FALSE,FALSE} } /* ifdef array */ + { {false,false,false,false} } /* ifdef array */ } /* directive */ }; /* * FUNCTION DEFINITIONS */ -extern boolean cppIsBraceFormat (void) +extern bool cppIsBraceFormat (void) { return BraceFormat; } @@ -112,27 +112,27 @@ extern unsigned int cppGetDirectiveNestLevel (void) return Cpp.directive.nestLevel; } -extern void cppInit (const boolean state, const boolean hasAtLiteralStrings, - const boolean hasCxxRawLiteralStrings, +extern void cppInit (const bool state, const bool hasAtLiteralStrings, + const bool hasCxxRawLiteralStrings, const kindOption *defineMacroKind) { BraceFormat = state; Cpp.ungetch = '\0'; Cpp.ungetch2 = '\0'; - Cpp.resolveRequired = FALSE; + Cpp.resolveRequired = false; Cpp.hasAtLiteralStrings = hasAtLiteralStrings; Cpp.hasCxxRawLiteralStrings = hasCxxRawLiteralStrings; Cpp.defineMacroKind = defineMacroKind; Cpp.directive.state = DRCTV_NONE; - Cpp.directive.accept = TRUE; + Cpp.directive.accept = true; Cpp.directive.nestLevel = 0; - Cpp.directive.ifdef [0].ignoreAllBranches = FALSE; - Cpp.directive.ifdef [0].singleBranch = FALSE; - Cpp.directive.ifdef [0].branchChosen = FALSE; - Cpp.directive.ifdef [0].ignoring = FALSE; + Cpp.directive.ifdef [0].ignoreAllBranches = false; + Cpp.directive.ifdef [0].singleBranch = false; + Cpp.directive.ifdef [0].branchChosen = false; + Cpp.directive.ifdef [0].ignoring = false; if (Cpp.directive.name == NULL) Cpp.directive.name = vStringNew (); @@ -151,12 +151,12 @@ extern void cppTerminate (void) extern void cppBeginStatement (void) { - Cpp.resolveRequired = TRUE; + Cpp.resolveRequired = true; } extern void cppEndStatement (void) { - Cpp.resolveRequired = FALSE; + Cpp.resolveRequired = false; } /* @@ -178,7 +178,7 @@ extern void cppUngetc (const int c) /* Reads a directive, whose first character is given by "c", into "name". */ -static boolean readDirective (int c, char *const name, unsigned int maxLength) +static bool readDirective (int c, char *const name, unsigned int maxLength) { unsigned int i; @@ -197,7 +197,7 @@ static boolean readDirective (int c, char *const name, unsigned int maxLength) } name [i] = '\0'; /* null terminate */ - return (boolean) isspacetab (c); + return (bool) isspacetab (c); } /* Reads an identifier, whose first character is given by "c", into "tag", @@ -212,25 +212,24 @@ static void readIdentifier (int c, vString *const name) c = getcFromInputFile (); } while (c != EOF && cppIsident (c)); ungetcToInputFile (c); - vStringTerminate (name); } static conditionalInfo *currentConditional (void) { return &Cpp.directive.ifdef [Cpp.directive.nestLevel]; } -static boolean isIgnore (void) +static bool isIgnore (void) { return Cpp.directive.ifdef [Cpp.directive.nestLevel].ignoring; } -static boolean setIgnore (const boolean ignore) +static bool setIgnore (const bool ignore) { return Cpp.directive.ifdef [Cpp.directive.nestLevel].ignoring = ignore; } -static boolean isIgnoreBranch (void) +static bool isIgnoreBranch (void) { conditionalInfo *const ifdef = currentConditional (); @@ -239,7 +238,7 @@ static boolean isIgnoreBranch (void) * statements to be followed, but we must follow no further branches. */ if (Cpp.resolveRequired && ! BraceFormat) - ifdef->singleBranch = TRUE; + ifdef->singleBranch = true; /* We will ignore this branch in the following cases: * @@ -249,7 +248,7 @@ static boolean isIgnoreBranch (void) * a. A statement was incomplete upon entering the conditional * b. A statement is incomplete upon encountering a branch */ - return (boolean) (ifdef->ignoreAllBranches || + return (bool) (ifdef->ignoreAllBranches || (ifdef->branchChosen && ifdef->singleBranch)); } @@ -259,18 +258,18 @@ static void chooseBranch (void) { conditionalInfo *const ifdef = currentConditional (); - ifdef->branchChosen = (boolean) (ifdef->singleBranch || + ifdef->branchChosen = (bool) (ifdef->singleBranch || Cpp.resolveRequired); } } /* Pushes one nesting level for an #if directive, indicating whether or not * the branch should be ignored and whether a branch has already been chosen. */ -static boolean pushConditional (const boolean firstBranchChosen) +static bool pushConditional (const bool firstBranchChosen) { - const boolean ignoreAllBranches = isIgnore (); /* current ignore */ - boolean ignoreBranch = FALSE; + const bool ignoreAllBranches = isIgnore (); /* current ignore */ + bool ignoreBranch = false; if (Cpp.directive.nestLevel < (unsigned int) MaxCppNestingLevel - 1) { @@ -287,7 +286,7 @@ static boolean pushConditional (const boolean firstBranchChosen) ifdef->ignoreAllBranches = ignoreAllBranches; ifdef->singleBranch = Cpp.resolveRequired; ifdef->branchChosen = firstBranchChosen; - ifdef->ignoring = (boolean) (ignoreAllBranches || ( + ifdef->ignoring = (bool) (ignoreAllBranches || ( ! firstBranchChosen && ! BraceFormat && (ifdef->singleBranch || !Option.if0))); ignoreBranch = ifdef->ignoring; @@ -297,17 +296,17 @@ static boolean pushConditional (const boolean firstBranchChosen) /* Pops one nesting level for an #endif directive. */ -static boolean popConditional (void) +static bool popConditional (void) { if (Cpp.directive.nestLevel > 0) --Cpp.directive.nestLevel; return isIgnore (); } -static void makeDefineTag (const char *const name, boolean parameterized) +static void makeDefineTag (const char *const name, bool parameterized) { - const boolean isFileScope = (boolean) (! isInputHeaderFile ()); + const bool isFileScope = (bool) (! isInputHeaderFile ()); if (includingDefineTags () && (! isFileScope || Option.include.fileScope)) @@ -316,9 +315,9 @@ static void makeDefineTag (const char *const name, boolean parameterized) initTagEntry (&e, name, Cpp.defineMacroKind); - e.lineNumberEntry = (boolean) (Option.locate != EX_PATTERN); + e.lineNumberEntry = (bool) (Option.locate != EX_PATTERN); e.isFileScope = isFileScope; - e.truncateLine = TRUE; + e.truncateLine = true; if (parameterized) { e.extensionFields.signature = cppGetArglistFromFilePos(getInputFilePosition() @@ -332,15 +331,15 @@ static void makeDefineTag (const char *const name, boolean parameterized) static void directiveDefine (const int c) { - boolean parameterized; + bool parameterized; int nc; if (cppIsident1 (c)) { readIdentifier (c, Cpp.directive.name); nc = getcFromInputFile (); ungetcToInputFile (nc); - parameterized = (boolean) (nc == '('); + parameterized = (bool) (nc == '('); if (! isIgnore ()) makeDefineTag (vStringValue (Cpp.directive.name), parameterized); } @@ -362,27 +361,27 @@ static void directivePragma (int c) if (cppIsident1 (c)) { readIdentifier (c, Cpp.directive.name); - makeDefineTag (vStringValue (Cpp.directive.name), FALSE); + makeDefineTag (vStringValue (Cpp.directive.name), false); } } } Cpp.directive.state = DRCTV_NONE; } -static boolean directiveIf (const int c) +static bool directiveIf (const int c) { - const boolean ignore = pushConditional ((boolean) (c != '0')); + const bool ignore = pushConditional ((bool) (c != '0')); Cpp.directive.state = DRCTV_NONE; return ignore; } -static boolean directiveHash (const int c) +static bool directiveHash (const int c) { - boolean ignore = FALSE; + bool ignore = false; char directive [MaxDirectiveName]; - DebugStatement ( const boolean ignore0 = isIgnore (); ) + DebugStatement ( const bool ignore0 = isIgnore (); ) readDirective (c, directive, MaxDirectiveName); if (stringMatch (directive, "define")) @@ -402,7 +401,7 @@ static boolean directiveHash (const int c) } else if (stringMatch (directive, "endif")) { - DebugStatement ( debugCppNest (FALSE, Cpp.directive.nestLevel); ) + DebugStatement ( debugCppNest (false, Cpp.directive.nestLevel); ) ignore = popConditional (); Cpp.directive.state = DRCTV_NONE; DebugStatement ( if (ignore != ignore0) debugCppIgnore (ignore); ) @@ -417,9 +416,9 @@ static boolean directiveHash (const int c) /* Handles a pre-processor directive whose first character is given by "c". */ -static boolean handleDirective (const int c) +static bool handleDirective (const int c) { - boolean ignore = isIgnore (); + bool ignore = isIgnore (); switch (Cpp.directive.state) { @@ -528,7 +527,7 @@ static int skipOverDComment (void) /* Skips to the end of a string, returning a special character to * symbolically represent a generic string. */ -static int skipToEndOfString (boolean ignoreBackslash) +static int skipToEndOfString (bool ignoreBackslash) { int c; @@ -555,13 +554,13 @@ static int skipToEndOfCxxRawLiteralString (void) if (c != '(' && ! isCxxRawLiteralDelimiterChar (c)) { ungetcToInputFile (c); - c = skipToEndOfString (FALSE); + c = skipToEndOfString (false); } else { char delim[16]; unsigned int delimLen = 0; - boolean collectDelim = TRUE; + bool collectDelim = true; do { @@ -571,7 +570,7 @@ static int skipToEndOfCxxRawLiteralString (void) delimLen < (sizeof delim / sizeof *delim)) delim[delimLen++] = c; else - collectDelim = FALSE; + collectDelim = false; } else if (c == ')') { @@ -630,8 +629,8 @@ static int skipToEndOfChar (void) */ extern int cppGetc (void) { - boolean directive = FALSE; - boolean ignore = FALSE; + bool directive = false; + bool ignore = false; int c; if (Cpp.ungetch != '\0') @@ -648,8 +647,8 @@ extern int cppGetc (void) switch (c) { case EOF: - ignore = FALSE; - directive = FALSE; + ignore = false; + directive = false; break; case TAB: @@ -658,26 +657,26 @@ extern int cppGetc (void) case NEWLINE: if (directive && ! ignore) - directive = FALSE; - Cpp.directive.accept = TRUE; + directive = false; + Cpp.directive.accept = true; break; case DOUBLE_QUOTE: - Cpp.directive.accept = FALSE; - c = skipToEndOfString (FALSE); + Cpp.directive.accept = false; + c = skipToEndOfString (false); break; case '#': if (Cpp.directive.accept) { - directive = TRUE; + directive = true; Cpp.directive.state = DRCTV_HASH; - Cpp.directive.accept = FALSE; + Cpp.directive.accept = false; } break; case SINGLE_QUOTE: - Cpp.directive.accept = FALSE; + Cpp.directive.accept = false; c = skipToEndOfChar (); break; @@ -696,7 +695,7 @@ extern int cppGetc (void) else if (comment == COMMENT_D) c = skipOverDComment (); else - Cpp.directive.accept = FALSE; + Cpp.directive.accept = false; break; } @@ -780,8 +779,8 @@ extern int cppGetc (void) int next = getcFromInputFile (); if (next == DOUBLE_QUOTE) { - Cpp.directive.accept = FALSE; - c = skipToEndOfString (TRUE); + Cpp.directive.accept = false; + c = skipToEndOfString (true); break; } else @@ -819,14 +818,14 @@ extern int cppGetc (void) ungetcToInputFile (next); else { - Cpp.directive.accept = FALSE; + Cpp.directive.accept = false; c = skipToEndOfCxxRawLiteralString (); break; } } } enter: - Cpp.directive.accept = FALSE; + Cpp.directive.accept = false; if (directive) ignore = handleDirective (c); break; Modified: ctags/main/lcpp.h 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -34,11 +34,11 @@ /* * FUNCTION PROTOTYPES */ -extern boolean cppIsBraceFormat (void); +extern bool cppIsBraceFormat (void); extern unsigned int cppGetDirectiveNestLevel (void); -extern void cppInit (const boolean state, const boolean hasAtLiteralStrings, - const boolean hasCxxRawLiteralStrings, +extern void cppInit (const bool state, const bool hasAtLiteralStrings, + const bool hasCxxRawLiteralStrings, const kindOption *defineMacroKind); extern void cppTerminate (void); extern void cppBeginStatement (void); Modified: ctags/main/lregex.c 51 lines changed, 25 insertions(+), 26 deletions(-) =================================================================== @@ -81,7 +81,7 @@ typedef struct { * DATA DEFINITIONS */ -static boolean regexBroken = FALSE; +static bool regexBroken = false; /* Array of pattern sets, indexed by language */ static patternSet* Sets = NULL; @@ -156,7 +156,7 @@ static char* scanSeparators (char* name) { char sep = name [0]; char *copyto = name; - boolean quoted = FALSE; + bool quoted = false; for (++name ; *name != '\0' ; ++name) { @@ -172,10 +172,10 @@ static char* scanSeparators (char* name) *copyto++ = '\\'; *copyto++ = *name; } - quoted = FALSE; + quoted = false; } else if (*name == '\\') - quoted = TRUE; + quoted = true; else if (*name == sep) { break; @@ -196,11 +196,11 @@ static char* scanSeparators (char* name) * to the trailing flags is written to `flags'. If the pattern is not in the * correct format, a false value is returned. */ -static boolean parseTagRegex ( +static bool parseTagRegex ( char* const regexp, char** const name, char** const kinds, char** const flags) { - boolean result = FALSE; + bool result = false; const int separator = (unsigned char) regexp [0]; *name = scanSeparators (regexp); @@ -231,7 +231,7 @@ static boolean parseTagRegex ( *flags = third; *kinds = NULL; } - result = TRUE; + result = true; } } return result; @@ -263,7 +263,7 @@ static void addCompiledTagPattern ( ptrn->pattern = pattern; ptrn->type = PTRN_TAG; ptrn->u.tag.name_pattern = name; - ptrn->u.tag.kind.enabled = TRUE; + ptrn->u.tag.kind.enabled = true; ptrn->u.tag.kind.letter = kind; ptrn->u.tag.kind.name = kindName; ptrn->u.tag.kind.description = description; @@ -366,7 +366,7 @@ static void parseKinds ( } } -static void printRegexKind (const regexPattern *pat, unsigned int i, boolean indent) +static void printRegexKind (const regexPattern *pat, unsigned int i, bool indent) { const kindOption *const kind = &pat [i].u.tag.kind; const char *const indentation = indent ? " " : ""; @@ -431,7 +431,6 @@ static vString* substitute ( else if (*p != '\n' && *p != '\r') vStringPut (result, *p); } - vStringTerminate (result); return result; } @@ -477,22 +476,22 @@ static void matchCallbackPattern ( patbuf->u.callback.function (vStringValue (line), matches, count); } -static boolean matchRegexPattern (const vString* const line, +static bool matchRegexPattern (const vString* const line, const regexPattern* const patbuf) { - boolean result = FALSE; + bool result = false; GMatchInfo *minfo; if (g_regex_match(patbuf->pattern, vStringValue(line), 0, &minfo)) { - result = TRUE; + result = true; if (patbuf->type == PTRN_TAG) matchTagPattern (line, patbuf, minfo); else if (patbuf->type == PTRN_CALLBACK) matchCallbackPattern (line, patbuf, minfo); else { Assert ("invalid pattern type" == NULL); - result = FALSE; + result = false; } } g_match_info_free(minfo); @@ -506,17 +505,17 @@ static boolean matchRegexPattern (const vString* const line, /* Match against all patterns for specified language. Returns true if at least * on pattern matched. */ -extern boolean matchRegex (const vString* const line, const langType language) +extern bool matchRegex (const vString* const line, const langType language) { - boolean result = FALSE; + bool result = false; if (language != LANG_IGNORE && language <= SetUpper && Sets [language].count > 0) { const patternSet* const set = Sets + language; unsigned int i; for (i = 0 ; i < set->count ; ++i) if (matchRegexPattern (line, set->patterns + i)) - result = TRUE; + result = true; } return result; } @@ -594,10 +593,10 @@ extern void addLanguageRegex ( * Regex option parsing */ -extern boolean processRegexOption (const char *const option, +extern bool processRegexOption (const char *const option, const char *const parameter CTAGS_ATTR_UNUSED) { - boolean handled = FALSE; + bool handled = false; const char* const dash = strchr (option, '-'); if (dash != NULL && strncmp (option, "regex", dash - option) == 0) { @@ -612,7 +611,7 @@ extern boolean processRegexOption (const char *const option, printf ("regex: regex support not available; required for --%s option\n", option); #endif - handled = TRUE; + handled = true; } return handled; } @@ -626,16 +625,16 @@ extern void disableRegexKinds (const langType language CTAGS_ATTR_UNUSED) unsigned int i; for (i = 0 ; i < set->count ; ++i) if (set->patterns [i].type == PTRN_TAG) - set->patterns [i].u.tag.kind.enabled = FALSE; + set->patterns [i].u.tag.kind.enabled = false; } #endif } -extern boolean enableRegexKind ( +extern bool enableRegexKind ( const langType language CTAGS_ATTR_UNUSED, - const int kind CTAGS_ATTR_UNUSED, const boolean mode CTAGS_ATTR_UNUSED) + const int kind CTAGS_ATTR_UNUSED, const bool mode CTAGS_ATTR_UNUSED) { - boolean result = FALSE; + bool result = false; #ifdef HAVE_REGEX if (language <= SetUpper && Sets [language].count > 0) { @@ -646,14 +645,14 @@ extern boolean enableRegexKind ( set->patterns [i].u.tag.kind.letter == kind) { set->patterns [i].u.tag.kind.enabled = mode; - result = TRUE; + result = true; } } #endif return result; } -extern void printRegexKinds (const langType language CTAGS_ATTR_UNUSED, boolean indent CTAGS_ATTR_UNUSED) +extern void printRegexKinds (const langType language CTAGS_ATTR_UNUSED, bool indent CTAGS_ATTR_UNUSED) { #ifdef HAVE_REGEX if (language <= SetUpper && Sets [language].count > 0) Modified: ctags/main/main.c 7 lines changed, 3 insertions(+), 4 deletions(-) =================================================================== @@ -46,7 +46,6 @@ # include <sys/types.h> /* required by dirent.h */ # endif # include <dirent.h> /* to declare opendir() */ -# undef boolean #endif #ifdef HAVE_DIRECT_H # include <direct.h> /* to _getcwd() */ @@ -91,15 +90,15 @@ extern void addTotals ( Totals.bytes += bytes; } -extern boolean isDestinationStdout (void) +extern bool isDestinationStdout (void) { - boolean toStdout = FALSE; + bool toStdout = false; if (Option.xref || Option.filter || (Option.tagFileName != NULL && (strcmp (Option.tagFileName, "-") == 0 || strcmp (Option.tagFileName, "/dev/stdout") == 0 ))) - toStdout = TRUE; + toStdout = true; return toStdout; } Modified: ctags/main/main.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -20,7 +20,7 @@ * FUNCTION PROTOTYPES */ extern void addTotals (const unsigned int files, const long unsigned int lines, const long unsigned int bytes); -extern boolean isDestinationStdout (void); +extern bool isDestinationStdout (void); extern int main (int argc, char **argv); #endif /* CTAGS_MAIN_MAIN_H */ Modified: ctags/main/mio.c 44 lines changed, 22 insertions(+), 22 deletions(-) =================================================================== @@ -225,8 +225,8 @@ MIO *mio_new_memory (unsigned char *data, mio->impl.mem.allocated_size = size; mio->impl.mem.realloc_func = realloc_func; mio->impl.mem.free_func = free_func; - mio->impl.mem.eof = FALSE; - mio->impl.mem.error = FALSE; + mio->impl.mem.eof = false; + mio->impl.mem.error = false; } return mio; @@ -315,8 +315,8 @@ int mio_free (MIO *mio) mio->impl.mem.allocated_size = 0; mio->impl.mem.realloc_func = NULL; mio->impl.mem.free_func = NULL; - mio->impl.mem.eof = FALSE; - mio->impl.mem.error = FALSE; + mio->impl.mem.eof = false; + mio->impl.mem.error = false; } free (mio); @@ -377,7 +377,7 @@ size_t mio_read (MIO *mio, mio->impl.mem.pos += copy_bytes; } if (mio->impl.mem.pos >= mio->impl.mem.size) - mio->impl.mem.eof = TRUE; + mio->impl.mem.eof = true; } return n_read; @@ -392,11 +392,11 @@ size_t mio_read (MIO *mio, * Tries to resize the underlying buffer of an in-memory #MIO object. * This supports both growing and shrinking. * - * Returns: %TRUE on success, %FALSE otherwise. + * Returns: %true on success, %false otherwise. */ static int mem_try_resize (MIO *mio, size_t new_size) { - int success = FALSE; + int success = false; if (mio->impl.mem.realloc_func) { @@ -413,7 +413,7 @@ static int mem_try_resize (MIO *mio, size_t new_size) if (new_size <= mio->impl.mem.allocated_size) { mio->impl.mem.size = new_size; - success = TRUE; + success = true; } else { @@ -428,7 +428,7 @@ static int mem_try_resize (MIO *mio, size_t new_size) mio->impl.mem.buf = newbuf; mio->impl.mem.allocated_size = newsize; mio->impl.mem.size = new_size; - success = TRUE; + success = true; } } } @@ -442,7 +442,7 @@ static int mem_try_resize (MIO *mio, size_t new_size) mio->impl.mem.buf = newbuf; mio->impl.mem.allocated_size = new_size; mio->impl.mem.size = new_size; - success = TRUE; + success = true; } } } @@ -459,11 +459,11 @@ static int mem_try_resize (MIO *mio, size_t new_size) * Tries to ensure there is enough space for @n bytes to be written from the * current cursor position. * - * Returns: %TRUE if there is enough space, %FALSE otherwise. + * Returns: %true if there is enough space, %false otherwise. */ static int mem_try_ensure_space (MIO *mio, size_t n) { - int success = TRUE; + int success = true; if (mio->impl.mem.pos + n > mio->impl.mem.size) success = mem_try_resize (mio, mio->impl.mem.pos + n); @@ -678,7 +678,7 @@ int mio_getc (MIO *mio) mio->impl.mem.pos++; } else - mio->impl.mem.eof = TRUE; + mio->impl.mem.eof = true; return rv; } @@ -712,7 +712,7 @@ int mio_ungetc (MIO *mio, int ch) { rv = mio->impl.mem.ungetch = ch; mio->impl.mem.pos--; - mio->impl.mem.eof = FALSE; + mio->impl.mem.eof = false; } return rv; @@ -766,7 +766,7 @@ char *mio_gets (MIO *mio, char *s, size_t size) rv = s; } if (mio->impl.mem.pos >= mio->impl.mem.size) - mio->impl.mem.eof = TRUE; + mio->impl.mem.eof = true; } return rv; @@ -786,8 +786,8 @@ void mio_clearerr (MIO *mio) clearerr (mio->impl.file.fp); else { - mio->impl.mem.error = FALSE; - mio->impl.mem.eof = FALSE; + mio->impl.mem.error = false; + mio->impl.mem.eof = false; } } @@ -805,7 +805,7 @@ int mio_eof (MIO *mio) if (mio->type == MIO_TYPE_FILE) return feof (mio->impl.file.fp); else - return mio->impl.mem.eof != FALSE; + return mio->impl.mem.eof != false; } /** @@ -822,7 +822,7 @@ int mio_error (MIO *mio) if (mio->type == MIO_TYPE_FILE) return ferror (mio->impl.file.fp); else - return mio->impl.mem.error != FALSE; + return mio->impl.mem.error != false; } /** @@ -888,7 +888,7 @@ int mio_seek (MIO *mio, long offset, int whence) } if (rv == 0) { - mio->impl.mem.eof = FALSE; + mio->impl.mem.eof = false; mio->impl.mem.ungetch = EOF; } @@ -943,8 +943,8 @@ void mio_rewind (MIO *mio) { mio->impl.mem.pos = 0; mio->impl.mem.ungetch = EOF; - mio->impl.mem.eof = FALSE; - mio->impl.mem.error = FALSE; + mio->impl.mem.eof = false; + mio->impl.mem.error = false; } } Modified: ctags/main/mio.h 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -128,8 +128,8 @@ struct _MIO { size_t allocated_size; MIOReallocFunc realloc_func; MIODestroyNotify free_func; - boolean error; - boolean eof; + bool error; + bool eof; } mem; } impl; }; Modified: ctags/main/options.c 89 lines changed, 44 insertions(+), 45 deletions(-) =================================================================== @@ -45,7 +45,7 @@ # define RECURSE_SUPPORTED #endif -#define isCompoundOption(c) (boolean) (strchr ("fohiILpDb", (c)) != NULL) +#define isCompoundOption(c) (bool) (strchr ("fohiILpDb", (c)) != NULL) @@ -57,53 +57,53 @@ static stringList* Excluded = NULL; optionValues Option = { { - FALSE, /* --extra=f */ - TRUE, /* --file-scope */ + false, /* --extra=f */ + true, /* --file-scope */ }, { - TRUE, /* -fields=a */ - TRUE, /* -fields=f */ - FALSE, /* -fields=m */ - TRUE, /* -fields=i */ - FALSE, /* -fields=k */ - TRUE, /* -fields=z */ - TRUE, /* -fields=K */ - FALSE, /* -fields=l */ - TRUE, /* -fields=n */ - TRUE, /* -fields=s */ - TRUE, /* -fields=P */ - TRUE /* -fields=A */ + true, /* -fields=a */ + true, /* -fields=f */ + false, /* -fields=m */ + true, /* -fields=i */ + false, /* -fields=k */ + true, /* -fields=z */ + true, /* -fields=K */ + false, /* -fields=l */ + true, /* -fields=n */ + true, /* -fields=s */ + true, /* -fields=P */ + true /* -fields=A */ }, NULL, /* -I */ - FALSE, /* -a */ - FALSE, /* -B */ + false, /* -a */ + false, /* -B */ #ifdef MACROS_USE_PATTERNS EX_PATTERN, /* -n, --excmd */ #else EX_MIX, /* -n, --excmd */ #endif - FALSE, /* -R */ - TRUE, /* -u, --sort */ - FALSE, /* -V */ - FALSE, /* -x */ + false, /* -R */ + true, /* -u, --sort */ + false, /* -V */ + false, /* -x */ NULL, /* -L */ NULL, /* -o */ NULL, /* -h */ NULL, /* --etags-include */ DEFAULT_FILE_FORMAT,/* --format */ - FALSE, /* --if0 */ - FALSE, /* --kind-long */ + false, /* --if0 */ + false, /* --kind-long */ LANG_AUTO, /* --lang */ - TRUE, /* --links */ - FALSE, /* --filter */ + true, /* --links */ + false, /* --filter */ NULL, /* --filter-terminator */ - FALSE, /* --qualified-tags */ - FALSE, /* --tag-relative */ - FALSE, /* --totals */ - FALSE, /* --line-directives */ - FALSE, /* --nest */ - .machinable = FALSE, - .withListHeader = TRUE, + false, /* --qualified-tags */ + false, /* --tag-relative */ + false, /* --totals */ + false, /* --line-directives */ + false, /* --nest */ + .machinable = false, + .withListHeader = true, }; @@ -129,9 +129,9 @@ extern void setDefaultTagFileName (void) * file for the purposes of determining whether enclosed tags are global or * static. */ -extern boolean isIncludeFile (const char *const fileName) +extern bool isIncludeFile (const char *const fileName) { - return FALSE; + return false; } /* tags_ignore is a NULL-terminated array of strings, read from ~/.config/geany/ignore.tags. @@ -141,11 +141,11 @@ gchar **c_tags_ignore = NULL; /* Determines whether or not "name" should be ignored, per the ignore list. */ -extern boolean isIgnoreToken (const char *const name, - boolean *const pIgnoreParens, +extern bool isIgnoreToken (const char *const name, + bool *const pIgnoreParens, const char **const replacement) { - boolean result = FALSE; + bool result = false; if (c_tags_ignore != NULL) { @@ -155,35 +155,34 @@ extern boolean isIgnoreToken (const char *const name, vString *token = vStringNew(); if (pIgnoreParens != NULL) - *pIgnoreParens = FALSE; + *pIgnoreParens = false; for (i = 0 ; i < len ; ++i) { size_t tokenLen; vStringCopyS (token, c_tags_ignore[i]); - vStringTerminate (token); tokenLen = vStringLength (token); if (tokenLen >= 2 && vStringChar (token, tokenLen - 1) == '*' && strncmp (vStringValue (token), name, tokenLen - 1) == 0) { - result = TRUE; + result = true; break; } if (strncmp (vStringValue (token), name, nameLen) == 0) { if (nameLen == tokenLen) { - result = TRUE; + result = true; break; } else if (tokenLen == nameLen + 1 && vStringChar (token, tokenLen - 1) == '+') { - result = TRUE; + result = true; if (pIgnoreParens != NULL) - *pIgnoreParens = TRUE; + *pIgnoreParens = true; break; } else if (vStringChar (token, nameLen) == '=') @@ -230,10 +229,10 @@ extern void processExcludeOption (const char *const option CTAGS_ATTR_UNUSED, } } -extern boolean isExcludedFile (const char* const name) +extern bool isExcludedFile (const char* const name) { const char* base = baseFilename (name); - boolean result = FALSE; + bool result = false; if (Excluded != NULL) { result = stringListFileMatched (Excluded, base); Modified: ctags/main/options.h 68 lines changed, 34 insertions(+), 34 deletions(-) =================================================================== @@ -36,53 +36,53 @@ */ typedef struct sOptionValues { struct sInclude { - boolean fileNames; /* include tags for source file names */ - boolean fileScope; /* include tags of file scope only */ + bool fileNames; /* include tags for source file names */ + bool fileScope; /* include tags of file scope only */ } include; struct sExtFields { /* extension field content control */ - boolean access; - boolean fileScope; - boolean implementation; - boolean inheritance; - boolean kind; - boolean kindKey; - boolean kindLong; - boolean language; - boolean lineNumber; - boolean scope; - boolean filePosition; /* Write file position */ - boolean argList; /* Write function and macro argumentlist */ + bool access; + bool fileScope; + bool implementation; + bool inheritance; + bool kind; + bool kindKey; + bool kindLong; + bool language; + bool lineNumber; + bool scope; + bool filePosition; /* Write file position */ + bool argList; /* Write function and macro argumentlist */ } extensionFields; stringList* ignore; /* -I name of file containing tokens to ignore */ - boolean append; /* -a append to "tags" file */ - boolean backward; /* -B regexp patterns search backwards */ + bool append; /* -a append to "tags" file */ + bool backward; /* -B regexp patterns search backwards */ enum eLocate { EX_MIX, /* line numbers for defines, patterns otherwise */ EX_LINENUM, /* -n only line numbers in tag file */ EX_PATTERN /* -N only patterns in tag file */ } locate; /* --excmd EX command used to locate tag */ - boolean recurse; /* -R recurse into directories */ - boolean sorted; /* -u,--sort sort tags */ - boolean verbose; /* -V verbose */ - boolean xref; /* -x generate xref output instead */ + bool recurse; /* -R recurse into directories */ + bool sorted; /* -u,--sort sort tags */ + bool verbose; /* -V verbose */ + bool xref; /* -x generate xref output instead */ char *fileList; /* -L name of file containing names of files */ char *tagFileName; /* -o name of tags file */ stringList* headerExt; /* -h header extensions */ stringList* etagsInclude;/* --etags-include list of TAGS files to include*/ unsigned int tagFileFormat;/* --format tag file format (level) */ - boolean if0; /* --if0 examine code within "#if 0" branch */ - boolean kindLong; /* --kind-long */ + bool if0; /* --if0 examine code within "#if 0" branch */ + bool kindLong; /* --kind-long */ langType language; /* --lang specified language override */ - boolean followLinks; /* --link follow symbolic links? */ - boolean filter; /* --filter behave as filter: files in, tags out */ + bool followLinks; /* --link follow symbolic links? */ + bool filter; /* --filter behave as filter: files in, tags out */ char* filterTerminator; /* --filter-terminator string to output */ - boolean qualifiedTags; /* --qualified-tags include class-qualified tag */ - boolean tagRelative; /* --tag-relative file paths relative to tag file */ - boolean printTotals; /* --totals print cumulative statistics */ - boolean lineDirectives; /* --linedirectives process #line directives */ - boolean nestFunction; /* --nest Nest inside function blocks for tags */ - boolean machinable; /* --machinable */ - boolean withListHeader; /* --with-list-header */ + bool qualifiedTags; /* --qualified-tags include class-qualified tag */ + bool tagRelative; /* --tag-relative file paths relative to tag file */ + bool printTotals; /* --totals print cumulative statistics */ + bool lineDirectives; /* --linedirectives process #line directives */ + bool nestFunction; /* --nest Nest inside function blocks for tags */ + bool machinable; /* --machinable */ + bool withListHeader; /* --with-list-header */ } optionValues; /* @@ -97,9 +97,9 @@ extern void verbose (const char *const format, ...) CTAGS_ATTR_PRINTF (1, 2); extern void freeList (stringList** const pString); extern void setDefaultTagFileName (void); -extern boolean isIncludeFile (const char *const fileName); -extern boolean isExcludedFile (const char* const name); -extern boolean isIgnoreToken (const char *const name, boolean *const pIgnoreParens, const char **const replacement); +extern bool isIncludeFile (const char *const fileName); +extern bool isExcludedFile (const char* const name); +extern bool isIgnoreToken (const char *const name, bool *const pIgnoreParens, const char **const replacement); extern void readOptionConfiguration (void); extern void initOptions (void); extern void freeOptionResources (void); Modified: ctags/main/parse.c 101 lines changed, 50 insertions(+), 51 deletions(-) =================================================================== @@ -34,7 +34,7 @@ static parserDefinitionFunc* BuiltInParsers[] = { PARSER_LIST }; parserDefinition** LanguageTable = NULL; unsigned int LanguageCount = 0; static kindOption defaultFileKind = { - .enabled = FALSE, + .enabled = false, .letter = KIND_FILE_DEFAULT, .name = KIND_FILE_DEFAULT_LONG, .description = KIND_FILE_DEFAULT_LONG, @@ -84,7 +84,7 @@ extern parserDefinition* parserNewFull (const char* name, char fileKind) /* TODO: implement custom file kind */ result->fileKind = &defaultFileKind; - result->enabled = TRUE; + result->enabled = true; return result; } @@ -165,7 +165,6 @@ static vString* determineInterpreter (const char* const cmd) ; /* no-op */ for ( ; *p != '\0' && ! isspace (*p) ; ++p) vStringPut (interpreter, (int) *p); - vStringTerminate (interpreter); } while (strcmp (vStringValue (interpreter), "env") == 0); return interpreter; } @@ -212,22 +211,22 @@ extern langType getFileLanguage (const char *const fileName) extern void printLanguageMap (const langType language) { - boolean first = TRUE; + bool first = true; unsigned int i; stringList* map = LanguageTable [language]->currentPatterns; Assert (0 <= language && language < (int) LanguageCount); for (i = 0 ; map != NULL && i < stringListCount (map) ; ++i) { printf ("%s(%s)", (first ? "" : " "), vStringValue (stringListItem (map, i))); - first = FALSE; + first = false; } map = LanguageTable [language]->currentExtensions; for (i = 0 ; map != NULL && i < stringListCount (map) ; ++i) { printf ("%s.%s", (first ? "" : " "), vStringValue (stringListItem (map, i))); - first = FALSE; + first = false; } } @@ -288,14 +287,14 @@ extern void addLanguageExtensionMap (const langType language, stringListAdd (LanguageTable [language]->currentExtensions, str); } -extern void enableLanguages (const boolean state) +extern void enableLanguages (const bool state) { unsigned int i; for (i = 0 ; i < LanguageCount ; ++i) LanguageTable [i]->enabled = state; } -extern void enableLanguage (const langType language, const boolean state) +extern void enableLanguage (const langType language, const bool state) { Assert (0 <= language && language < (int) LanguageCount); LanguageTable [language]->enabled = state; @@ -308,10 +307,10 @@ static void initializeParserOne (langType lang) installKeywordTable (lang); installTagRegexTable (lang); - if ((parser->initialize != NULL) && (parser->initialized == FALSE)) + if ((parser->initialize != NULL) && (parser->initialized == false)) { parser->initialize (lang); - parser->initialized = TRUE; + parser->initialized = true; } } @@ -335,30 +334,30 @@ extern void initializeParsing (void) parserDefinition* const def = (*BuiltInParsers [i]) (); if (def != NULL) { - boolean accepted = FALSE; + bool accepted = false; if (def->name == NULL || def->name[0] == '\0') error (FATAL, "parser definition must contain name\n"); else if (def->method & METHOD_REGEX) { #ifdef HAVE_REGEX def->parser = findRegexTags; - accepted = TRUE; + accepted = true; #endif } else if ((def->parser == NULL) == (def->parser2 == NULL)) error (FATAL, "%s parser definition must define one and only one parsing routine\n", def->name); else - accepted = TRUE; + accepted = true; if (accepted) { def->id = LanguageCount++; LanguageTable [def->id] = def; } } } - enableLanguages (TRUE); + enableLanguages (true); initializeParsers (); } @@ -398,7 +397,7 @@ extern void processLanguageDefineOption (const char *const option, def->currentPatterns = stringListNew (); def->currentExtensions = stringListNew (); def->method = METHOD_NOT_CRAFTED; - def->enabled = TRUE; + def->enabled = true; def->id = i; LanguageTable = xRealloc (LanguageTable, i + 1, parserDefinition*); LanguageTable [i] = def; @@ -425,29 +424,29 @@ static kindOption *langKindOption (const langType language, const int flag) extern void processLegacyKindOption (const char *const parameter) { const langType lang = getNamedLanguage ("c"); - boolean clear = FALSE; + bool clear = false; const char* p = parameter; - boolean mode = TRUE; + bool mode = true; int c; error (WARNING, "-i option is deprecated; use --c-types option instead"); if (*p == '=') { - clear = TRUE; + clear = true; ++p; } if (clear && *p != '+' && *p != '-') { unsigned int i; for (i = 0 ; i < LanguageTable [lang]->kindCount ; ++i) - LanguageTable [lang]->kinds [i].enabled = FALSE; - Option.include.fileNames= FALSE; - Option.include.fileScope= FALSE; + LanguageTable [lang]->kinds [i].enabled = false; + Option.include.fileNames= false; + Option.include.fileScope= false; } while ((c = *p++) != '\0') switch (c) { - case '+': mode = TRUE; break; - case '-': mode = FALSE; break; + case '+': mode = true; break; + case '-': mode = false; break; case 'F': Option.include.fileNames = mode; break; case 'S': Option.include.fileScope = mode; break; @@ -475,14 +474,14 @@ static void disableLanguageKinds (const langType language) { unsigned int i; for (i = 0 ; i < LanguageTable [language]->kindCount ; ++i) - LanguageTable [language]->kinds [i].enabled = FALSE; + LanguageTable [language]->kinds [i].enabled = false; } } -static boolean enableLanguageKind (const langType language, - const int kind, const boolean mode) +static bool enableLanguageKind (const langType language, + const int kind, const bool mode) { - boolean result = FALSE; + bool result = false; if (LanguageTable [language]->method & METHOD_REGEX) #ifdef HAVE_REGEX result = enableRegexKind (language, kind, mode); @@ -495,7 +494,7 @@ static boolean enableLanguageKind (const langType language, if (opt != NULL) { opt->enabled = mode; - result = TRUE; + result = true; } } return result; @@ -506,16 +505,16 @@ static void processLangKindOption (const langType language, const char *const parameter) { const char *p = parameter; - boolean mode = TRUE; + bool mode = true; int c; Assert (0 <= language && language < (int) LanguageCount); if (*p != '+' && *p != '-') disableLanguageKinds (language); while ((c = *p++) != '\0') switch (c) { - case '+': mode = TRUE; break; - case '-': mode = FALSE; break; + case '+': mode = true; break; + case '-': mode = false; break; default: { @@ -526,10 +525,10 @@ static void processLangKindOption (const langType language, } } -extern boolean processKindOption (const char *const option, - const char *const parameter) +extern bool processKindOption (const char *const option, + const char *const parameter) { - boolean handled = FALSE; + bool handled = false; const char* const dash = strchr (option, '-'); if (dash != NULL && (strcmp (dash + 1, "types") == 0 || strcmp (dash + 1, "kinds") == 0)) @@ -543,7 +542,7 @@ extern boolean processKindOption (const char *const option, else processLangKindOption (language, option, parameter); vStringDelete (langName); - handled = TRUE; + handled = true; } return handled; } @@ -605,19 +604,19 @@ static void makeFileTag (const char *const fileName) tagEntryInfo tag; initTagEntry (&tag, baseFilename (fileName), getInputLanguageFileKind ()); - tag.isFileEntry = TRUE; - tag.lineNumberEntry = TRUE; + tag.isFileEntry = true; + tag.lineNumberEntry = true; tag.lineNumber = 1; makeTagEntry (&tag); } } -static boolean createTagsForFile (const char *const fileName, - const langType language, - const unsigned int passCount) +static bool createTagsForFile (const char *const fileName, + const langType language, + const unsigned int passCount) { - boolean retried = FALSE; + bool retried = false; if (fileOpen (fileName, language)) { @@ -636,13 +635,13 @@ static boolean createTagsForFile (const char *const fileName, return retried; } -static boolean createTagsWithFallback (const char *const fileName, - const langType language) +static bool createTagsWithFallback (const char *const fileName, + const langType language) { const unsigned long numTags = TagFile.numTags.added; MIOPos tagFilePosition; unsigned int passCount = 0; - boolean tagFileResized = FALSE; + bool tagFileResized = false; mio_getpos (TagFile.mio, &tagFilePosition); while (createTagsForFile (fileName, language, ++passCount)) @@ -651,14 +650,14 @@ static boolean createTagsWithFallback (const char *const fileName, */ mio_setpos (TagFile.mio, &tagFilePosition); TagFile.numTags.added = numTags; - tagFileResized = TRUE; + tagFileResized = true; } return tagFileResized; } -extern boolean parseFile (const char *const fileName) +extern bool parseFile (const char *const fileName) { - boolean tagFileResized = FALSE; + bool tagFileResized = false; langType language = Option.language; if (Option.language == LANG_AUTO) language = getFileLanguage (fileName); @@ -682,15 +681,15 @@ extern void installTagRegexTable (const langType language) lang = LanguageTable [language]; - if ((lang->tagRegexTable != NULL) && (lang->tagRegexInstalled == FALSE)) + if ((lang->tagRegexTable != NULL) && (lang->tagRegexInstalled == false)) { for (i = 0; i < lang->tagRegexCount; ++i) addTagRegex (language, lang->tagRegexTable [i].regex, lang->tagRegexTable [i].name, lang->tagRegexTable [i].kinds, lang->tagRegexTable [i].flags); - lang->tagRegexInstalled = TRUE; + lang->tagRegexInstalled = true; } } @@ -702,12 +701,12 @@ extern void installKeywordTable (const langType language) Assert (0 <= language && language < (int) LanguageCount); lang = LanguageTable [language]; - if ((lang->keywordTable != NULL) && (lang->keywordInstalled == FALSE)) + if ((lang->keywordTable != NULL) && (lang->keywordInstalled == false)) { for (i = 0; i < lang->keywordCount; ++i) addKeyword (lang->keywordTable [i].name, language, lang->keywordTable [i].id); - lang->keywordInstalled = TRUE; + lang->keywordInstalled = true; } } Modified: ctags/main/parse.h 30 lines changed, 15 insertions(+), 15 deletions(-) =================================================================== @@ -31,7 +31,7 @@ typedef int langType; typedef void (*createRegexTag) (const vString* const name); typedef void (*simpleParser) (void); -typedef boolean (*rescanParser) (const unsigned int passCount); +typedef bool (*rescanParser) (const unsigned int passCount); typedef void (*parserInitialize) (langType language); typedef int (*tagEntryFunction) (const tagEntryInfo *const tag, void *user_data); @@ -45,10 +45,10 @@ typedef enum { typedef struct { const char *const regex; - const char* const name; - const char* const kinds; + const char *const name; + const char *const kinds; const char *const flags; - boolean *disabled; + bool *disabled; } tagRegexTable; typedef struct { @@ -70,8 +70,8 @@ typedef struct { unsigned int method; /* See PARSE__... definitions above */ /* used internally */ - unsigned int id; /* id assigned to language */ - boolean enabled; /* currently enabled? */ + unsigned int id; /* id assigned to language */ + bool enabled; /* currently enabled? */ stringList* currentPatterns; /* current list of file name patterns */ stringList* currentExtensions; /* current list of extensions */ tagRegexTable *tagRegexTable; @@ -105,7 +105,7 @@ extern parserDefinitionFunc PARSER_LIST; extern parserDefinition** LanguageTable; extern unsigned int LanguageCount; /* Legacy interface */ -extern boolean includingDefineTags (void); +extern bool includingDefineTags (void); extern void processLegacyKindOption (const char *const parameter); /* Language processing and parsing */ @@ -123,31 +123,31 @@ extern void clearLanguageMap (const langType language); extern void addLanguageExtensionMap (const langType language, const char* extension); extern void addLanguagePatternMap (const langType language, const char* ptrn); extern void printLanguageMap (const langType language); -extern void enableLanguages (const boolean state); -extern void enableLanguage (const langType language, const boolean state); +extern void enableLanguages (const bool state); +extern void enableLanguage (const langType language, const bool state); extern void initializeParsing (void); extern void freeParserResources (void); extern void processLanguageDefineOption (const char *const option, const char *const parameter); -extern boolean processKindOption (const char *const option, const char *const parameter); +extern bool processKindOption (const char *const option, const char *const parameter); extern void printKindOptions (void); -extern boolean parseFile (const char *const fileName); +extern bool parseFile (const char *const fileName); extern void installKeywordTable (const langType language); /* Regex interface */ #ifdef HAVE_REGEX extern void findRegexTags (void); -extern boolean matchRegex (const vString* const line, const langType language); +extern bool matchRegex (const vString* const line, const langType language); #endif -extern boolean processRegexOption (const char *const option, const char *const parameter); +extern bool processRegexOption (const char *const option, const char *const parameter); extern void addLanguageRegex (const langType language, const char* const regex); extern void installTagRegexTable (const langType language); extern void addTagRegex (const langType language, const char* const regex, const char* const name, const char* const kinds, const char* const flags); extern void addCallbackRegex (const langType language, const char* const regex, const char* flags, const regexCallback callback); extern void disableRegexKinds (const langType language CTAGS_ATTR_UNUSED); -extern boolean enableRegexKind (const langType language, const int kind, const boolean mode); +extern bool enableRegexKind (const langType language, const int kind, const bool mode); extern void printRegexKindOptions (const langType language); -extern void printRegexKinds (const langType language, boolean indent); +extern void printRegexKinds (const langType language, bool indent); extern void freeRegexResources (void); extern void checkRegex (void); Modified: ctags/main/read.c 65 lines changed, 32 insertions(+), 33 deletions(-) =================================================================== @@ -103,10 +103,10 @@ static void setSourceFileParameters (vString *const fileName, const langType lan File.input.language = File.source.language; } -static boolean setSourceFileName (vString *const fileName) +static bool setSourceFileName (vString *const fileName) { const langType language = getFileLanguage (vStringValue (fileName)); - boolean result = FALSE; + bool result = false; if (language != LANG_IGNORE) { vString *pathName; @@ -116,7 +116,7 @@ static boolean setSourceFileName (vString *const fileName) pathName = combinePathAndFile (vStringValue (File.path), vStringValue (fileName)); setSourceFileParameters (pathName, -1); - result = TRUE; + result = true; } return result; } @@ -161,13 +161,13 @@ static unsigned long readLineNumber (void) static vString *readFileName (void) { vString *const fileName = vStringNew (); - boolean quoteDelimited = FALSE; + bool quoteDelimited = false; int c = skipWhite (); if (c == '"') { c = mio_getc (File.mio); /* skip double-quote */ - quoteDelimited = TRUE; + quoteDelimited = true; } while (c != EOF && c != '\n' && (quoteDelimited ? (c != '"') : (c != ' ' && c != '\t'))) @@ -182,16 +182,16 @@ static vString *readFileName (void) return fileName; } -static boolean parseLineDirective (void) +static bool parseLineDirective (void) { - boolean result = FALSE; + bool result = false; int c = skipWhite (); DebugStatement ( const char* lineStr = ""; ) if (isdigit (c)) { mio_ungetc (File.mio, c); - result = TRUE; + result = true; } else if (c == 'l' && mio_getc (File.mio) == 'i' && mio_getc (File.mio) == 'n' && mio_getc (File.mio) == 'e') @@ -200,14 +200,14 @@ static boolean parseLineDirective (void) if (c == ' ' || c == '\t') { DebugStatement ( lineStr = "line"; ) - result = TRUE; + result = true; } } if (result) { const unsigned long lNum = readLineNumber (); if (lNum == 0) - result = FALSE; + result = false; else { vString *const fileName = readFileName (); @@ -229,14 +229,14 @@ static boolean parseLineDirective (void) tagEntryInfo tag; initTagEntry (&tag, baseFilename (vStringValue (fileName)), getInputLanguageFileKind ()); - tag.isFileEntry = TRUE; - tag.lineNumberEntry = TRUE; + tag.isFileEntry = true; + tag.lineNumberEntry = true; tag.lineNumber = 1; makeTagEntry (&tag); } vStringDelete (fileName); - result = TRUE; + result = true; } } return result; @@ -249,10 +249,10 @@ static boolean parseLineDirective (void) /* This function opens an input file, and resets the line counter. If it * fails, it will display an error message and leave the File.mio set to NULL. */ -extern boolean fileOpen (const char *const fileName, const langType language) +extern bool fileOpen (const char *const fileName, const langType language) { const char *const openMode = "rb"; - boolean opened = FALSE; + bool opened = false; /* If another file was already open, then close it. */ @@ -267,15 +267,15 @@ extern boolean fileOpen (const char *const fileName, const langType language) error (WARNING | PERROR, "cannot open \"%s\"", fileName); else { - opened = TRUE; + opened = true; setInputFileName (fileName); mio_getpos (File.mio, &StartOfLine); mio_getpos (File.mio, &File.filePosition); File.currentLine = NULL; File.input.lineNumber = 0L; - File.eof = FALSE; - File.newLine = TRUE; + File.eof = false; + File.newLine = true; if (File.line != NULL) vStringClear (File.line); @@ -294,10 +294,10 @@ extern boolean fileOpen (const char *const fileName, const langType language) * This func is NOT THREAD SAFE. * The user should not tamper with the buffer while this func is executing. */ -extern boolean bufferOpen (unsigned char *buffer, size_t buffer_size, - const char *const fileName, const langType language ) +extern bool bufferOpen (unsigned char *buffer, size_t buffer_size, + const char *const fileName, const langType language ) { - boolean opened = FALSE; + bool opened = false; /* Check whether a file of a buffer were already open, then close them. */ @@ -308,20 +308,20 @@ extern boolean bufferOpen (unsigned char *buffer, size_t buffer_size, /* check if we got a good buffer */ if (buffer == NULL || buffer_size == 0) { - opened = FALSE; + opened = false; return opened; } - opened = TRUE; + opened = true; File.mio = mio_new_memory (buffer, buffer_size, NULL, NULL); setInputFileName (fileName); mio_getpos (File.mio, &StartOfLine); mio_getpos (File.mio, &File.filePosition); File.currentLine = NULL; File.input.lineNumber = 0L; - File.eof = FALSE; - File.newLine = TRUE; + File.eof = false; + File.newLine = true; if (File.line != NULL) vStringClear (File.line); @@ -352,7 +352,7 @@ extern void fileClose (void) } } -extern boolean fileEOF (void) +extern bool fileEOF (void) { return File.eof; } @@ -362,7 +362,7 @@ extern boolean fileEOF (void) static void fileNewline (void) { File.filePosition = StartOfLine; - File.newLine = FALSE; + File.newLine = false; File.input.lineNumber++; File.source.lineNumber++; DebugStatement ( if (Option.breakLine == File.input.lineNumber) lineBreak (); ) @@ -396,10 +396,10 @@ static int iFileGetc (void) } if (c == EOF) - File.eof = TRUE; + File.eof = true; else if (c == NEWLINE) { - File.newLine = TRUE; + File.newLine = true; mio_getpos (File.mio, &StartOfLine); } else if (c == CRETURN) @@ -413,7 +413,7 @@ static int iFileGetc (void) mio_ungetc (File.mio, next); c = NEWLINE; /* convert CR into newline */ - File.newLine = TRUE; + File.newLine = true; mio_getpos (File.mio, &StartOfLine); } DebugStatement ( debugPutc (DEBUG_RAW, c); ) @@ -444,7 +444,6 @@ static vString *iFileGetLine (void) vStringPut (File.line, c); if (c == '\n' || (c == EOF && vStringLength (File.line) > 0)) { - vStringTerminate (File.line); #ifdef HAVE_REGEX if (vStringLength (File.line) > 0) matchRegex (File.line, File.source.language); @@ -548,7 +547,7 @@ extern char *readLineRaw (vString *const vLine, MIO *const mio) error (FATAL, "NULL file pointer"); else { - boolean reReadLine; + bool reReadLine; /* If reading the line places any character other than a null or a * newline at the last character position in the buffer (one less @@ -561,7 +560,7 @@ extern char *readLineRaw (vString *const vLine, MIO *const mio) long startOfLine; startOfLine = mio_tell(mio); - reReadLine = FALSE; + reReadLine = false; *pLastChar = '\0'; result = mio_gets (mio, vStringValue (vLine), (int) vStringSize (vLine)); if (result == NULL) Modified: ctags/main/read.h 16 lines changed, 8 insertions(+), 8 deletions(-) =================================================================== @@ -31,7 +31,7 @@ #define getSourceLanguage() File.source.language #define getSourceLanguageName() getLanguageName (File.source.language) #define getSourceLineNumber() File.source.lineNumber -#define isInputLanguage(lang) (boolean)((lang) == File.input.language) +#define isInputLanguage(lang) (bool)((lang) == File.input.language) #define isInputHeaderFile() File.input.isHeader /* @@ -66,7 +66,7 @@ typedef struct sInputFileInfo { when `resetInputFile' is called on the input stream. This is needed for nested stream. */ - boolean isHeader; /* is input file a header file? */ + bool isHeader; /* is input file a header file? */ langType language; /* language of input file */ } inputFileInfo; @@ -78,8 +78,8 @@ typedef struct sInputFile { MIOPos filePosition; /* file position of current line */ unsigned int ungetchIdx; int ungetchBuf[3]; /* characters that were ungotten */ - boolean eof; /* have we reached the end of file? */ - boolean newLine; /* will the next character begin a new line? */ + bool eof; /* have we reached the end of file? */ + bool newLine; /* will the next character begin a new line? */ /* Contains data pertaining to the original source file in which the tag * was defined. This may be different from the input file when #line @@ -103,8 +103,8 @@ extern inputFile File; extern kindOption *getInputLanguageFileKind (void); extern void freeSourceFileResources (void); -extern boolean fileOpen (const char *const fileName, const langType language); -extern boolean fileEOF (void); +extern bool fileOpen (const char *const fileName, const langType language); +extern bool fileEOF (void); extern void fileClose (void); extern int getcFromInputFile (void); extern int getNthPrevCFromInputFile (unsigned int nth, int def); @@ -113,8 +113,8 @@ extern void ungetcToInputFile (int c); extern const unsigned char *readLineFromInputFile (void); extern char *readLineRaw (vString *const vLine, MIO *const mio); extern char *readSourceLine (vString *const vLine, MIOPos location, long *const pSeekValue); -extern boolean bufferOpen (unsigned char *buffer, size_t buffer_size, - const char *const fileName, const langType language ); +extern bool bufferOpen (unsigned char *buffer, size_t buffer_size, + const char *const fileName, const langType language ); #define bufferClose fileClose /* Bypass: reading from fp in inputFile WITHOUT updating fields in input fields */ Modified: ctags/main/routines.c 69 lines changed, 33 insertions(+), 36 deletions(-) =================================================================== @@ -94,15 +94,15 @@ # ifdef S_IFLNK # define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK) # else -# define S_ISLNK(mode) FALSE /* assume no soft links */ +# define S_ISLNK(mode) false /* assume no soft links */ # endif #endif #ifndef S_ISDIR # ifdef S_IFDIR # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) # else -# define S_ISDIR(mode) FALSE /* assume no soft links */ +# define S_ISDIR(mode) false /* assume no soft links */ # endif #endif @@ -314,16 +314,16 @@ static void setCurrentDirectory (void) #endif -extern boolean doesFileExist (const char *const fileName) +extern bool doesFileExist (const char *const fileName) { GStatBuf fileStatus; - return (boolean) (g_stat (fileName, &fileStatus) == 0); + return (bool) (g_stat (fileName, &fileStatus) == 0); } -extern boolean isRecursiveLink (const char* const dirName) +extern bool isRecursiveLink (const char* const dirName) { - boolean result = FALSE; + bool result = false; char* const path = absoluteFilename (dirName); while (path [strlen (path) - 1] == PATH_SEPARATOR) path [strlen (path) - 1] = '\0'; @@ -342,14 +342,14 @@ extern boolean isRecursiveLink (const char* const dirName) return result; } -extern boolean isSameFile (const char *const name1, const char *const name2) +extern bool isSameFile (const char *const name1, const char *const name2) { - boolean result = FALSE; + bool result = false; #ifdef HAVE_STAT_ST_INO GStatBuf stat1, stat2; if (g_stat (name1, &stat1) == 0 && g_stat (name2, &stat2) == 0) - result = (boolean) (stat1.st_ino == stat2.st_ino); + result = (bool) (stat1.st_ino == stat2.st_ino); #endif return result; } @@ -402,16 +402,16 @@ extern const char *fileExtension (const char *const fileName) return extension; } -extern boolean isAbsolutePath (const char *const path) +extern bool isAbsolutePath (const char *const path) { - boolean result = FALSE; + bool result = false; #if defined (MSDOS_STYLE_PATH) if (strchr (PathDelimiters, path [0]) != NULL) - result = TRUE; + result = true; else if (isalpha (path [0]) && path [1] == ':') { if (strchr (PathDelimiters, path [2]) != NULL) - result = TRUE; + result = true; else /* We don't support non-absolute file names with a drive * letter, like `d:NAME' (it's too much hassle). @@ -421,7 +421,7 @@ extern boolean isAbsolutePath (const char *const path) path); } #else - result = (boolean) (path [0] == PATH_SEPARATOR); + result = (bool) (path [0] == PATH_SEPARATOR); #endif return result; } @@ -432,17 +432,14 @@ extern vString *combinePathAndFile (const char *const path, vString *const filePath = vStringNew (); const int lastChar = path [strlen (path) - 1]; # ifdef MSDOS_STYLE_PATH - boolean terminated = (boolean) (strchr (PathDelimiters, lastChar) != NULL); + bool terminated = (bool) (strchr (PathDelimiters, lastChar) != NULL); # else - boolean terminated = (boolean) (lastChar == PATH_SEPARATOR); + bool terminated = (bool) (lastChar == PATH_SEPARATOR); # endif vStringCopyS (filePath, path); if (! terminated) - { vStringPut (filePath, OUTPUT_PATH_SEPARATOR); - vStringTerminate (filePath); - } vStringCatS (filePath, file); return filePath; @@ -609,56 +606,56 @@ extern long unsigned int getFileSize (const char *const name) } #if 0 -static boolean isSymbolicLink (const char *const name) +static bool isSymbolicLink (const char *const name) { #if defined (WIN32) - return FALSE; + return false; #else GStatBuf fileStatus; - boolean result = FALSE; + bool result = false; if (g_lstat (name, &fileStatus) == 0) - result = (boolean) (S_ISLNK (fileStatus.st_mode)); + result = (bool) (S_ISLNK (fileStatus.st_mode)); return result; #endif } -static boolean isNormalFile (const char *const name) +static bool isNormalFile (const char *const name) { GStatBuf fileStatus; - boolean result = FALSE; + bool result = false; if (g_stat (name, &fileStatus) == 0) - result = (boolean) (S_ISREG (fileStatus.st_mode)); + result = (bool) (S_ISREG (fileStatus.st_mode)); return result; } #endif -extern boolean isExecutable (const char *const name) +extern bool isExecutable (const char *const name) { GStatBuf fileStatus; - boolean result = FALSE; + bool result = false; if (g_stat (name, &fileStatus) == 0) - result = (boolean) ((fileStatus.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) != 0); + result = (bool) ((fileStatus.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) != 0); return result; } #ifdef HAVE_MKSTEMP -static boolean isSetUID (const char *const name) +static bool isSetUID (const char *const name) { #if defined (WIN32) - return FALSE; + return false; #else GStatBuf fileStatus; - boolean result = FALSE; + bool result = false; if (g_stat (name, &fileStatus) == 0) - result = (boolean) ((fileStatus.st_mode & S_ISUID) != 0); + result = (bool) ((fileStatus.st_mode & S_ISUID) != 0); return result; #endif @@ -667,13 +664,13 @@ static boolean isSetUID (const char *const name) #endif #if 0 -static boolean isDirectory (const char *const name) +static bool isDirectory (const char *const name) { - boolean result = FALSE; + bool result = false; GStatBuf fileStatus; if (g_stat (name, &fileStatus) == 0) - result = (boolean) S_ISDIR (fileStatus.st_mode); + result = (bool) S_ISDIR (fileStatus.st_mode); return result; } #endif Modified: ctags/main/routines.h 10 lines changed, 5 insertions(+), 5 deletions(-) =================================================================== @@ -80,11 +80,11 @@ extern char* newLowerString (const char* str); extern char* newUpperString (const char* str); /* File system functions */ -extern boolean doesFileExist (const char *const fileName); -extern boolean isRecursiveLink (const char* const dirName); -extern boolean isSameFile (const char *const name1, const char *const name2); +extern bool doesFileExist (const char *const fileName); +extern bool isRecursiveLink (const char* const dirName); +extern bool isSameFile (const char *const name1, const char *const name2); extern const char *baseFilename (const char *const filePath); -extern boolean isAbsolutePath (const char *const path); +extern bool isAbsolutePath (const char *const path); extern vString *combinePathAndFile (const char *const path, const char *const file); extern char* absoluteFilename (const char *file); extern char* absoluteDirname (char *file); @@ -94,7 +94,7 @@ extern void processExcludeOption (const char *const option, const char *const pa extern const char *fileExtension (const char *const fileName); extern char* eStrdup (const char* str); extern long unsigned int getFileSize (const char *const name); -extern boolean isExecutable (const char *const name); +extern bool isExecutable (const char *const name); #ifndef HAVE_STRICMP extern int stricmp (const char *s1, const char *s2); Modified: ctags/main/sort.c 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -57,7 +57,7 @@ extern void catFile (const char *const name) # define PE_CONST const #endif -extern void externalSortTags (const boolean toStdout) +extern void externalSortTags (const bool toStdout) { const char *const sortCommand = "sort -u -o"; PE_CONST char *const sortOrder1 = "LC_COLLATE=C"; @@ -124,7 +124,7 @@ static int compareTags (const void *const one, const void *const two) } static void writeSortedTags ( - char **const table, const size_t numTags, const boolean toStdout) + char **const table, const size_t numTags, const bool toStdout) { MIO *mio; size_t i; @@ -153,7 +153,7 @@ static void writeSortedTags ( mio_free (mio); } -extern void internalSortTags (const boolean toStdout) +extern void internalSortTags (const bool toStdout) { vString *vLine = vStringNew (); MIO *mio = NULL; Modified: ctags/main/sort.h 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -20,9 +20,9 @@ extern void catFile (const char *const name); #ifdef EXTERNAL_SORT -extern void externalSortTags (const boolean toStdout); +extern void externalSortTags (const bool toStdout); #else -extern void internalSortTags (const boolean toStdout); +extern void internalSortTags (const bool toStdout); #endif #endif /* CTAGS_MAIN_SORT_H */ Modified: ctags/main/strlist.c 44 lines changed, 22 insertions(+), 22 deletions(-) =================================================================== @@ -157,22 +157,22 @@ extern void stringListDelete (stringList *const current) } } -static boolean compareString ( +static bool compareString ( const char *const string, vString *const itm) { - return (boolean) (strcmp (string, vStringValue (itm)) == 0); + return (bool) (strcmp (string, vStringValue (itm)) == 0); } -static boolean compareStringInsensitive ( +static bool compareStringInsensitive ( const char *const string, vString *const itm) { - return (boolean) (strcasecmp (string, vStringValue (itm)) == 0); + return (bool) (strcasecmp (string, vStringValue (itm)) == 0); } static int stringListIndex ( const stringList *const current, const char *const string, - boolean (*test)(const char *s, vString *const vs)) + bool (*test)(const char *s, vString *const vs)) { int result = -1; unsigned int i; @@ -185,40 +185,40 @@ static int stringListIndex ( return result; } -extern boolean stringListHas ( +extern bool stringListHas ( const stringList *const current, const char *const string) { - boolean result = FALSE; + bool result = false; Assert (current != NULL); result = stringListIndex (current, string, compareString) != -1; return result; } -extern boolean stringListHasInsensitive ( +extern bool stringListHasInsensitive ( const stringList *const current, const char *const string) { - boolean result = FALSE; + bool result = false; Assert (current != NULL); Assert (string != NULL); result = stringListIndex (current, string, compareStringInsensitive) != -1; return result; } -extern boolean stringListHasTest ( - const stringList *const current, boolean (*test)(const char *s)) +extern bool stringListHasTest ( + const stringList *const current, bool (*test)(const char *s)) { - boolean result = FALSE; + bool result = false; unsigned int i; Assert (current != NULL); for (i = 0 ; ! result && i < current->count ; ++i) result = (*test)(vStringValue (current->list [i])); return result; } -extern boolean stringListRemoveExtension ( +extern bool stringListRemoveExtension ( stringList* const current, const char* const extension) { - boolean result = FALSE; + bool result = false; int where; #ifdef CASE_INSENSITIVE_FILENAMES where = stringListIndex (current, extension, compareStringInsensitive); @@ -231,12 +231,12 @@ extern boolean stringListRemoveExtension ( (current->count - where) * sizeof (*current->list)); current->list [current->count - 1] = NULL; --current->count; - result = TRUE; + result = true; } return result; } -extern boolean stringListExtensionMatched ( +extern bool stringListExtensionMatched ( const stringList* const current, const char* const extension) { #ifdef CASE_INSENSITIVE_FILENAMES @@ -246,23 +246,23 @@ extern boolean stringListExtensionMatched ( #endif } -static boolean fileNameMatched ( +static bool fileNameMatched ( const vString* const vpattern, const char* const fileName) { const char* const pattern = vStringValue (vpattern); #if defined (HAVE_FNMATCH) - return (boolean) (fnmatch (pattern, fileName, 0) == 0); + return (bool) (fnmatch (pattern, fileName, 0) == 0); #elif defined (CASE_INSENSITIVE_FILENAMES) - return (boolean) (strcasecmp (pattern, fileName) == 0); + return (bool) (strcasecmp (pattern, fileName) == 0); #else - return (boolean) (strcmp (pattern, fileName) == 0); + return (bool) (strcmp (pattern, fileName) == 0); #endif } -extern boolean stringListFileMatched ( +extern bool stringListFileMatched ( const stringList* const current, const char* const fileName) { - boolean result = FALSE; + bool result = false; unsigned int i; for (i = 0 ; ! result && i < stringListCount (current) ; ++i) result = fileNameMatched (stringListItem (current, i), fileName); Modified: ctags/main/strlist.h 12 lines changed, 6 insertions(+), 6 deletions(-) =================================================================== @@ -39,12 +39,12 @@ extern unsigned int stringListCount (const stringList *const current); extern vString* stringListItem (const stringList *const current, const unsigned int indx); extern vString* stringListLast (const stringList *const current); extern void stringListDelete (stringList *const current); -extern boolean stringListHasInsensitive (const stringList *const current, const char *const string); -extern boolean stringListHas (const stringList *const current, const char *const string); -extern boolean stringListHasTest (const stringList *const current, boolean (*test)(const char *s)); -extern boolean stringListRemoveExtension (stringList* const current, const char* const extension); -extern boolean stringListExtensionMatched (const stringList* const list, const char* const extension); -extern boolean stringListFileMatched (const stringList* const list, const char* const str); +extern bool stringListHasInsensitive (const stringList *const current, const char *const string); +extern bool stringListHas (const stringList *const current, const char *const string); +extern bool stringListHasTest (const stringList *const current, bool (*test)(const char *s)); +extern bool stringListRemoveExtension (stringList* const current, const char* const extension); +extern bool stringListExtensionMatched (const stringList* const list, const char* const extension); +extern bool stringListFileMatched (const stringList* const list, const char* const str); extern void stringListPrint (const stringList *const current); #endif /* CTAGS_MAIN_STRLIST_H */ Modified: ctags/main/vstring.c 7 lines changed, 3 insertions(+), 4 deletions(-) =================================================================== @@ -41,9 +41,9 @@ static void vStringResize (vString *const string, const size_t newSize) * External interface */ -extern boolean vStringAutoResize (vString *const string) +extern bool vStringAutoResize (vString *const string) { - boolean ok = TRUE; + bool ok = true; if (string->size <= INT_MAX / 2) { @@ -58,7 +58,7 @@ extern void vStringTruncate (vString *const string, const size_t length) { Assert (length <= string->length); string->length = length; - vStringTerminate (string); + vStringPut(string, '\0'); DebugStatement ( memset (string->buffer + string->length, 0, string->size - string->length); ) } @@ -145,7 +145,6 @@ extern void vStringNCatS ( --remain; ++p; } - vStringTerminate (string); } /* Strip trailing newline from string. Modified: ctags/main/vstring.h 3 lines changed, 1 insertions(+), 2 deletions(-) =================================================================== @@ -41,7 +41,6 @@ #define vStringCopy(vs,s) vStringCopyS((vs), vStringValue((s))) #define vStringNCopy(vs,s,l) vStringNCopyS((vs), vStringValue((s)), (l)) #define vStringChar(vs,i) ((vs)->buffer[i]) -#define vStringTerminate(vs) vStringPut(vs, '\0') #define vStringLower(vs) toLowerString((vs)->buffer) #define vStringUpper(vs) toUpperString((vs)->buffer) @@ -58,7 +57,7 @@ typedef struct sVString { /* * FUNCTION PROTOTYPES */ -extern boolean vStringAutoResize (vString *const string); +extern bool vStringAutoResize (vString *const string); extern void vStringClear (vString *const string); extern vString *vStringNew (void); extern void vStringDelete (vString *const string); Modified: ctags/main/xtag.c 30 lines changed, 15 insertions(+), 15 deletions(-) =================================================================== @@ -20,24 +20,24 @@ #include <string.h> -static boolean isPseudoTagsEnabled (xtagDesc *pdesc CTAGS_ATTR_UNUSED) +static bool isPseudoTagsEnabled (xtagDesc *pdesc CTAGS_ATTR_UNUSED) { return ! isDestinationStdout (); } static xtagDesc xtagDescs [] = { - { TRUE, 'F', "fileScope", + { true, 'F', "fileScope", "Include tags of file scope" }, - { FALSE, 'f', "inputFile", + { false, 'f', "inputFile", "Include an entry for the base file name of every input file"}, - { FALSE, 'p', "pseudo", + { false, 'p', "pseudo", "Include pseudo tags", isPseudoTagsEnabled}, - { FALSE, 'q', "qualified", + { false, 'q', "qualified", "Include an extra class-qualified tag entry for each tag"}, - { FALSE, 'r', "reference", + { false, 'r', "reference", "Include reference tags"}, - { FALSE, 's', "subparser", + { false, 's', "subparser", "Include tags generated by sub parsers"}, }; @@ -47,7 +47,7 @@ extern xtagDesc* getXtagDesc (xtagType type) return xtagDescs + type; } -typedef boolean (* xtagPredicate) (xtagDesc *pdesc, const void *user_data); +typedef bool (* xtagPredicate) (xtagDesc *pdesc, const void *user_data); static xtagType getXtagTypeGeneric (xtagPredicate predicate, const void *user_data) { int i; @@ -60,19 +60,19 @@ static xtagType getXtagTypeGeneric (xtagPredicate predicate, const void *user_d return XTAG_UNKNOWN; } -static boolean xtagEqualByLetter (xtagDesc *pdesc, const void *user_data) +static bool xtagEqualByLetter (xtagDesc *pdesc, const void *user_data) { - return (pdesc->letter == *((char *)user_data))? TRUE: FALSE; + return (pdesc->letter == *((char *)user_data))? true: false; } extern xtagType getXtagTypeForLetter (char letter) { return getXtagTypeGeneric (xtagEqualByLetter, &letter); } -static boolean xtagEqualByName (xtagDesc *pdesc, const void *user_data) +static bool xtagEqualByName (xtagDesc *pdesc, const void *user_data) { - return (strcmp (pdesc->name, user_data) == 0)? TRUE: FALSE; + return (strcmp (pdesc->name, user_data) == 0)? true: false; } extern xtagType getXtagTypeForName (const char *name) @@ -119,7 +119,7 @@ extern void printXtags (void) printXtag (i); } -extern boolean isXtagEnabled (xtagType type) +extern bool isXtagEnabled (xtagType type) { xtagDesc* desc = getXtagDesc (type); @@ -131,9 +131,9 @@ extern boolean isXtagEnabled (xtagType type) return desc->enabled; } -extern boolean enableXtag (xtagType type, boolean state) +extern bool enableXtag (xtagType type, bool state) { - boolean old; + bool old; xtagDesc* desc = getXtagDesc (type); Assert (desc); Modified: ctags/main/xtag.h 8 lines changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -28,7 +28,7 @@ typedef enum eXtagType { /* extra tag content control */ } xtagType; typedef struct sXtagDesc { - boolean enabled; + bool enabled; unsigned char letter; const char* name; /* used in extra: field */ const char* description; /* displayed in --list-extra output */ @@ -41,14 +41,14 @@ typedef struct sXtagDesc { to standared output, the tag is disabled by default. If it is connected to a regular file, the tag is enabled by default. */ - boolean (* isEnabled) (struct sXtagDesc *desc); + bool (* isEnabled) (struct sXtagDesc *desc); } xtagDesc; extern xtagDesc* getXtagDesc (xtagType type); extern xtagType getXtagTypeForLetter (char letter); extern xtagType getXtagTypeForName (const char *name); -extern boolean isXtagEnabled (xtagType type); -extern boolean enableXtag (xtagType type, boolean state); +extern bool isXtagEnabled (xtagType type); +extern bool enableXtag (xtagType type, bool state); const char* getXtagName (xtagType type); extern void printXtags (void); Modified: ctags/parsers/abaqus.c 11 lines changed, 5 insertions(+), 6 deletions(-) =================================================================== @@ -29,9 +29,9 @@ typedef enum { } AbaqusKind; static kindOption AbaqusKinds[] = { - { TRUE, 'c', "class", "Parts" }, - { TRUE, 'm', "member", "Assembly" }, - { TRUE, 'n', "namespace", "Steps" } + { true, 'c', "class", "Parts" }, + { true, 'm', "member", "Assembly" }, + { true, 'n', "namespace", "Steps" } }; /* @@ -44,10 +44,10 @@ static int getWord(const char *ref, const char **ptr) while ((*ref != '\0') && (*p != '\0') && (tolower(*ref) == tolower(*p))) ref++, p++; - if (*ref) return FALSE; + if (*ref) return false; *ptr = p; - return TRUE; + return true; } @@ -71,7 +71,6 @@ static void createTag(AbaqusKind kind, const char *buf) vStringPut(name, (int) *buf); ++buf; } while ((*buf != '\0') && (*buf != ',')); - vStringTerminate(name); makeSimpleTag(name, AbaqusKinds, kind); vStringDelete(name); } Modified: ctags/parsers/abc.c 23 lines changed, 10 insertions(+), 13 deletions(-) =================================================================== @@ -27,29 +27,29 @@ */ static kindOption AbcKinds[] = { - { TRUE, 'm', "member", "sections" }, - { TRUE, 's', "struct", "header1"} + { true, 'm', "member", "sections" }, + { true, 's', "struct", "header1"} }; /* * FUNCTION DEFINITIONS */ /* checks if str is all the same character */ -/*static boolean issame(const char *str) +/*static bool issame(const char *str) { char first = *str; while (*(++str)) { if (*str && *str != first) - return FALSE; + return false; } - return TRUE; + return true; }*/ -static void makeAbcTag (const vString* const name, boolean name_before) +static void makeAbcTag (const vString* const name, bool name_before) { tagEntryInfo e; initTagEntry (&e, vStringValue(name), &(AbcKinds[0])); @@ -60,7 +60,7 @@ static void makeAbcTag (const vString* const name, boolean name_before) makeTagEntry(&e); } -/*static void makeAbcTag2 (const vString* const name, boolean name_before) +/*static void makeAbcTag2 (const vString* const name, bool name_before) { tagEntryInfo e; initTagEntry (&e, vStringValue(name)); @@ -85,26 +85,23 @@ static void findAbcTags (void) /* underlines must be the same length or more */ /*if (name_len > 0 && (line[0] == '=' || line[0] == '-') && issame((const char*) line)) { - makeAbcTag(name, TRUE); + makeAbcTag(name, true); }*/ /* if (line[1] == '%') { vStringClear(name); vStringCatS(name, (const char *) line); - vStringTerminate(name); - makeAbcTag(name, FALSE); + makeAbcTag(name, false); }*/ if (line[0] == 'T') { /*vStringClear(name);*/ vStringCatS(name, " / "); vStringCatS(name, (const char *) line); - vStringTerminate(name); - makeAbcTag(name, FALSE); + makeAbcTag(name, false); } else { vStringClear (name); if (! isspace(*line)) vStringCatS(name, (const char*) line); - vStringTerminate(name); } } vStringDelete (name); Modified: ctags/parsers/asciidoc.c 12 lines changed, 5 insertions(+), 7 deletions(-) =================================================================== @@ -36,11 +36,11 @@ typedef enum { } asciidocKind; static kindOption AsciidocKinds[] = { - { TRUE, 'n', "namespace", "chapters"}, - { TRUE, 'm', "member", "sections" }, - { TRUE, 'd', "macro", "level2sections" }, - { TRUE, 'v', "variable", "level3sections" }, - { TRUE, 's', "struct", "level4sections" } + { true, 'n', "namespace", "chapters"}, + { true, 'm', "member", "sections" }, + { true, 'd', "macro", "level2sections" }, + { true, 'v', "variable", "level3sections" }, + { true, 's', "struct", "level4sections" } }; static char kindchars[SECTION_COUNT]={ '=', '-', '~', '^', '+' }; @@ -202,15 +202,13 @@ static void findAsciidocTags(void) while (isspace(line[end]))--end; vStringClear(name); vStringNCatS(name, (const char*)(&(line[start])), end - start + 1); - vStringTerminate(name); makeAsciidocTag(name, kind); continue; } } vStringClear(name); if (! isspace(*line)) vStringCatS(name, (const char*) line); - vStringTerminate(name); } vStringDelete(name); nestingLevelsFree(nestingLevels); Modified: ctags/parsers/asm.c 56 lines changed, 26 insertions(+), 30 deletions(-) =================================================================== @@ -61,10 +61,10 @@ typedef struct { static langType Lang_asm; static kindOption AsmKinds [] = { - { TRUE, 'd', "define", "defines" }, - { TRUE, 'l', "label", "labels" }, - { TRUE, 'm', "macro", "macros" }, - { TRUE, 't', "type", "types (structs and records)" } + { true, 'd', "define", "defines" }, + { true, 'l', "label", "labels" }, + { true, 'm', "macro", "macros" }, + { true, 't', "type", "types (structs and records)" } }; static const keywordTable AsmKeywords [] = { @@ -120,29 +120,28 @@ static opKeyword analyzeOperator (const vString *const op) return result; } -static boolean isInitialSymbolCharacter (int c) +static bool isInitialSymbolCharacter (int c) { - return (boolean) (c != '\0' && (isalpha (c) || strchr ("_$", c) != NULL)); + return (bool) (c != '\0' && (isalpha (c) || strchr ("_$", c) != NULL)); } -static boolean isSymbolCharacter (int c) +static bool isSymbolCharacter (int c) { /* '?' character is allowed in AMD 29K family */ - return (boolean) (c != '\0' && (isalnum (c) || strchr ("_$?", c) != NULL)); + return (bool) (c != '\0' && (isalnum (c) || strchr ("_$?", c) != NULL)); } -static boolean readPreProc (const unsigned char *const line) +static bool readPreProc (const unsigned char *const line) { - boolean result; + bool result; const unsigned char *cp = line; vString *name = vStringNew (); while (isSymbolCharacter ((int) *cp)) { vStringPut (name, *cp); ++cp; } - vStringTerminate (name); - result = (boolean) (strcmp (vStringValue (name), "define") == 0); + result = (bool) (strcmp (vStringValue (name), "define") == 0); if (result) { while (isspace ((int) *cp)) @@ -153,7 +152,6 @@ static boolean readPreProc (const unsigned char *const line) vStringPut (name, *cp); ++cp; } - vStringTerminate (name); makeSimpleTag (name, AsmKinds, K_DEFINE); } vStringDelete (name); @@ -162,11 +160,11 @@ static boolean readPreProc (const unsigned char *const line) static AsmKind operatorKind ( const vString *const operator, - boolean *const found) + bool *const found) { AsmKind result = K_NONE; const opKeyword kw = analyzeOperator (operator); - *found = (boolean) (kw != OP_UNDEFINED); + *found = (bool) (kw != OP_UNDEFINED); if (*found) { result = OpKinds [kw].kind; @@ -177,12 +175,12 @@ static AsmKind operatorKind ( /* We must check for "DB", "DB.L", "DCB.W" (68000) */ -static boolean isDefineOperator (const vString *const operator) +static bool isDefineOperator (const vString *const operator) { const unsigned char *const op = (unsigned char*) vStringValue (operator); const size_t length = vStringLength (operator); - const boolean result = (boolean) (length > 0 && + const bool result = (bool) (length > 0 && toupper ((int) *op) == 'D' && (length == 2 || (length == 4 && (int) op [2] == '.') || @@ -193,12 +191,12 @@ static boolean isDefineOperator (const vString *const operator) static void makeAsmTag ( const vString *const name, const vString *const operator, - const boolean labelCandidate, - const boolean nameFollows) + const bool labelCandidate, + const bool nameFollows) { if (vStringLength (name) > 0) { - boolean found; + bool found; const AsmKind kind = operatorKind (operator, &found); if (found) { @@ -232,7 +230,6 @@ static const unsigned char *readSymbol ( vStringPut (sym, *cp); ++cp; } - vStringTerminate (sym); } return cp; } @@ -248,7 +245,6 @@ static const unsigned char *readOperator ( vStringPut (operator, *cp); ++cp; } - vStringTerminate (operator); return cp; } @@ -257,20 +253,20 @@ static void findAsmTags (void) vString *name = vStringNew (); vString *operator = vStringNew (); const unsigned char *line; - boolean inCComment = FALSE; + bool inCComment = false; while ((line = readLineFromInputFile ()) != NULL) { const unsigned char *cp = line; - boolean labelCandidate = (boolean) (! isspace ((int) *cp)); - boolean nameFollows = FALSE; - const boolean isComment = (boolean) + bool labelCandidate = (bool) (! isspace ((int) *cp)); + bool nameFollows = false; + const bool isComment = (bool) (*cp != '\0' && strchr (";*@", *cp) != NULL); /* skip comments */ if (strncmp ((const char*) cp, "/*", (size_t) 2) == 0) { - inCComment = TRUE; + inCComment = true; cp += 2; } if (inCComment) @@ -279,7 +275,7 @@ static void findAsmTags (void) { if (strncmp ((const char*) cp, "*/", (size_t) 2) == 0) { - inCComment = FALSE; + inCComment = false; cp += 2; break; } @@ -305,7 +301,7 @@ static void findAsmTags (void) cp = readSymbol (cp, name); if (vStringLength (name) > 0 && *cp == ':') { - labelCandidate = TRUE; + labelCandidate = true; ++cp; } @@ -330,7 +326,7 @@ static void findAsmTags (void) while (isspace ((int) *cp)) ++cp; cp = readSymbol (cp, name); - nameFollows = TRUE; + nameFollows = true; } makeAsmTag (name, operator, labelCandidate, nameFollows); } Modified: ctags/parsers/basic.c 15 lines changed, 6 insertions(+), 9 deletions(-) =================================================================== @@ -40,12 +40,12 @@ typedef struct { } KeyWord; static kindOption BasicKinds[] = { - {TRUE, 'c', "constant", "constants"}, - {TRUE, 'f', "function", "functions"}, - {TRUE, 'l', "label", "labels"}, - {TRUE, 't', "type", "types"}, - {TRUE, 'v', "variable@@ Diff output truncated at 100000 characters. @@ -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 40396a: ctags: drop vStringTerminate()
by Jiřà Techet
04 Oct '16
04 Oct '16
Branch: refs/heads/master Author: Jiřà Techet <techet(a)gmail.com> Committer: Jiřà Techet <techet(a)gmail.com> Date: Tue, 04 Oct 2016 16:06:33 UTC Commit: 40396a392e5239ed79aad79ad1b1f1239670cbe7
https://github.com/geany/geany/commit/40396a392e5239ed79aad79ad1b1f1239670c…
Log Message: ----------- ctags: drop vStringTerminate() It's call is unnecesssary. Corresponds to universal-ctags commit cfc45e3bd9000e8ce193399c7e0ecf2bbeb57977. Modified Paths: -------------- HACKING ctags/main/args.c ctags/main/lcpp.c ctags/main/lregex.c ctags/main/options.c ctags/main/parse.c ctags/main/read.c ctags/main/routines.c ctags/main/vstring.c ctags/main/vstring.h ctags/parsers/abaqus.c ctags/parsers/abc.c ctags/parsers/asciidoc.c ctags/parsers/asm.c ctags/parsers/basic.c ctags/parsers/c.c ctags/parsers/conf.c ctags/parsers/css.c ctags/parsers/diff.c ctags/parsers/docbook.c ctags/parsers/erlang.c ctags/parsers/fortran.c ctags/parsers/go.c ctags/parsers/haskell.c ctags/parsers/haxe.c ctags/parsers/jscript.c ctags/parsers/json.c ctags/parsers/latex.c ctags/parsers/lua.c ctags/parsers/make.c ctags/parsers/markdown.c ctags/parsers/matlab.c ctags/parsers/nsis.c ctags/parsers/objc.c ctags/parsers/perl.c ctags/parsers/php.c ctags/parsers/powershell.c ctags/parsers/python.c ctags/parsers/r.c ctags/parsers/rest.c ctags/parsers/ruby.c ctags/parsers/sh.c ctags/parsers/sql.c ctags/parsers/tcl.c ctags/parsers/txt2tags.c ctags/parsers/verilog.c ctags/parsers/vhdl.c Modified: HACKING 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -460,7 +460,6 @@ Bugs to watch out for * Inserting fields into structs in the plugin API instead of appending. * Not breaking the plugin ABI when necessary. * Using an idle callback that doesn't check main_status.quitting. -* Forgetting to call vStringTerminate in CTags code. * Forgetting CRLF line endings on Windows. * Not handling Tabs & Spaces indent mode. Modified: ctags/main/args.c 2 lines changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -102,7 +102,6 @@ static char* nextFileArg (FILE* const fp) vStringPut (vs, c); c = fgetc (fp); } while (c != EOF && ! isspace (c)); - vStringTerminate (vs); Assert (vStringLength (vs) > 0); result = xMalloc (vStringLength (vs) + 1, char); strcpy (result, vStringValue (vs)); @@ -127,7 +126,6 @@ static char* nextFileLine (FILE* const fp) vStringPut (vs, c); c = fgetc (fp); } - vStringTerminate (vs); if (vStringLength (vs) > 0) { result = xMalloc (vStringLength (vs) + 1, char); Modified: ctags/main/lcpp.c 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -212,7 +212,6 @@ static void readIdentifier (int c, vString *const name) c = getcFromInputFile (); } while (c != EOF && cppIsident (c)); ungetcToInputFile (c); - vStringTerminate (name); } static conditionalInfo *currentConditional (void) Modified: ctags/main/lregex.c 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -431,7 +431,6 @@ static vString* substitute ( else if (*p != '\n' && *p != '\r') vStringPut (result, *p); } - vStringTerminate (result); return result; } Modified: ctags/main/options.c 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -162,7 +162,6 @@ extern bool isIgnoreToken (const char *const name, size_t tokenLen; vStringCopyS (token, c_tags_ignore[i]); - vStringTerminate (token); tokenLen = vStringLength (token); if (tokenLen >= 2 && vStringChar (token, tokenLen - 1) == '*' && Modified: ctags/main/parse.c 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -165,7 +165,6 @@ static vString* determineInterpreter (const char* const cmd) ; /* no-op */ for ( ; *p != '\0' && ! isspace (*p) ; ++p) vStringPut (interpreter, (int) *p); - vStringTerminate (interpreter); } while (strcmp (vStringValue (interpreter), "env") == 0); return interpreter; } Modified: ctags/main/read.c 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -444,7 +444,6 @@ static vString *iFileGetLine (void) vStringPut (File.line, c); if (c == '\n' || (c == EOF && vStringLength (File.line) > 0)) { - vStringTerminate (File.line); #ifdef HAVE_REGEX if (vStringLength (File.line) > 0) matchRegex (File.line, File.source.language); Modified: ctags/main/routines.c 3 lines changed, 0 insertions(+), 3 deletions(-) =================================================================== @@ -439,10 +439,7 @@ extern vString *combinePathAndFile (const char *const path, vStringCopyS (filePath, path); if (! terminated) - { vStringPut (filePath, OUTPUT_PATH_SEPARATOR); - vStringTerminate (filePath); - } vStringCatS (filePath, file); return filePath; Modified: ctags/main/vstring.c 3 lines changed, 1 insertions(+), 2 deletions(-) =================================================================== @@ -58,7 +58,7 @@ extern void vStringTruncate (vString *const string, const size_t length) { Assert (length <= string->length); string->length = length; - vStringTerminate (string); + vStringPut(string, '\0'); DebugStatement ( memset (string->buffer + string->length, 0, string->size - string->length); ) } @@ -145,7 +145,6 @@ extern void vStringNCatS ( --remain; ++p; } - vStringTerminate (string); } /* Strip trailing newline from string. Modified: ctags/main/vstring.h 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -41,7 +41,6 @@ #define vStringCopy(vs,s) vStringCopyS((vs), vStringValue((s))) #define vStringNCopy(vs,s,l) vStringNCopyS((vs), vStringValue((s)), (l)) #define vStringChar(vs,i) ((vs)->buffer[i]) -#define vStringTerminate(vs) vStringPut(vs, '\0') #define vStringLower(vs) toLowerString((vs)->buffer) #define vStringUpper(vs) toUpperString((vs)->buffer) Modified: ctags/parsers/abaqus.c 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -71,7 +71,6 @@ static void createTag(AbaqusKind kind, const char *buf) vStringPut(name, (int) *buf); ++buf; } while ((*buf != '\0') && (*buf != ',')); - vStringTerminate(name); makeSimpleTag(name, AbaqusKinds, kind); vStringDelete(name); } Modified: ctags/parsers/abc.c 3 lines changed, 0 insertions(+), 3 deletions(-) =================================================================== @@ -90,21 +90,18 @@ static void findAbcTags (void) /* if (line[1] == '%') { vStringClear(name); vStringCatS(name, (const char *) line); - vStringTerminate(name); makeAbcTag(name, false); }*/ if (line[0] == 'T') { /*vStringClear(name);*/ vStringCatS(name, " / "); vStringCatS(name, (const char *) line); - vStringTerminate(name); makeAbcTag(name, false); } else { vStringClear (name); if (! isspace(*line)) vStringCatS(name, (const char*) line); - vStringTerminate(name); } } vStringDelete (name); Modified: ctags/parsers/asciidoc.c 2 lines changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -202,15 +202,13 @@ static void findAsciidocTags(void) while (isspace(line[end]))--end; vStringClear(name); vStringNCatS(name, (const char*)(&(line[start])), end - start + 1); - vStringTerminate(name); makeAsciidocTag(name, kind); continue; } } vStringClear(name); if (! isspace(*line)) vStringCatS(name, (const char*) line); - vStringTerminate(name); } vStringDelete(name); nestingLevelsFree(nestingLevels); Modified: ctags/parsers/asm.c 4 lines changed, 0 insertions(+), 4 deletions(-) =================================================================== @@ -141,7 +141,6 @@ static bool readPreProc (const unsigned char *const line) vStringPut (name, *cp); ++cp; } - vStringTerminate (name); result = (bool) (strcmp (vStringValue (name), "define") == 0); if (result) { @@ -153,7 +152,6 @@ static bool readPreProc (const unsigned char *const line) vStringPut (name, *cp); ++cp; } - vStringTerminate (name); makeSimpleTag (name, AsmKinds, K_DEFINE); } vStringDelete (name); @@ -232,7 +230,6 @@ static const unsigned char *readSymbol ( vStringPut (sym, *cp); ++cp; } - vStringTerminate (sym); } return cp; } @@ -248,7 +245,6 @@ static const unsigned char *readOperator ( vStringPut (operator, *cp); ++cp; } - vStringTerminate (operator); return cp; } Modified: ctags/parsers/basic.c 3 lines changed, 0 insertions(+), 3 deletions(-) =================================================================== @@ -119,7 +119,6 @@ static int extract_dim (char const *pos, vString * name, BasicKind kind) for (; *pos && !isspace (*pos) && *pos != '(' && *pos != ',' && *pos != '='; pos++) vStringPut (name, *pos); - vStringTerminate (name); makeSimpleTag (name, BasicKinds, kind); /* if the line contains a ',', we have multiple declarations */ @@ -141,7 +140,6 @@ static int extract_dim (char const *pos, vString * name, BasicKind kind) vStringClear (name); for (; *pos && !isspace (*pos) && *pos != '(' && *pos != ',' && *pos != '='; pos++) vStringPut (name, *pos); - vStringTerminate (name); makeSimpleTag (name, BasicKinds, kind); } @@ -157,7 +155,6 @@ static char const *extract_name (char const *pos, vString * name) vStringClear (name); for (; *pos && !isspace (*pos) && *pos != '(' && *pos != ',' && *pos != '='; pos++) vStringPut (name, *pos); - vStringTerminate (name); return pos; } Modified: ctags/parsers/c.c 5 lines changed, 0 insertions(+), 5 deletions(-) =================================================================== @@ -1330,7 +1330,6 @@ static const char *getVarType (const statementInfo *const st, vStringPut(vt, ' '); vStringCat(vt, t->name); } - vStringTerminate(vt); return vStringValue(vt); } @@ -1786,7 +1785,6 @@ static void readIdentifier (tokenInfo *const token, const int firstChar) vStringPut (name, c); c = cppGetc (); } while (cppIsident (c) || (isInputLanguage (Lang_vala) && '.' == c)); - vStringTerminate (name); cppUngetc (c); /* unget non-identifier character */ /* Vala supports '?' at end of a type (with or without whitespace before) for nullable types */ @@ -1814,7 +1812,6 @@ static void readPackageName (tokenInfo *const token, const int firstChar) vStringPut (name, c); c = cppGetc (); } - vStringTerminate (name); cppUngetc (c); /* unget non-package character */ } @@ -1913,7 +1910,6 @@ static void readOperator (statementInfo *const st) } c = cppGetc (); } while (! isOneOf (c, "(;") && c != EOF); - vStringTerminate (name); } else if (isOneOf (c, acceptable)) { @@ -1923,7 +1919,6 @@ static void readOperator (statementInfo *const st) vStringPut (name, c); c = cppGetc (); } while (isOneOf (c, acceptable)); - vStringTerminate (name); } cppUngetc (c); Modified: ctags/parsers/conf.c 3 lines changed, 0 insertions(+), 3 deletions(-) =================================================================== @@ -66,11 +66,9 @@ static void findConfTags (void) vStringPut (name, (int) *cp); ++cp; } - vStringTerminate (name); makeSimpleTag (name, ConfKinds, K_SECTION); /* remember section name */ vStringCopy (scope, name); - vStringTerminate (scope); vStringClear (name); continue; } @@ -85,7 +83,6 @@ static void findConfTags (void) vStringPut (name, (int) *cp); ++cp; } - vStringTerminate (name); vStringStripTrailing (name); while (isspace ((int) *cp)) ++cp; Modified: ctags/parsers/css.c 2 lines changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -63,7 +63,6 @@ static void parseSelector (vString *const string, const int firstChar) c = getcFromInputFile (); } while (isSelectorChar (c)); ungetcToInputFile (c); - vStringTerminate (string); } static void readToken (tokenInfo *const token) @@ -224,7 +223,6 @@ static void findCssTags (void) /* we already consumed the next token, don't read it twice */ readNextToken = false; - vStringTerminate (selector); if (CssKinds[kind].enabled) { tagEntryInfo e; Modified: ctags/parsers/diff.c 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -109,7 +109,6 @@ static void findDiffTags (void) tmp++; } - vStringTerminate(filename); makeSimpleTag (filename, DiffKinds, K_FUNCTION); vStringClear (filename); } Modified: ctags/parsers/docbook.c 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -77,7 +77,6 @@ static void createTag(docbookKind kind, const char *buf) vStringPut(name, (int) *buf); ++buf; } while ((*buf != '\0') && (*buf != '"')); - vStringTerminate(name); makeSimpleTag(name, DocBookKinds, kind); } Modified: ctags/parsers/erlang.c 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -69,7 +69,6 @@ static const unsigned char *parseIdentifier ( vStringPut (identifier, (int) *cp); ++cp; } - vStringTerminate (identifier); return cp; } Modified: ctags/parsers/fortran.c 11 lines changed, 0 insertions(+), 11 deletions(-) =================================================================== @@ -601,10 +601,7 @@ static lineType getLineType (void) Assert (type != LTYPE_UNDETERMINED); if (vStringLength (label) > 0) - { - vStringTerminate (label); makeLabelTag (label); - } vStringDelete (label); return type; } @@ -796,7 +793,6 @@ static vString *parseInteger (int c) vStringPut (string, c); c = getChar (); } - vStringTerminate (string); if (c == '_') { @@ -835,8 +831,6 @@ static vString *parseNumeric (int c) else ungetChar (c); - vStringTerminate (string); - return string; } @@ -860,7 +854,6 @@ static void parseString (vString *const string, const int delimiter) else if (! FreeSourceForm) longjmp (Exception, (int) ExceptionFixedFormat); } - vStringTerminate (string); ParsingString = false; } @@ -876,7 +869,6 @@ static void parseIdentifier (vString *const string, const int firstChar) c = getChar (); } while (isident (c)); - vStringTerminate (string); ungetChar (c); /* unget non-identifier character */ } @@ -902,7 +894,6 @@ static void checkForLabel (void) } if (length > 0 && token != NULL) { - vStringTerminate (token->string); makeFortranTag (token, TAG_LABEL); deleteToken (token); } @@ -994,7 +985,6 @@ static void readToken (tokenInfo *const token) c = getChar (); } while (strchr (operatorChars, c) != NULL); ungetChar (c); - vStringTerminate (token->string); token->type = TOKEN_OPERATOR; break; } @@ -1024,7 +1014,6 @@ static void readToken (tokenInfo *const token) if (c == '.') { vStringPut (token->string, c); - vStringTerminate (token->string); token->type = TOKEN_OPERATOR; } else Modified: ctags/parsers/go.c 2 lines changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -191,7 +191,6 @@ static void parseString (vString *const string, const int delimiter) else vStringPut (string, c); } - vStringTerminate (string); } static void parseIdentifier (vString *const string, const int firstChar) @@ -202,7 +201,6 @@ static void parseIdentifier (vString *const string, const int firstChar) vStringPut (string, c); c = getcFromInputFile (); } while (isIdentChar (c)); - vStringTerminate (string); ungetcToInputFile (c); /* always unget, LF might add a semicolon */ } Modified: ctags/parsers/haskell.c 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -104,7 +104,6 @@ static void add_tag(const char *token, haskellKind kind, vString *name) for (i = 0; token[i] != '\0'; ++i) vStringPut(name, token[i]); - vStringTerminate(name); makeSimpleTag(name, HaskellKinds, kind); vStringClear(name); } Modified: ctags/parsers/haxe.c 6 lines changed, 0 insertions(+), 6 deletions(-) =================================================================== @@ -90,7 +90,6 @@ static void findHxTags (void) vStringPut (name, (int) *cp); ++cp; } - vStringTerminate (name); makeSimpleTag (name, HxKinds, HXTAG_VARIABLE); vStringClear (name); @@ -109,7 +108,6 @@ static void findHxTags (void) vStringPut (name, (int) *cp); ++cp; } - vStringTerminate (name); makeSimpleTag (name, HxKinds, HXTAG_METHODS); vStringClear (name); @@ -127,7 +125,6 @@ static void findHxTags (void) vStringPut (name, (int) *cp); ++cp; } - vStringTerminate (name); makeSimpleTag (name, HxKinds, HXTAG_CLASS); vStringCopy(clsName,name); vStringClear (name); @@ -145,7 +142,6 @@ static void findHxTags (void) vStringPut (name, (int) *cp); ++cp; } - vStringTerminate (name); makeSimpleTag (name, HxKinds, HXTAG_ENUM); vStringClear (name); } else if (strncmp ((const char*) cp, "public", (size_t) 6) == 0 && @@ -175,7 +171,6 @@ static void findHxTags (void) vStringPut (name, (int) *cp); ++cp; } - vStringTerminate (name); makeSimpleTag (name, HxKinds, HXTAG_INTERFACE); vStringClear (name); } else if (strncmp ((const char *) cp,"typedef",(size_t) 7) == 0 && isspace(((int) cp[7]))) { @@ -188,7 +183,6 @@ static void findHxTags (void) vStringPut (name, (int) *cp); ++cp; } - vStringTerminate (name); makeSimpleTag (name, HxKinds, HXTAG_TYPEDEF); vStringClear (name); } Modified: ctags/parsers/jscript.c 8 lines changed, 0 insertions(+), 8 deletions(-) =================================================================== @@ -282,7 +282,6 @@ static void makeClassTag (tokenInfo *const token, vString *const signature) { vStringCopy(fulltag, token->string); } - vStringTerminate(fulltag); if ( ! stringListHas(ClassNames, vStringValue (fulltag)) ) { stringListAdd (ClassNames, vStringNewCopy (fulltag)); @@ -309,7 +308,6 @@ static void makeFunctionTag (tokenInfo *const token, vString *const signature) { vStringCopy(fulltag, token->string); } - vStringTerminate(fulltag); if ( ! stringListHas(FunctionNames, vStringValue (fulltag)) ) { stringListAdd (FunctionNames, vStringNewCopy (fulltag)); @@ -362,7 +360,6 @@ static void parseString (vString *const string, const int delimiter) else vStringPut (string, c); } - vStringTerminate (string); } static void parseRegExp (void) @@ -403,7 +400,6 @@ static void parseIdentifier (vString *const string, const int firstChar) vStringPut (string, c); c = getcFromInputFile (); } while (isIdentChar (c)); - vStringTerminate (string); ungetcToInputFile (c); /* unget non-identifier character */ } @@ -708,7 +704,6 @@ static void addContext (tokenInfo* const parent, const tokenInfo* const child) vStringCatS (parent->string, "."); } vStringCatS (parent->string, vStringValue(child->string)); - vStringTerminate(parent->string); } static void addToScope (tokenInfo* const token, vString* const extra) @@ -718,7 +713,6 @@ static void addToScope (tokenInfo* const token, vString* const extra) vStringCatS (token->scope, "."); } vStringCatS (token->scope, vStringValue(extra)); - vStringTerminate(token->scope); } /* @@ -1600,7 +1594,6 @@ static bool parseStatement (tokenInfo *const token, tokenInfo *const parent, boo { vStringCopy(fulltag, token->string); } - vStringTerminate(fulltag); if ( ! stringListHas(FunctionNames, vStringValue (fulltag)) && ! stringListHas(ClassNames, vStringValue (fulltag)) ) { @@ -1691,7 +1684,6 @@ static bool parseStatement (tokenInfo *const token, tokenInfo *const parent, boo { vStringCopy(fulltag, token->string); } - vStringTerminate(fulltag); if ( ! stringListHas(FunctionNames, vStringValue (fulltag)) && ! stringListHas(ClassNames, vStringValue (fulltag)) ) { Modified: ctags/parsers/json.c 3 lines changed, 0 insertions(+), 3 deletions(-) =================================================================== @@ -181,7 +181,6 @@ static void readTokenFull (tokenInfo *const token, if (includeStringRepr) vStringPut (token->string, c); } - vStringTerminate (token->string); break; } @@ -196,7 +195,6 @@ static void readTokenFull (tokenInfo *const token, c = getcFromInputFile (); } while (c != EOF && isIdentChar (c)); - vStringTerminate (token->string); ungetcToInputFile (c); switch (lookupKeyword (vStringValue (token->string), Lang_json)) { @@ -219,7 +217,6 @@ static void pushScope (tokenInfo *const token, if (vStringLength (token->scope) > 0) vStringPut (token->scope, '.'); vStringCat (token->scope, parent->string); - vStringTerminate (token->scope); token->scopeKind = parentKind; } Modified: ctags/parsers/latex.c 3 lines changed, 0 insertions(+), 3 deletions(-) =================================================================== @@ -105,7 +105,6 @@ static void createTag(int flags, TeXKind kind, const char * l) vStringPut(name, (int) *l); ++l; } while ((*l != '\0') && (*l != '}')); - vStringTerminate(name); if (name->buffer[0] != '}') makeSimpleTag(name, TeXKinds, kind); } @@ -116,13 +115,11 @@ static void createTag(int flags, TeXKind kind, const char * l) vStringPut (name, (int) *l); ++l; } while (isalpha((int) *l) || *l == '@'); - vStringTerminate(name); makeSimpleTag(name, TeXKinds, kind); } else { vStringPut(name, (int) *l); - vStringTerminate(name); makeSimpleTag(name, TeXKinds, kind); } Modified: ctags/parsers/lua.c 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -79,7 +79,6 @@ static void extract_name (const char *begin, const char *end, vString *name) { for (cp = begin ; cp != end; cp++) vStringPut (name, (int) *cp); - vStringTerminate (name); makeSimpleTag (name, LuaKinds, K_FUNCTION); vStringClear (name); Modified: ctags/parsers/make.c 2 lines changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -120,7 +120,6 @@ static void readIdentifier (const int first, vString *const id) c = nextChar (); } ungetcToInputFile (c); - vStringTerminate (id); } static void findMakeTags (void) @@ -208,7 +207,6 @@ static void findMakeTags (void) } if (c == '\n') ungetcToInputFile (c); - vStringTerminate (name); vStringStripTrailing (name); newMacro (name); } Modified: ctags/parsers/markdown.c 2 lines changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -75,14 +75,12 @@ static void findMarkdownTags (void) else if (line[0] == '#') { vStringClear(name); vStringCatS(name, (const char *) line); - vStringTerminate(name); makeMarkdownTag(name, false); } else { vStringClear (name); if (! isspace(*line)) vStringCatS(name, (const char*) line); - vStringTerminate(name); } } vStringDelete (name); Modified: ctags/parsers/matlab.c 2 lines changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -107,7 +107,6 @@ static void findMatlabTags (void) } } - vStringTerminate (name); makeSimpleTag (name, MatlabKinds, K_FUNCTION); vStringClear (name); } @@ -129,7 +128,6 @@ static void findMatlabTags (void) ++cp; } - vStringTerminate (name); makeSimpleTag (name, MatlabKinds, K_STRUCT); vStringClear (name); } Modified: ctags/parsers/nsis.c 3 lines changed, 0 insertions(+), 3 deletions(-) =================================================================== @@ -68,7 +68,6 @@ static void findNsisTags (void) vStringPut (name, (int) *cp); ++cp; } - vStringTerminate (name); makeSimpleTag (name, NsisKinds, K_FUNCTION); vStringClear (name); } @@ -94,7 +93,6 @@ static void findNsisTags (void) vStringPut (name, (int) *cp); ++cp; } - vStringTerminate (name); makeSimpleTag (name, NsisKinds, K_VARIABLE); vStringClear (name); } @@ -124,7 +122,6 @@ static void findNsisTags (void) vStringPut (name, (int) *cp); ++cp; } - vStringTerminate (name); makeSimpleTag (name, NsisKinds, K_SECTION); vStringClear (name); } Modified: ctags/parsers/objc.c 4 lines changed, 0 insertions(+), 4 deletions(-) =================================================================== @@ -245,8 +245,6 @@ static void readIdentifier (lexingState * st) vStringPut (st->name, (int) *p); st->cp = p; - - vStringTerminate (st->name); } /* read the @something directives */ @@ -264,8 +262,6 @@ static void readIdentifierObjcDirective (lexingState * st) vStringPut (st->name, (int) *p); st->cp = p; - - vStringTerminate (st->name); } /* The lexer is in charge of reading the file. Modified: ctags/parsers/perl.c 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -304,7 +304,6 @@ static void findPerlTags (void) vStringCatS (name, "STDOUT"); } - vStringTerminate (name); TRACE("name: %s\n", name->buffer); if (0 == vStringLength(name)) { Modified: ctags/parsers/php.c 9 lines changed, 0 insertions(+), 9 deletions(-) =================================================================== @@ -298,7 +298,6 @@ static void initPhpEntry (tagEntryInfo *const e, const tokenInfo *const token, { Assert (parentKind >= 0); - vStringTerminate (fullScope); e->extensionFields.scopeKind = &(PhpKinds[parentKind]); e->extensionFields.scopeName = vStringValue (fullScope); } @@ -475,7 +474,6 @@ static void addToScope (tokenInfo *const token, const vString *const extra) if (vStringLength (token->scope) > 0) vStringCatS (token->scope, SCOPE_SEPARATOR); vStringCatS (token->scope, vStringValue (extra)); - vStringTerminate(token->scope); } static bool isIdentChar (const int c) @@ -496,7 +494,6 @@ static void parseString (vString *const string, const int delimiter) else vStringPut (string, (char) c); } - vStringTerminate (string); } /* reads an HereDoc or a NowDoc (the part after the <<<). @@ -614,8 +611,6 @@ static void parseHeredoc (vString *const string) } while (c != EOF); - vStringTerminate (string); - return; error: @@ -631,7 +626,6 @@ static void parseIdentifier (vString *const string, const int firstChar) c = getcFromInputFile (); } while (isIdentChar (c)); ungetcToInputFile (c); - vStringTerminate (string); } static keywordId analyzeToken (vString *const name, langType language) @@ -1144,8 +1138,6 @@ static bool parseFunction (tokenInfo *const token, const tokenInfo *name) } while (token->type != TOKEN_EOF && depth > 0); - vStringTerminate (arglist); - makeFunctionTag (name, arglist, access, impl); vStringDelete (arglist); @@ -1340,7 +1332,6 @@ static bool parseNamespace (tokenInfo *const token) token->type != TOKEN_SEMICOLON && token->type != TOKEN_OPEN_CURLY); - vStringTerminate (CurrentNamespace); if (vStringLength (CurrentNamespace) > 0) makeNamespacePhpTag (nsToken, CurrentNamespace); Modified: ctags/parsers/powershell.c 6 lines changed, 0 insertions(+), 6 deletions(-) =================================================================== @@ -180,7 +180,6 @@ static void addToScope (tokenInfo *const token, const vString *const extra) if (vStringLength (token->scope) > 0) vStringCatS (token->scope, SCOPE_SEPARATOR); vStringCatS (token->scope, vStringValue (extra)); - vStringTerminate (token->scope); } static bool isIdentChar (const int c) @@ -201,7 +200,6 @@ static void parseString (vString *const string, const int delimiter) else vStringPut (string, (char) c); } - vStringTerminate (string); } static void parseIdentifier (vString *const string, const int firstChar) @@ -213,7 +211,6 @@ static void parseIdentifier (vString *const string, const int firstChar) c = getcFromInputFile (); } while (isIdentChar (c)); ungetcToInputFile (c); - vStringTerminate (string); } static bool isTokenFunction (vString *const name) @@ -388,7 +385,6 @@ static const char *parsePowerShellScope (tokenInfo *const token) powershellScopeLen = (size_t)(powershellScopeEnd - tokenName); /* extract the scope */ vStringNCopyS (powershellScope, tokenName, powershellScopeLen); - vStringTerminate (powershellScope); /* cut the resulting scope string from the identifier */ memmove (token->string->buffer, /* +1 to skip the leading colon */ @@ -488,8 +484,6 @@ static bool parseFunction (tokenInfo *const token) } while (token->type != TOKEN_EOF && depth > 0); - vStringTerminate (arglist); - makeFunctionTag (nameFree, arglist, access); vStringDelete (arglist); Modified: ctags/parsers/python.c 4 lines changed, 0 insertions(+), 4 deletions(-) =================================================================== @@ -286,7 +286,6 @@ static const char *parseIdentifier (const char *cp, vString *const identifier) vStringPut (identifier, (int) *cp); ++cp; } - vStringTerminate (identifier); return cp; } @@ -313,7 +312,6 @@ static void parseClass (const char *cp, vString *const class, vStringPut (inheritance, *cp); ++cp; } - vStringTerminate (inheritance); } makeClassTag (class, inheritance, parent, is_class_parent); vStringDelete (inheritance); @@ -642,7 +640,6 @@ static bool varIsLambda (const char *cp, char **arglist) for (; *cp != 0 && *cp != ':'; cp++) vStringPut (args, *cp); vStringPut (args, ')'); - vStringTerminate (args); if (arglist) *arglist = strdup (vStringValue (args)); vStringDelete (args); @@ -733,7 +730,6 @@ static void findPythonTags (void) vStringPut (name, (int) *start); ++start; } - vStringTerminate (name); parent_is_class = constructParentString(nesting_levels, indent, parent); if (varIsLambda (variable, &arglist)) Modified: ctags/parsers/r.c 2 lines changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -94,7 +94,6 @@ static void createRTags (void) vStringPut(name, (int)*cp); cp++; } - vStringTerminate(name); /* if the string really exists, make a tag of it */ if (vStringLength(name) > 0) @@ -134,7 +133,6 @@ static void createRTags (void) if (strncasecmp((const char*)cp, "function", (size_t)8) == 0) { /* it's a function: ident <- function(args) */ cp += 8; - vStringTerminate(name); /* if the string really exists, make a tag of it */ if (vStringLength(name) > 0) makeRTag(name, K_FUNCTION); Modified: ctags/parsers/rest.c 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -186,7 +186,6 @@ static void findRestTags (void) vStringClear (name); if (! isspace(*line)) vStringCatS(name, (const char*) line); - vStringTerminate(name); } vStringDelete (name); nestingLevelsFree(nestingLevels); Modified: ctags/parsers/ruby.c 2 lines changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -189,7 +189,6 @@ static void emitRubyTag (vString* name, rubyKind kind) return; } - vStringTerminate (name); scope = nestingLevelsToScope (nesting); lvl = nestingLevelsGetCurrent (nesting); if (lvl) @@ -311,7 +310,6 @@ static rubyKind parseIdentifier ( /* Recognize singleton methods. */ if (last_char == '.') { - vStringTerminate (name); vStringClear (name); return parseIdentifier (cp, name, K_SINGLETON); } Modified: ctags/parsers/sh.c 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -80,7 +80,6 @@ static void findShTags (void) vStringPut (name, (int) *cp); ++cp; } - vStringTerminate (name); while (isspace ((int) *cp)) ++cp; if (*cp++ == '(') Modified: ctags/parsers/sql.c 4 lines changed, 0 insertions(+), 4 deletions(-) =================================================================== @@ -477,7 +477,6 @@ static void parseString (vString *const string, const int delimiter) else vStringPut (string, c); } - vStringTerminate (string); } /* Read a C identifier beginning with "firstChar" and places it into "name". @@ -491,7 +490,6 @@ static void parseIdentifier (vString *const string, const int firstChar) vStringPut (string, c); c = getcFromInputFile (); } while (isIdentChar (c)); - vStringTerminate (string); if (!isspace (c)) ungetcToInputFile (c); /* unget non-identifier character */ } @@ -679,7 +677,6 @@ static void readIdentifier (tokenInfo *const token) * vStringCatS (parent->string, "."); * } * vStringCatS (parent->string, vStringValue(child->string)); - * vStringTerminate(parent->string); * } */ @@ -690,7 +687,6 @@ static void addToScope (tokenInfo* const token, vString* const extra, sqlKind ki vStringCatS (token->scope, "."); } vStringCatS (token->scope, vStringValue(extra)); - vStringTerminate(token->scope); token->scopeKind = kind; } Modified: ctags/parsers/tcl.c 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -48,7 +48,6 @@ static const unsigned char *makeTclTag ( vStringPut (name, (int) *cp); ++cp; } - vStringTerminate (name); makeSimpleTag (name, TclKinds, kind); return cp; } Modified: ctags/parsers/txt2tags.c 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -169,7 +169,6 @@ static void findTxt2tagsTags (void) nl = nestingLevelsGetCurrent(nls); } - vStringTerminate(name); makeTxt2tagsTag(name, nls, K_SECTION); nestingLevelsPush(nls, name, K_SECTION); nestingLevelsGetCurrent(nls)->indentation = depth; Modified: ctags/parsers/verilog.c 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -200,7 +200,6 @@ static bool readIdentifier (vString *const name, int c) c = vGetc (); } vUngetc (c); - vStringTerminate (name); } return (bool)(name->length > 0); } Modified: ctags/parsers/vhdl.c 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -167,7 +167,6 @@ static bool readIdentifier (vString *const name, int c) c = vGetc (); } vUngetc (c); - vStringTerminate (name); } return (bool)(name->length > 0); } -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 662765: ctags: Use bool definitions from stdbool.h
by Jiřà Techet
04 Oct '16
04 Oct '16
Branch: refs/heads/master Author: Jiřà Techet <techet(a)gmail.com> Committer: Jiřà Techet <techet(a)gmail.com> Date: Tue, 04 Oct 2016 16:05:54 UTC Commit: 662765852fb2f5ca72de8087646ab8bd6d82c889
https://github.com/geany/geany/commit/662765852fb2f5ca72de8087646ab8bd6d82c…
Log Message: ----------- ctags: Use bool definitions from stdbool.h Since Geany requires C99 parser, the patch just simply includes stdbool.h in general.h and drops the TRUE, FALSE definitions inside the same file. The rest is purely mechanical boolean -> bool TRUE -> true FALSE -> false plus some alignment fixes. This patch corresponds to universal-ctags commit ce990805a0a0269c. Modified Paths: -------------- ctags/main/args.c ctags/main/args.h ctags/main/entry.c ctags/main/entry.h ctags/main/general.h ctags/main/keyword.c ctags/main/kind.h ctags/main/lcpp.c ctags/main/lcpp.h ctags/main/lregex.c ctags/main/main.c ctags/main/main.h ctags/main/mio.c ctags/main/mio.h ctags/main/options.c ctags/main/options.h ctags/main/parse.c ctags/main/parse.h ctags/main/read.c ctags/main/read.h ctags/main/routines.c ctags/main/routines.h ctags/main/sort.c ctags/main/sort.h ctags/main/strlist.c ctags/main/strlist.h ctags/main/vstring.c ctags/main/vstring.h ctags/main/xtag.c ctags/main/xtag.h ctags/parsers/abaqus.c ctags/parsers/abc.c ctags/parsers/asciidoc.c ctags/parsers/asm.c ctags/parsers/basic.c ctags/parsers/c.c ctags/parsers/conf.c ctags/parsers/css.c ctags/parsers/diff.c ctags/parsers/docbook.c ctags/parsers/erlang.c ctags/parsers/fortran.c ctags/parsers/go.c ctags/parsers/haskell.c ctags/parsers/haxe.c ctags/parsers/jscript.c ctags/parsers/json.c ctags/parsers/latex.c ctags/parsers/lua.c ctags/parsers/make.c ctags/parsers/markdown.c ctags/parsers/matlab.c ctags/parsers/nsis.c ctags/parsers/objc.c ctags/parsers/pascal.c ctags/parsers/perl.c ctags/parsers/php.c ctags/parsers/powershell.c ctags/parsers/python.c ctags/parsers/r.c ctags/parsers/rest.c ctags/parsers/ruby.c ctags/parsers/rust.c ctags/parsers/sh.c ctags/parsers/sql.c ctags/parsers/tcl.c ctags/parsers/txt2tags.c ctags/parsers/verilog.c ctags/parsers/vhdl.c Modified: ctags/main/args.c 10 lines changed, 5 insertions(+), 5 deletions(-) =================================================================== @@ -186,7 +186,7 @@ extern Arguments* argNewFromLineFile (FILE* const fp) Arguments* result = xMalloc (1, Arguments); memset (result, 0, sizeof (Arguments)); result->type = ARG_FILE; - result->lineMode = TRUE; + result->lineMode = true; result->u.fileArgs.fp = fp; result->item = nextFileString (result, result->u.fileArgs.fp); return result; @@ -199,22 +199,22 @@ extern char *argItem (const Arguments* const current) return current->item; } -extern boolean argOff (const Arguments* const current) +extern bool argOff (const Arguments* const current) { Assert (current != NULL); - return (boolean) (current->item == NULL); + return (bool) (current->item == NULL); } extern void argSetWordMode (Arguments* const current) { Assert (current != NULL); - current->lineMode = FALSE; + current->lineMode = false; } extern void argSetLineMode (Arguments* const current) { Assert (current != NULL); - current->lineMode = TRUE; + current->lineMode = true; } extern void argForth (Arguments* const current) Modified: ctags/main/args.h 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -37,7 +37,7 @@ typedef struct sArgs { } fileArgs; } u; char* item; - boolean lineMode; + bool lineMode; } Arguments; /* @@ -48,7 +48,7 @@ extern Arguments* argNewFromArgv (char* const* const argv); extern Arguments* argNewFromFile (FILE* const fp); extern Arguments* argNewFromLineFile (FILE* const fp); extern char *argItem (const Arguments* const current); -extern boolean argOff (const Arguments* const current); +extern bool argOff (const Arguments* const current); extern void argSetWordMode (Arguments* const current); extern void argSetLineMode (Arguments* const current); extern void argForth (Arguments* const current); Modified: ctags/main/entry.c 14 lines changed, 7 insertions(+), 7 deletions(-) =================================================================== @@ -82,7 +82,7 @@ tagFile TagFile = { NULL /* vLine */ }; -static boolean TagsToStdout = FALSE; +static bool TagsToStdout = false; /* * FUNCTION PROTOTYPES @@ -244,19 +244,19 @@ static long unsigned int updatePseudoTags (MIO *const mio) -static boolean isTagFile (const char *const filename) +static bool isTagFile (const char *const filename) { - boolean ok = FALSE; /* we assume not unless confirmed */ + bool ok = false; /* we assume not unless confirmed */ MIO *const mio = mio_new_file_full (filename, "rb", g_fopen, fclose); if (mio == NULL && errno == ENOENT) - ok = TRUE; + ok = true; else if (mio != NULL) { const char *line = readLineRaw (TagFile.vLine, mio); if (line == NULL) - ok = TRUE; + ok = true; mio_free (mio); } return ok; @@ -281,7 +281,7 @@ extern void openTagFile (void) } else { - boolean fileExists; + bool fileExists; setDefaultTagFileName (); TagFile.name = eStrdup (Option.tagFileName); @@ -404,7 +404,7 @@ extern void initTagEntry (tagEntryInfo *const e, const char *const name, const k { Assert (File.source.name != NULL); memset (e, 0, sizeof (tagEntryInfo)); - e->lineNumberEntry = (boolean) (Option.locate == EX_LINENUM); + e->lineNumberEntry = (bool) (Option.locate == EX_LINENUM); e->lineNumber = getSourceLineNumber (); e->language = getSourceLanguageName (); e->filePosition = getInputFilePosition (); Modified: ctags/main/entry.h 10 lines changed, 5 insertions(+), 5 deletions(-) =================================================================== @@ -52,13 +52,13 @@ typedef struct sTagFields { /* Information about the current tag candidate. */ typedef struct sTagEntryInfo { - boolean lineNumberEntry;/* pattern or line number entry */ + bool lineNumberEntry; /* pattern or line number entry */ unsigned long lineNumber; /* line number of tag */ MIOPos filePosition; /* file position of line containing tag */ const char* language; /* language of source file */ - boolean isFileScope; /* is tag visible only within source file? */ - boolean isFileEntry; /* is this just an entry for a file name? */ - boolean truncateLine; /* truncate tag line at end of tag name? */ + bool isFileScope; /* is tag visible only within source file? */ + bool isFileEntry; /* is this just an entry for a file name? */ + bool truncateLine; /* truncate tag line at end of tag name? */ const char *sourceFileName; /* name of source file */ const char *name; /* name of the tag */ const kindOption *kind; /* kind descriptor */ @@ -89,7 +89,7 @@ extern const char *tagFileName (void); extern void copyBytes (MIO* const fromMio, MIO* const toMio, const long size); extern void copyFile (const char *const from, const char *const to, const long size); extern void openTagFile (void); -extern void closeTagFile (const boolean resize); +extern void closeTagFile (const bool resize); extern void beginEtagsFile (void); extern void endEtagsFile (const char *const name); extern void makeTagEntry (const tagEntryInfo *const tag); Modified: ctags/main/general.h 12 lines changed, 2 insertions(+), 10 deletions(-) =================================================================== @@ -22,6 +22,8 @@ /* include unistd.h preventively because at least under MacOSX it is needed for off_t */ #include <unistd.h> +#include <stdbool.h> + /* * MACROS */ @@ -115,16 +117,6 @@ void utils_warn(const char *msg); * DATA DECLARATIONS */ -#undef FALSE -#undef TRUE -#ifdef __cplusplus -typedef bool boolean; -#define FALSE false -#define TRUE true -#else -typedef enum { FALSE, TRUE } boolean; -#endif - #if ! defined (HAVE_FGETPOS) && ! defined (fpos_t) # define fpos_t long #endif Modified: ctags/main/keyword.c 8 lines changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -42,7 +42,7 @@ static hashEntry **HashTable = NULL; static hashEntry **getHashTable (void) { - static boolean allocated = FALSE; + static bool allocated = false; if (! allocated) { @@ -53,7 +53,7 @@ static hashEntry **getHashTable (void) for (i = 0 ; i < TableSize ; ++i) HashTable [i] = NULL; - allocated = TRUE; + allocated = true; } return HashTable; } @@ -187,7 +187,7 @@ static unsigned int printBucket (const unsigned int i) hashEntry **const table = getHashTable (); hashEntry *entry = table [i]; unsigned int measure = 1; - boolean first = TRUE; + bool first = true; printf ("%2d:", i); if (entry == NULL) @@ -199,7 +199,7 @@ static unsigned int printBucket (const unsigned int i) else { printf (" "); - first = FALSE; + first = false; } printEntry (entry); entry = entry->next; Modified: ctags/main/kind.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -18,7 +18,7 @@ #define KIND_FILE_DEFAULT_LONG "file" typedef struct sKindOption { - boolean enabled; /* are tags for kind enabled? */ + bool enabled; /* are tags for kind enabled? */ char letter; /* kind letter */ const char* name; /* kind name */ const char* description; /* displayed in --help output */ Modified: ctags/main/lcpp.c 146 lines changed, 73 insertions(+), 73 deletions(-) =================================================================== @@ -43,10 +43,10 @@ enum eCppLimits { /* Defines the one nesting level of a preprocessor conditional. */ typedef struct sConditionalInfo { - boolean ignoreAllBranches; /* ignoring parent conditional branch */ - boolean singleBranch; /* choose only one branch */ - boolean branchChosen; /* branch already selected */ - boolean ignoring; /* current ignore state */ + bool ignoreAllBranches; /* ignoring parent conditional branch */ + bool singleBranch; /* choose only one branch */ + bool branchChosen; /* branch already selected */ + bool ignoring; /* current ignore state */ } conditionalInfo; enum eState { @@ -62,13 +62,13 @@ enum eState { */ typedef struct sCppState { int ungetch, ungetch2; /* ungotten characters, if any */ - boolean resolveRequired; /* must resolve if/else/elif/endif branch */ - boolean hasAtLiteralStrings; /* supports @"c:\" strings */ - boolean hasCxxRawLiteralStrings; /* supports R"xxx(...)xxx" strings */ + bool resolveRequired; /* must resolve if/else/elif/endif branch */ + bool hasAtLiteralStrings; /* supports @"c:\" strings */ + bool hasCxxRawLiteralStrings; /* supports R"xxx(...)xxx" strings */ const kindOption *defineMacroKind; struct sDirective { enum eState state; /* current directive being processed */ - boolean accept; /* is a directive syntactically permitted? */ + bool accept; /* is a directive syntactically permitted? */ vString * name; /* macro name */ unsigned int nestLevel; /* level 0 is not used */ conditionalInfo ifdef [MaxCppNestingLevel]; @@ -81,28 +81,28 @@ typedef struct sCppState { /* Use brace formatting to detect end of block. */ -static boolean BraceFormat = FALSE; +static bool BraceFormat = false; static cppState Cpp = { '\0', '\0', /* ungetch characters */ - FALSE, /* resolveRequired */ - FALSE, /* hasAtLiteralStrings */ - FALSE, /* hasCxxRawLiteralStrings */ + false, /* resolveRequired */ + false, /* hasAtLiteralStrings */ + false, /* hasCxxRawLiteralStrings */ NULL, /* defineMacroKind */ { DRCTV_NONE, /* state */ - FALSE, /* accept */ + false, /* accept */ NULL, /* tag name */ 0, /* nestLevel */ - { {FALSE,FALSE,FALSE,FALSE} } /* ifdef array */ + { {false,false,false,false} } /* ifdef array */ } /* directive */ }; /* * FUNCTION DEFINITIONS */ -extern boolean cppIsBraceFormat (void) +extern bool cppIsBraceFormat (void) { return BraceFormat; } @@ -112,27 +112,27 @@ extern unsigned int cppGetDirectiveNestLevel (void) return Cpp.directive.nestLevel; } -extern void cppInit (const boolean state, const boolean hasAtLiteralStrings, - const boolean hasCxxRawLiteralStrings, +extern void cppInit (const bool state, const bool hasAtLiteralStrings, + const bool hasCxxRawLiteralStrings, const kindOption *defineMacroKind) { BraceFormat = state; Cpp.ungetch = '\0'; Cpp.ungetch2 = '\0'; - Cpp.resolveRequired = FALSE; + Cpp.resolveRequired = false; Cpp.hasAtLiteralStrings = hasAtLiteralStrings; Cpp.hasCxxRawLiteralStrings = hasCxxRawLiteralStrings; Cpp.defineMacroKind = defineMacroKind; Cpp.directive.state = DRCTV_NONE; - Cpp.directive.accept = TRUE; + Cpp.directive.accept = true; Cpp.directive.nestLevel = 0; - Cpp.directive.ifdef [0].ignoreAllBranches = FALSE; - Cpp.directive.ifdef [0].singleBranch = FALSE; - Cpp.directive.ifdef [0].branchChosen = FALSE; - Cpp.directive.ifdef [0].ignoring = FALSE; + Cpp.directive.ifdef [0].ignoreAllBranches = false; + Cpp.directive.ifdef [0].singleBranch = false; + Cpp.directive.ifdef [0].branchChosen = false; + Cpp.directive.ifdef [0].ignoring = false; if (Cpp.directive.name == NULL) Cpp.directive.name = vStringNew (); @@ -151,12 +151,12 @@ extern void cppTerminate (void) extern void cppBeginStatement (void) { - Cpp.resolveRequired = TRUE; + Cpp.resolveRequired = true; } extern void cppEndStatement (void) { - Cpp.resolveRequired = FALSE; + Cpp.resolveRequired = false; } /* @@ -178,7 +178,7 @@ extern void cppUngetc (const int c) /* Reads a directive, whose first character is given by "c", into "name". */ -static boolean readDirective (int c, char *const name, unsigned int maxLength) +static bool readDirective (int c, char *const name, unsigned int maxLength) { unsigned int i; @@ -197,7 +197,7 @@ static boolean readDirective (int c, char *const name, unsigned int maxLength) } name [i] = '\0'; /* null terminate */ - return (boolean) isspacetab (c); + return (bool) isspacetab (c); } /* Reads an identifier, whose first character is given by "c", into "tag", @@ -220,17 +220,17 @@ static conditionalInfo *currentConditional (void) return &Cpp.directive.ifdef [Cpp.directive.nestLevel]; } -static boolean isIgnore (void) +static bool isIgnore (void) { return Cpp.directive.ifdef [Cpp.directive.nestLevel].ignoring; } -static boolean setIgnore (const boolean ignore) +static bool setIgnore (const bool ignore) { return Cpp.directive.ifdef [Cpp.directive.nestLevel].ignoring = ignore; } -static boolean isIgnoreBranch (void) +static bool isIgnoreBranch (void) { conditionalInfo *const ifdef = currentConditional (); @@ -239,7 +239,7 @@ static boolean isIgnoreBranch (void) * statements to be followed, but we must follow no further branches. */ if (Cpp.resolveRequired && ! BraceFormat) - ifdef->singleBranch = TRUE; + ifdef->singleBranch = true; /* We will ignore this branch in the following cases: * @@ -249,7 +249,7 @@ static boolean isIgnoreBranch (void) * a. A statement was incomplete upon entering the conditional * b. A statement is incomplete upon encountering a branch */ - return (boolean) (ifdef->ignoreAllBranches || + return (bool) (ifdef->ignoreAllBranches || (ifdef->branchChosen && ifdef->singleBranch)); } @@ -259,18 +259,18 @@ static void chooseBranch (void) { conditionalInfo *const ifdef = currentConditional (); - ifdef->branchChosen = (boolean) (ifdef->singleBranch || + ifdef->branchChosen = (bool) (ifdef->singleBranch || Cpp.resolveRequired); } } /* Pushes one nesting level for an #if directive, indicating whether or not * the branch should be ignored and whether a branch has already been chosen. */ -static boolean pushConditional (const boolean firstBranchChosen) +static bool pushConditional (const bool firstBranchChosen) { - const boolean ignoreAllBranches = isIgnore (); /* current ignore */ - boolean ignoreBranch = FALSE; + const bool ignoreAllBranches = isIgnore (); /* current ignore */ + bool ignoreBranch = false; if (Cpp.directive.nestLevel < (unsigned int) MaxCppNestingLevel - 1) { @@ -287,7 +287,7 @@ static boolean pushConditional (const boolean firstBranchChosen) ifdef->ignoreAllBranches = ignoreAllBranches; ifdef->singleBranch = Cpp.resolveRequired; ifdef->branchChosen = firstBranchChosen; - ifdef->ignoring = (boolean) (ignoreAllBranches || ( + ifdef->ignoring = (bool) (ignoreAllBranches || ( ! firstBranchChosen && ! BraceFormat && (ifdef->singleBranch || !Option.if0))); ignoreBranch = ifdef->ignoring; @@ -297,17 +297,17 @@ static boolean pushConditional (const boolean firstBranchChosen) /* Pops one nesting level for an #endif directive. */ -static boolean popConditional (void) +static bool popConditional (void) { if (Cpp.directive.nestLevel > 0) --Cpp.directive.nestLevel; return isIgnore (); } -static void makeDefineTag (const char *const name, boolean parameterized) +static void makeDefineTag (const char *const name, bool parameterized) { - const boolean isFileScope = (boolean) (! isInputHeaderFile ()); + const bool isFileScope = (bool) (! isInputHeaderFile ()); if (includingDefineTags () && (! isFileScope || Option.include.fileScope)) @@ -316,9 +316,9 @@ static void makeDefineTag (const char *const name, boolean parameterized) initTagEntry (&e, name, Cpp.defineMacroKind); - e.lineNumberEntry = (boolean) (Option.locate != EX_PATTERN); + e.lineNumberEntry = (bool) (Option.locate != EX_PATTERN); e.isFileScope = isFileScope; - e.truncateLine = TRUE; + e.truncateLine = true; if (parameterized) { e.extensionFields.signature = cppGetArglistFromFilePos(getInputFilePosition() @@ -332,15 +332,15 @@ static void makeDefineTag (const char *const name, boolean parameterized) static void directiveDefine (const int c) { - boolean parameterized; + bool parameterized; int nc; if (cppIsident1 (c)) { readIdentifier (c, Cpp.directive.name); nc = getcFromInputFile (); ungetcToInputFile (nc); - parameterized = (boolean) (nc == '('); + parameterized = (bool) (nc == '('); if (! isIgnore ()) makeDefineTag (vStringValue (Cpp.directive.name), parameterized); } @@ -362,27 +362,27 @@ static void directivePragma (int c) if (cppIsident1 (c)) { readIdentifier (c, Cpp.directive.name); - makeDefineTag (vStringValue (Cpp.directive.name), FALSE); + makeDefineTag (vStringValue (Cpp.directive.name), false); } } } Cpp.directive.state = DRCTV_NONE; } -static boolean directiveIf (const int c) +static bool directiveIf (const int c) { - const boolean ignore = pushConditional ((boolean) (c != '0')); + const bool ignore = pushConditional ((bool) (c != '0')); Cpp.directive.state = DRCTV_NONE; return ignore; } -static boolean directiveHash (const int c) +static bool directiveHash (const int c) { - boolean ignore = FALSE; + bool ignore = false; char directive [MaxDirectiveName]; - DebugStatement ( const boolean ignore0 = isIgnore (); ) + DebugStatement ( const bool ignore0 = isIgnore (); ) readDirective (c, directive, MaxDirectiveName); if (stringMatch (directive, "define")) @@ -402,7 +402,7 @@ static boolean directiveHash (const int c) } else if (stringMatch (directive, "endif")) { - DebugStatement ( debugCppNest (FALSE, Cpp.directive.nestLevel); ) + DebugStatement ( debugCppNest (false, Cpp.directive.nestLevel); ) ignore = popConditional (); Cpp.directive.state = DRCTV_NONE; DebugStatement ( if (ignore != ignore0) debugCppIgnore (ignore); ) @@ -417,9 +417,9 @@ static boolean directiveHash (const int c) /* Handles a pre-processor directive whose first character is given by "c". */ -static boolean handleDirective (const int c) +static bool handleDirective (const int c) { - boolean ignore = isIgnore (); + bool ignore = isIgnore (); switch (Cpp.directive.state) { @@ -528,7 +528,7 @@ static int skipOverDComment (void) /* Skips to the end of a string, returning a special character to * symbolically represent a generic string. */ -static int skipToEndOfString (boolean ignoreBackslash) +static int skipToEndOfString (bool ignoreBackslash) { int c; @@ -555,13 +555,13 @@ static int skipToEndOfCxxRawLiteralString (void) if (c != '(' && ! isCxxRawLiteralDelimiterChar (c)) { ungetcToInputFile (c); - c = skipToEndOfString (FALSE); + c = skipToEndOfString (false); } else { char delim[16]; unsigned int delimLen = 0; - boolean collectDelim = TRUE; + bool collectDelim = true; do { @@ -571,7 +571,7 @@ static int skipToEndOfCxxRawLiteralString (void) delimLen < (sizeof delim / sizeof *delim)) delim[delimLen++] = c; else - collectDelim = FALSE; + collectDelim = false; } else if (c == ')') { @@ -630,8 +630,8 @@ static int skipToEndOfChar (void) */ extern int cppGetc (void) { - boolean directive = FALSE; - boolean ignore = FALSE; + bool directive = false; + bool ignore = false; int c; if (Cpp.ungetch != '\0') @@ -648,8 +648,8 @@ extern int cppGetc (void) switch (c) { case EOF: - ignore = FALSE; - directive = FALSE; + ignore = false; + directive = false; break; case TAB: @@ -658,26 +658,26 @@ extern int cppGetc (void) case NEWLINE: if (directive && ! ignore) - directive = FALSE; - Cpp.directive.accept = TRUE; + directive = false; + Cpp.directive.accept = true; break; case DOUBLE_QUOTE: - Cpp.directive.accept = FALSE; - c = skipToEndOfString (FALSE); + Cpp.directive.accept = false; + c = skipToEndOfString (false); break; case '#': if (Cpp.directive.accept) { - directive = TRUE; + directive = true; Cpp.directive.state = DRCTV_HASH; - Cpp.directive.accept = FALSE; + Cpp.directive.accept = false; } break; case SINGLE_QUOTE: - Cpp.directive.accept = FALSE; + Cpp.directive.accept = false; c = skipToEndOfChar (); break; @@ -696,7 +696,7 @@ extern int cppGetc (void) else if (comment == COMMENT_D) c = skipOverDComment (); else - Cpp.directive.accept = FALSE; + Cpp.directive.accept = false; break; } @@ -780,8 +780,8 @@ extern int cppGetc (void) int next = getcFromInputFile (); if (next == DOUBLE_QUOTE) { - Cpp.directive.accept = FALSE; - c = skipToEndOfString (TRUE); + Cpp.directive.accept = false; + c = skipToEndOfString (true); break; } else @@ -819,14 +819,14 @@ extern int cppGetc (void) ungetcToInputFile (next); else { - Cpp.directive.accept = FALSE; + Cpp.directive.accept = false; c = skipToEndOfCxxRawLiteralString (); break; } } } enter: - Cpp.directive.accept = FALSE; + Cpp.directive.accept = false; if (directive) ignore = handleDirective (c); break; Modified: ctags/main/lcpp.h 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -34,11 +34,11 @@ /* * FUNCTION PROTOTYPES */ -extern boolean cppIsBraceFormat (void); +extern bool cppIsBraceFormat (void); extern unsigned int cppGetDirectiveNestLevel (void); -extern void cppInit (const boolean state, const boolean hasAtLiteralStrings, - const boolean hasCxxRawLiteralStrings, +extern void cppInit (const bool state, const bool hasAtLiteralStrings, + const bool hasCxxRawLiteralStrings, const kindOption *defineMacroKind); extern void cppTerminate (void); extern void cppBeginStatement (void); Modified: ctags/main/lregex.c 50 lines changed, 25 insertions(+), 25 deletions(-) =================================================================== @@ -81,7 +81,7 @@ typedef struct { * DATA DEFINITIONS */ -static boolean regexBroken = FALSE; +static bool regexBroken = false; /* Array of pattern sets, indexed by language */ static patternSet* Sets = NULL; @@ -156,7 +156,7 @@ static char* scanSeparators (char* name) { char sep = name [0]; char *copyto = name; - boolean quoted = FALSE; + bool quoted = false; for (++name ; *name != '\0' ; ++name) { @@ -172,10 +172,10 @@ static char* scanSeparators (char* name) *copyto++ = '\\'; *copyto++ = *name; } - quoted = FALSE; + quoted = false; } else if (*name == '\\') - quoted = TRUE; + quoted = true; else if (*name == sep) { break; @@ -196,11 +196,11 @@ static char* scanSeparators (char* name) * to the trailing flags is written to `flags'. If the pattern is not in the * correct format, a false value is returned. */ -static boolean parseTagRegex ( +static bool parseTagRegex ( char* const regexp, char** const name, char** const kinds, char** const flags) { - boolean result = FALSE; + bool result = false; const int separator = (unsigned char) regexp [0]; *name = scanSeparators (regexp); @@ -231,7 +231,7 @@ static boolean parseTagRegex ( *flags = third; *kinds = NULL; } - result = TRUE; + result = true; } } return result; @@ -263,7 +263,7 @@ static void addCompiledTagPattern ( ptrn->pattern = pattern; ptrn->type = PTRN_TAG; ptrn->u.tag.name_pattern = name; - ptrn->u.tag.kind.enabled = TRUE; + ptrn->u.tag.kind.enabled = true; ptrn->u.tag.kind.letter = kind; ptrn->u.tag.kind.name = kindName; ptrn->u.tag.kind.description = description; @@ -366,7 +366,7 @@ static void parseKinds ( } } -static void printRegexKind (const regexPattern *pat, unsigned int i, boolean indent) +static void printRegexKind (const regexPattern *pat, unsigned int i, bool indent) { const kindOption *const kind = &pat [i].u.tag.kind; const char *const indentation = indent ? " " : ""; @@ -477,22 +477,22 @@ static void matchCallbackPattern ( patbuf->u.callback.function (vStringValue (line), matches, count); } -static boolean matchRegexPattern (const vString* const line, +static bool matchRegexPattern (const vString* const line, const regexPattern* const patbuf) { - boolean result = FALSE; + bool result = false; GMatchInfo *minfo; if (g_regex_match(patbuf->pattern, vStringValue(line), 0, &minfo)) { - result = TRUE; + result = true; if (patbuf->type == PTRN_TAG) matchTagPattern (line, patbuf, minfo); else if (patbuf->type == PTRN_CALLBACK) matchCallbackPattern (line, patbuf, minfo); else { Assert ("invalid pattern type" == NULL); - result = FALSE; + result = false; } } g_match_info_free(minfo); @@ -506,17 +506,17 @@ static boolean matchRegexPattern (const vString* const line, /* Match against all patterns for specified language. Returns true if at least * on pattern matched. */ -extern boolean matchRegex (const vString* const line, const langType language) +extern bool matchRegex (const vString* const line, const langType language) { - boolean result = FALSE; + bool result = false; if (language != LANG_IGNORE && language <= SetUpper && Sets [language].count > 0) { const patternSet* const set = Sets + language; unsigned int i; for (i = 0 ; i < set->count ; ++i) if (matchRegexPattern (line, set->patterns + i)) - result = TRUE; + result = true; } return result; } @@ -594,10 +594,10 @@ extern void addLanguageRegex ( * Regex option parsing */ -extern boolean processRegexOption (const char *const option, +extern bool processRegexOption (const char *const option, const char *const parameter CTAGS_ATTR_UNUSED) { - boolean handled = FALSE; + bool handled = false; const char* const dash = strchr (option, '-'); if (dash != NULL && strncmp (option, "regex", dash - option) == 0) { @@ -612,7 +612,7 @@ extern boolean processRegexOption (const char *const option, printf ("regex: regex support not available; required for --%s option\n", option); #endif - handled = TRUE; + handled = true; } return handled; } @@ -626,16 +626,16 @@ extern void disableRegexKinds (const langType language CTAGS_ATTR_UNUSED) unsigned int i; for (i = 0 ; i < set->count ; ++i) if (set->patterns [i].type == PTRN_TAG) - set->patterns [i].u.tag.kind.enabled = FALSE; + set->patterns [i].u.tag.kind.enabled = false; } #endif } -extern boolean enableRegexKind ( +extern bool enableRegexKind ( const langType language CTAGS_ATTR_UNUSED, - const int kind CTAGS_ATTR_UNUSED, const boolean mode CTAGS_ATTR_UNUSED) + const int kind CTAGS_ATTR_UNUSED, const bool mode CTAGS_ATTR_UNUSED) { - boolean result = FALSE; + bool result = false; #ifdef HAVE_REGEX if (language <= SetUpper && Sets [language].count > 0) { @@ -646,14 +646,14 @@ extern boolean enableRegexKind ( set->patterns [i].u.tag.kind.letter == kind) { set->patterns [i].u.tag.kind.enabled = mode; - result = TRUE; + result = true; } } #endif return result; } -extern void printRegexKinds (const langType language CTAGS_ATTR_UNUSED, boolean indent CTAGS_ATTR_UNUSED) +extern void printRegexKinds (const langType language CTAGS_ATTR_UNUSED, bool indent CTAGS_ATTR_UNUSED) { #ifdef HAVE_REGEX if (language <= SetUpper && Sets [language].count > 0) Modified: ctags/main/main.c 7 lines changed, 3 insertions(+), 4 deletions(-) =================================================================== @@ -46,7 +46,6 @@ # include <sys/types.h> /* required by dirent.h */ # endif # include <dirent.h> /* to declare opendir() */ -# undef boolean #endif #ifdef HAVE_DIRECT_H # include <direct.h> /* to _getcwd() */ @@ -91,15 +90,15 @@ extern void addTotals ( Totals.bytes += bytes; } -extern boolean isDestinationStdout (void) +extern bool isDestinationStdout (void) { - boolean toStdout = FALSE; + bool toStdout = false; if (Option.xref || Option.filter || (Option.tagFileName != NULL && (strcmp (Option.tagFileName, "-") == 0 || strcmp (Option.tagFileName, "/dev/stdout") == 0 ))) - toStdout = TRUE; + toStdout = true; return toStdout; } Modified: ctags/main/main.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -20,7 +20,7 @@ * FUNCTION PROTOTYPES */ extern void addTotals (const unsigned int files, const long unsigned int lines, const long unsigned int bytes); -extern boolean isDestinationStdout (void); +extern bool isDestinationStdout (void); extern int main (int argc, char **argv); #endif /* CTAGS_MAIN_MAIN_H */ Modified: ctags/main/mio.c 44 lines changed, 22 insertions(+), 22 deletions(-) =================================================================== @@ -225,8 +225,8 @@ MIO *mio_new_memory (unsigned char *data, mio->impl.mem.allocated_size = size; mio->impl.mem.realloc_func = realloc_func; mio->impl.mem.free_func = free_func; - mio->impl.mem.eof = FALSE; - mio->impl.mem.error = FALSE; + mio->impl.mem.eof = false; + mio->impl.mem.error = false; } return mio; @@ -315,8 +315,8 @@ int mio_free (MIO *mio) mio->impl.mem.allocated_size = 0; mio->impl.mem.realloc_func = NULL; mio->impl.mem.free_func = NULL; - mio->impl.mem.eof = FALSE; - mio->impl.mem.error = FALSE; + mio->impl.mem.eof = false; + mio->impl.mem.error = false; } free (mio); @@ -377,7 +377,7 @@ size_t mio_read (MIO *mio, mio->impl.mem.pos += copy_bytes; } if (mio->impl.mem.pos >= mio->impl.mem.size) - mio->impl.mem.eof = TRUE; + mio->impl.mem.eof = true; } return n_read; @@ -392,11 +392,11 @@ size_t mio_read (MIO *mio, * Tries to resize the underlying buffer of an in-memory #MIO object. * This supports both growing and shrinking. * - * Returns: %TRUE on success, %FALSE otherwise. + * Returns: %true on success, %false otherwise. */ static int mem_try_resize (MIO *mio, size_t new_size) { - int success = FALSE; + int success = false; if (mio->impl.mem.realloc_func) { @@ -413,7 +413,7 @@ static int mem_try_resize (MIO *mio, size_t new_size) if (new_size <= mio->impl.mem.allocated_size) { mio->impl.mem.size = new_size; - success = TRUE; + success = true; } else { @@ -428,7 +428,7 @@ static int mem_try_resize (MIO *mio, size_t new_size) mio->impl.mem.buf = newbuf; mio->impl.mem.allocated_size = newsize; mio->impl.mem.size = new_size; - success = TRUE; + success = true; } } } @@ -442,7 +442,7 @@ static int mem_try_resize (MIO *mio, size_t new_size) mio->impl.mem.buf = newbuf; mio->impl.mem.allocated_size = new_size; mio->impl.mem.size = new_size; - success = TRUE; + success = true; } } } @@ -459,11 +459,11 @@ static int mem_try_resize (MIO *mio, size_t new_size) * Tries to ensure there is enough space for @n bytes to be written from the * current cursor position. * - * Returns: %TRUE if there is enough space, %FALSE otherwise. + * Returns: %true if there is enough space, %false otherwise. */ static int mem_try_ensure_space (MIO *mio, size_t n) { - int success = TRUE; + int success = true; if (mio->impl.mem.pos + n > mio->impl.mem.size) success = mem_try_resize (mio, mio->impl.mem.pos + n); @@ -678,7 +678,7 @@ int mio_getc (MIO *mio) mio->impl.mem.pos++; } else - mio->impl.mem.eof = TRUE; + mio->impl.mem.eof = true; return rv; } @@ -712,7 +712,7 @@ int mio_ungetc (MIO *mio, int ch) { rv = mio->impl.mem.ungetch = ch; mio->impl.mem.pos--; - mio->impl.mem.eof = FALSE; + mio->impl.mem.eof = false; } return rv; @@ -766,7 +766,7 @@ char *mio_gets (MIO *mio, char *s, size_t size) rv = s; } if (mio->impl.mem.pos >= mio->impl.mem.size) - mio->impl.mem.eof = TRUE; + mio->impl.mem.eof = true; } return rv; @@ -786,8 +786,8 @@ void mio_clearerr (MIO *mio) clearerr (mio->impl.file.fp); else { - mio->impl.mem.error = FALSE; - mio->impl.mem.eof = FALSE; + mio->impl.mem.error = false; + mio->impl.mem.eof = false; } } @@ -805,7 +805,7 @@ int mio_eof (MIO *mio) if (mio->type == MIO_TYPE_FILE) return feof (mio->impl.file.fp); else - return mio->impl.mem.eof != FALSE; + return mio->impl.mem.eof != false; } /** @@ -822,7 +822,7 @@ int mio_error (MIO *mio) if (mio->type == MIO_TYPE_FILE) return ferror (mio->impl.file.fp); else - return mio->impl.mem.error != FALSE; + return mio->impl.mem.error != false; } /** @@ -888,7 +888,7 @@ int mio_seek (MIO *mio, long offset, int whence) } if (rv == 0) { - mio->impl.mem.eof = FALSE; + mio->impl.mem.eof = false; mio->impl.mem.ungetch = EOF; } @@ -943,8 +943,8 @@ void mio_rewind (MIO *mio) { mio->impl.mem.pos = 0; mio->impl.mem.ungetch = EOF; - mio->impl.mem.eof = FALSE; - mio->impl.mem.error = FALSE; + mio->impl.mem.eof = false; + mio->impl.mem.error = false; } } Modified: ctags/main/mio.h 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -128,8 +128,8 @@ struct _MIO { size_t allocated_size; MIOReallocFunc realloc_func; MIODestroyNotify free_func; - boolean error; - boolean eof; + bool error; + bool eof; } mem; } impl; }; Modified: ctags/main/options.c 88 lines changed, 44 insertions(+), 44 deletions(-) =================================================================== @@ -45,7 +45,7 @@ # define RECURSE_SUPPORTED #endif -#define isCompoundOption(c) (boolean) (strchr ("fohiILpDb", (c)) != NULL) +#define isCompoundOption(c) (bool) (strchr ("fohiILpDb", (c)) != NULL) @@ -57,53 +57,53 @@ static stringList* Excluded = NULL; optionValues Option = { { - FALSE, /* --extra=f */ - TRUE, /* --file-scope */ + false, /* --extra=f */ + true, /* --file-scope */ }, { - TRUE, /* -fields=a */ - TRUE, /* -fields=f */ - FALSE, /* -fields=m */ - TRUE, /* -fields=i */ - FALSE, /* -fields=k */ - TRUE, /* -fields=z */ - TRUE, /* -fields=K */ - FALSE, /* -fields=l */ - TRUE, /* -fields=n */ - TRUE, /* -fields=s */ - TRUE, /* -fields=P */ - TRUE /* -fields=A */ + true, /* -fields=a */ + true, /* -fields=f */ + false, /* -fields=m */ + true, /* -fields=i */ + false, /* -fields=k */ + true, /* -fields=z */ + true, /* -fields=K */ + false, /* -fields=l */ + true, /* -fields=n */ + true, /* -fields=s */ + true, /* -fields=P */ + true /* -fields=A */ }, NULL, /* -I */ - FALSE, /* -a */ - FALSE, /* -B */ + false, /* -a */ + false, /* -B */ #ifdef MACROS_USE_PATTERNS EX_PATTERN, /* -n, --excmd */ #else EX_MIX, /* -n, --excmd */ #endif - FALSE, /* -R */ - TRUE, /* -u, --sort */ - FALSE, /* -V */ - FALSE, /* -x */ + false, /* -R */ + true, /* -u, --sort */ + false, /* -V */ + false, /* -x */ NULL, /* -L */ NULL, /* -o */ NULL, /* -h */ NULL, /* --etags-include */ DEFAULT_FILE_FORMAT,/* --format */ - FALSE, /* --if0 */ - FALSE, /* --kind-long */ + false, /* --if0 */ + false, /* --kind-long */ LANG_AUTO, /* --lang */ - TRUE, /* --links */ - FALSE, /* --filter */ + true, /* --links */ + false, /* --filter */ NULL, /* --filter-terminator */ - FALSE, /* --qualified-tags */ - FALSE, /* --tag-relative */ - FALSE, /* --totals */ - FALSE, /* --line-directives */ - FALSE, /* --nest */ - .machinable = FALSE, - .withListHeader = TRUE, + false, /* --qualified-tags */ + false, /* --tag-relative */ + false, /* --totals */ + false, /* --line-directives */ + false, /* --nest */ + .machinable = false, + .withListHeader = true, }; @@ -129,9 +129,9 @@ extern void setDefaultTagFileName (void) * file for the purposes of determining whether enclosed tags are global or * static. */ -extern boolean isIncludeFile (const char *const fileName) +extern bool isIncludeFile (const char *const fileName) { - return FALSE; + return false; } /* tags_ignore is a NULL-terminated array of strings, read from ~/.config/geany/ignore.tags. @@ -141,11 +141,11 @@ gchar **c_tags_ignore = NULL; /* Determines whether or not "name" should be ignored, per the ignore list. */ -extern boolean isIgnoreToken (const char *const name, - boolean *const pIgnoreParens, +extern bool isIgnoreToken (const char *const name, + bool *const pIgnoreParens, const char **const replacement) { - boolean result = FALSE; + bool result = false; if (c_tags_ignore != NULL) { @@ -155,7 +155,7 @@ extern boolean isIgnoreToken (const char *const name, vString *token = vStringNew(); if (pIgnoreParens != NULL) - *pIgnoreParens = FALSE; + *pIgnoreParens = false; for (i = 0 ; i < len ; ++i) { @@ -168,22 +168,22 @@ extern boolean isIgnoreToken (const char *const name, if (tokenLen >= 2 && vStringChar (token, tokenLen - 1) == '*' && strncmp (vStringValue (token), name, tokenLen - 1) == 0) { - result = TRUE; + result = true; break; } if (strncmp (vStringValue (token), name, nameLen) == 0) { if (nameLen == tokenLen) { - result = TRUE; + result = true; break; } else if (tokenLen == nameLen + 1 && vStringChar (token, tokenLen - 1) == '+') { - result = TRUE; + result = true; if (pIgnoreParens != NULL) - *pIgnoreParens = TRUE; + *pIgnoreParens = true; break; } else if (vStringChar (token, nameLen) == '=') @@ -230,10 +230,10 @@ extern void processExcludeOption (const char *const option CTAGS_ATTR_UNUSED, } } -extern boolean isExcludedFile (const char* const name) +extern bool isExcludedFile (const char* const name) { const char* base = baseFilename (name); - boolean result = FALSE; + bool result = false; if (Excluded != NULL) { result = stringListFileMatched (Excluded, base); Modified: ctags/main/options.h 68 lines changed, 34 insertions(+), 34 deletions(-) =================================================================== @@ -36,53 +36,53 @@ */ typedef struct sOptionValues { struct sInclude { - boolean fileNames; /* include tags for source file names */ - boolean fileScope; /* include tags of file scope only */ + bool fileNames; /* include tags for source file names */ + bool fileScope; /* include tags of file scope only */ } include; struct sExtFields { /* extension field content control */ - boolean access; - boolean fileScope; - boolean implementation; - boolean inheritance; - boolean kind; - boolean kindKey; - boolean kindLong; - boolean language; - boolean lineNumber; - boolean scope; - boolean filePosition; /* Write file position */ - boolean argList; /* Write function and macro argumentlist */ + bool access; + bool fileScope; + bool implementation; + bool inheritance; + bool kind; + bool kindKey; + bool kindLong; + bool language; + bool lineNumber; + bool scope; + bool filePosition; /* Write file position */ + bool argList; /* Write function and macro argumentlist */ } extensionFields; stringList* ignore; /* -I name of file containing tokens to ignore */ - boolean append; /* -a append to "tags" file */ - boolean backward; /* -B regexp patterns search backwards */ + bool append; /* -a append to "tags" file */ + bool backward; /* -B regexp patterns search backwards */ enum eLocate { EX_MIX, /* line numbers for defines, patterns otherwise */ EX_LINENUM, /* -n only line numbers in tag file */ EX_PATTERN /* -N only patterns in tag file */ } locate; /* --excmd EX command used to locate tag */ - boolean recurse; /* -R recurse into directories */ - boolean sorted; /* -u,--sort sort tags */ - boolean verbose; /* -V verbose */ - boolean xref; /* -x generate xref output instead */ + bool recurse; /* -R recurse into directories */ + bool sorted; /* -u,--sort sort tags */ + bool verbose; /* -V verbose */ + bool xref; /* -x generate xref output instead */ char *fileList; /* -L name of file containing names of files */ char *tagFileName; /* -o name of tags file */ stringList* headerExt; /* -h header extensions */ stringList* etagsInclude;/* --etags-include list of TAGS files to include*/ unsigned int tagFileFormat;/* --format tag file format (level) */ - boolean if0; /* --if0 examine code within "#if 0" branch */ - boolean kindLong; /* --kind-long */ + bool if0; /* --if0 examine code within "#if 0" branch */ + bool kindLong; /* --kind-long */ langType language; /* --lang specified language override */ - boolean followLinks; /* --link follow symbolic links? */ - boolean filter; /* --filter behave as filter: files in, tags out */ + bool followLinks; /* --link follow symbolic links? */ + bool filter; /* --filter behave as filter: files in, tags out */ char* filterTerminator; /* --filter-terminator string to output */ - boolean qualifiedTags; /* --qualified-tags include class-qualified tag */ - boolean tagRelative; /* --tag-relative file paths relative to tag file */ - boolean printTotals; /* --totals print cumulative statistics */ - boolean lineDirectives; /* --linedirectives process #line directives */ - boolean nestFunction; /* --nest Nest inside function blocks for tags */ - boolean machinable; /* --machinable */ - boolean withListHeader; /* --with-list-header */ + bool qualifiedTags; /* --qualified-tags include class-qualified tag */ + bool tagRelative; /* --tag-relative file paths relative to tag file */ + bool printTotals; /* --totals print cumulative statistics */ + bool lineDirectives; /* --linedirectives process #line directives */ + bool nestFunction; /* --nest Nest inside function blocks for tags */ + bool machinable; /* --machinable */ + bool withListHeader; /* --with-list-header */ } optionValues; /* @@ -97,9 +97,9 @@ extern void verbose (const char *const format, ...) CTAGS_ATTR_PRINTF (1, 2); extern void freeList (stringList** const pString); extern void setDefaultTagFileName (void); -extern boolean isIncludeFile (const char *const fileName); -extern boolean isExcludedFile (const char* const name); -extern boolean isIgnoreToken (const char *const name, boolean *const pIgnoreParens, const char **const replacement); +extern bool isIncludeFile (const char *const fileName); +extern bool isExcludedFile (const char* const name); +extern bool isIgnoreToken (const char *const name, bool *const pIgnoreParens, const char **const replacement); extern void readOptionConfiguration (void); extern void initOptions (void); extern void freeOptionResources (void); Modified: ctags/main/parse.c 100 lines changed, 50 insertions(+), 50 deletions(-) =================================================================== @@ -34,7 +34,7 @@ static parserDefinitionFunc* BuiltInParsers[] = { PARSER_LIST }; parserDefinition** LanguageTable = NULL; unsigned int LanguageCount = 0; static kindOption defaultFileKind = { - .enabled = FALSE, + .enabled = false, .letter = KIND_FILE_DEFAULT, .name = KIND_FILE_DEFAULT_LONG, .description = KIND_FILE_DEFAULT_LONG, @@ -84,7 +84,7 @@ extern parserDefinition* parserNewFull (const char* name, char fileKind) /* TODO: implement custom file kind */ result->fileKind = &defaultFileKind; - result->enabled = TRUE; + result->enabled = true; return result; } @@ -212,22 +212,22 @@ extern langType getFileLanguage (const char *const fileName) extern void printLanguageMap (const langType language) { - boolean first = TRUE; + bool first = true; unsigned int i; stringList* map = LanguageTable [language]->currentPatterns; Assert (0 <= language && language < (int) LanguageCount); for (i = 0 ; map != NULL && i < stringListCount (map) ; ++i) { printf ("%s(%s)", (first ? "" : " "), vStringValue (stringListItem (map, i))); - first = FALSE; + first = false; } map = LanguageTable [language]->currentExtensions; for (i = 0 ; map != NULL && i < stringListCount (map) ; ++i) { printf ("%s.%s", (first ? "" : " "), vStringValue (stringListItem (map, i))); - first = FALSE; + first = false; } } @@ -288,14 +288,14 @@ extern void addLanguageExtensionMap (const langType language, stringListAdd (LanguageTable [language]->currentExtensions, str); } -extern void enableLanguages (const boolean state) +extern void enableLanguages (const bool state) { unsigned int i; for (i = 0 ; i < LanguageCount ; ++i) LanguageTable [i]->enabled = state; } -extern void enableLanguage (const langType language, const boolean state) +extern void enableLanguage (const langType language, const bool state) { Assert (0 <= language && language < (int) LanguageCount); LanguageTable [language]->enabled = state; @@ -308,10 +308,10 @@ static void initializeParserOne (langType lang) installKeywordTable (lang); installTagRegexTable (lang); - if ((parser->initialize != NULL) && (parser->initialized == FALSE)) + if ((parser->initialize != NULL) && (parser->initialized == false)) { parser->initialize (lang); - parser->initialized = TRUE; + parser->initialized = true; } } @@ -335,30 +335,30 @@ extern void initializeParsing (void) parserDefinition* const def = (*BuiltInParsers [i]) (); if (def != NULL) { - boolean accepted = FALSE; + bool accepted = false; if (def->name == NULL || def->name[0] == '\0') error (FATAL, "parser definition must contain name\n"); else if (def->method & METHOD_REGEX) { #ifdef HAVE_REGEX def->parser = findRegexTags; - accepted = TRUE; + accepted = true; #endif } else if ((def->parser == NULL) == (def->parser2 == NULL)) error (FATAL, "%s parser definition must define one and only one parsing routine\n", def->name); else - accepted = TRUE; + accepted = true; if (accepted) { def->id = LanguageCount++; LanguageTable [def->id] = def; } } } - enableLanguages (TRUE); + enableLanguages (true); initializeParsers (); } @@ -398,7 +398,7 @@ extern void processLanguageDefineOption (const char *const option, def->currentPatterns = stringListNew (); def->currentExtensions = stringListNew (); def->method = METHOD_NOT_CRAFTED; - def->enabled = TRUE; + def->enabled = true; def->id = i; LanguageTable = xRealloc (LanguageTable, i + 1, parserDefinition*); LanguageTable [i] = def; @@ -425,29 +425,29 @@ static kindOption *langKindOption (const langType language, const int flag) extern void processLegacyKindOption (const char *const parameter) { const langType lang = getNamedLanguage ("c"); - boolean clear = FALSE; + bool clear = false; const char* p = parameter; - boolean mode = TRUE; + bool mode = true; int c; error (WARNING, "-i option is deprecated; use --c-types option instead"); if (*p == '=') { - clear = TRUE; + clear = true; ++p; } if (clear && *p != '+' && *p != '-') { unsigned int i; for (i = 0 ; i < LanguageTable [lang]->kindCount ; ++i) - LanguageTable [lang]->kinds [i].enabled = FALSE; - Option.include.fileNames= FALSE; - Option.include.fileScope= FALSE; + LanguageTable [lang]->kinds [i].enabled = false; + Option.include.fileNames= false; + Option.include.fileScope= false; } while ((c = *p++) != '\0') switch (c) { - case '+': mode = TRUE; break; - case '-': mode = FALSE; break; + case '+': mode = true; break; + case '-': mode = false; break; case 'F': Option.include.fileNames = mode; break; case 'S': Option.include.fileScope = mode; break; @@ -475,14 +475,14 @@ static void disableLanguageKinds (const langType language) { unsigned int i; for (i = 0 ; i < LanguageTable [language]->kindCount ; ++i) - LanguageTable [language]->kinds [i].enabled = FALSE; + LanguageTable [language]->kinds [i].enabled = false; } } -static boolean enableLanguageKind (const langType language, - const int kind, const boolean mode) +static bool enableLanguageKind (const langType language, + const int kind, const bool mode) { - boolean result = FALSE; + bool result = false; if (LanguageTable [language]->method & METHOD_REGEX) #ifdef HAVE_REGEX result = enableRegexKind (language, kind, mode); @@ -495,7 +495,7 @@ static boolean enableLanguageKind (const langType language, if (opt != NULL) { opt->enabled = mode; - result = TRUE; + result = true; } } return result; @@ -506,16 +506,16 @@ static void processLangKindOption (const langType language, const char *const parameter) { const char *p = parameter; - boolean mode = TRUE; + bool mode = true; int c; Assert (0 <= language && language < (int) LanguageCount); if (*p != '+' && *p != '-') disableLanguageKinds (language); while ((c = *p++) != '\0') switch (c) { - case '+': mode = TRUE; break; - case '-': mode = FALSE; break; + case '+': mode = true; break; + case '-': mode = false; break; default: { @@ -526,10 +526,10 @@ static void processLangKindOption (const langType language, } } -extern boolean processKindOption (const char *const option, - const char *const parameter) +extern bool processKindOption (const char *const option, + const char *const parameter) { - boolean handled = FALSE; + bool handled = false; const char* const dash = strchr (option, '-'); if (dash != NULL && (strcmp (dash + 1, "types") == 0 || strcmp (dash + 1, "kinds") == 0)) @@ -543,7 +543,7 @@ extern boolean processKindOption (const char *const option, else processLangKindOption (language, option, parameter); vStringDelete (langName); - handled = TRUE; + handled = true; } return handled; } @@ -605,19 +605,19 @@ static void makeFileTag (const char *const fileName) tagEntryInfo tag; initTagEntry (&tag, baseFilename (fileName), getInputLanguageFileKind ()); - tag.isFileEntry = TRUE; - tag.lineNumberEntry = TRUE; + tag.isFileEntry = true; + tag.lineNumberEntry = true; tag.lineNumber = 1; makeTagEntry (&tag); } } -static boolean createTagsForFile (const char *const fileName, - const langType language, - const unsigned int passCount) +static bool createTagsForFile (const char *const fileName, + const langType language, + const unsigned int passCount) { - boolean retried = FALSE; + bool retried = false; if (fileOpen (fileName, language)) { @@ -636,13 +636,13 @@ static boolean createTagsForFile (const char *const fileName, return retried; } -static boolean createTagsWithFallback (const char *const fileName, - const langType language) +static bool createTagsWithFallback (const char *const fileName, + const langType language) { const unsigned long numTags = TagFile.numTags.added; MIOPos tagFilePosition; unsigned int passCount = 0; - boolean tagFileResized = FALSE; + bool tagFileResized = false; mio_getpos (TagFile.mio, &tagFilePosition); while (createTagsForFile (fileName, language, ++passCount)) @@ -651,14 +651,14 @@ static boolean createTagsWithFallback (const char *const fileName, */ mio_setpos (TagFile.mio, &tagFilePosition); TagFile.numTags.added = numTags; - tagFileResized = TRUE; + tagFileResized = true; } return tagFileResized; } -extern boolean parseFile (const char *const fileName) +extern bool parseFile (const char *const fileName) { - boolean tagFileResized = FALSE; + bool tagFileResized = false; langType language = Option.language; if (Option.language == LANG_AUTO) language = getFileLanguage (fileName); @@ -682,15 +682,15 @@ extern void installTagRegexTable (const langType language) lang = LanguageTable [language]; - if ((lang->tagRegexTable != NULL) && (lang->tagRegexInstalled == FALSE)) + if ((lang->tagRegexTable != NULL) && (lang->tagRegexInstalled == false)) { for (i = 0; i < lang->tagRegexCount; ++i) addTagRegex (language, lang->tagRegexTable [i].regex, lang->tagRegexTable [i].name, lang->tagRegexTable [i].kinds, lang->tagRegexTable [i].flags); - lang->tagRegexInstalled = TRUE; + lang->tagRegexInstalled = true; } } @@ -702,12 +702,12 @@ extern void installKeywordTable (const langType language) Assert (0 <= language && language < (int) LanguageCount); lang = LanguageTable [language]; - if ((lang->keywordTable != NULL) && (lang->keywordInstalled == FALSE)) + if ((lang->keywordTable != NULL) && (lang->keywordInstalled == false)) { for (i = 0; i < lang->keywordCount; ++i) addKeyword (lang->keywordTable [i].name, language, lang->keywordTable [i].id); - lang->keywordInstalled = TRUE; + lang->keywordInstalled = true; } } Modified: ctags/main/parse.h 30 lines changed, 15 insertions(+), 15 deletions(-) =================================================================== @@ -31,7 +31,7 @@ typedef int langType; typedef void (*createRegexTag) (const vString* const name); typedef void (*simpleParser) (void); -typedef boolean (*rescanParser) (const unsigned int passCount); +typedef bool (*rescanParser) (const unsigned int passCount); typedef void (*parserInitialize) (langType language); typedef int (*tagEntryFunction) (const tagEntryInfo *const tag, void *user_data); @@ -45,10 +45,10 @@ typedef enum { typedef struct { const char *const regex; - const char* const name; - const char* const kinds; + const char *const name; + const char *const kinds; const char *const flags; - boolean *disabled; + bool *disabled; } tagRegexTable; typedef struct { @@ -70,8 +70,8 @@ typedef struct { unsigned int method; /* See PARSE__... definitions above */ /* used internally */ - unsigned int id; /* id assigned to language */ - boolean enabled; /* currently enabled? */ + unsigned int id; /* id assigned to language */ + bool enabled; /* currently enabled? */ stringList* currentPatterns; /* current list of file name patterns */ stringList* currentExtensions; /* current list of extensions */ tagRegexTable *tagRegexTable; @@ -105,7 +105,7 @@ extern parserDefinitionFunc PARSER_LIST; extern parserDefinition** LanguageTable; extern unsigned int LanguageCount; /* Legacy interface */ -extern boolean includingDefineTags (void); +extern bool includingDefineTags (void); extern void processLegacyKindOption (const char *const parameter); /* Language processing and parsing */ @@ -123,31 +123,31 @@ extern void clearLanguageMap (const langType language); extern void addLanguageExtensionMap (const langType language, const char* extension); extern void addLanguagePatternMap (const langType language, const char* ptrn); extern void printLanguageMap (const langType language); -extern void enableLanguages (const boolean state); -extern void enableLanguage (const langType language, const boolean state); +extern void enableLanguages (const bool state); +extern void enableLanguage (const langType language, const bool state); extern void initializeParsing (void); extern void freeParserResources (void); extern void processLanguageDefineOption (const char *const option, const char *const parameter); -extern boolean processKindOption (const char *const option, const char *const parameter); +extern bool processKindOption (const char *const option, const char *const parameter); extern void printKindOptions (void); -extern boolean parseFile (const char *const fileName); +extern bool parseFile (const char *const fileName); extern void installKeywordTable (const langType language); /* Regex interface */ #ifdef HAVE_REGEX extern void findRegexTags (void); -extern boolean matchRegex (const vString* const line, const langType language); +extern bool matchRegex (const vString* const line, const langType language); #endif -extern boolean processRegexOption (const char *const option, const char *const parameter); +extern bool processRegexOption (const char *const option, const char *const parameter); extern void addLanguageRegex (const langType language, const char* const regex); extern void installTagRegexTable (const langType language); extern void addTagRegex (const langType language, const char* const regex, const char* const name, const char* const kinds, const char* const flags); extern void addCallbackRegex (const langType language, const char* const regex, const char* flags, const regexCallback callback); extern void disableRegexKinds (const langType language CTAGS_ATTR_UNUSED); -extern boolean enableRegexKind (const langType language, const int kind, const boolean mode); +extern bool enableRegexKind (const langType language, const int kind, const bool mode); extern void printRegexKindOptions (const langType language); -extern void printRegexKinds (const langType language, boolean indent); +extern void printRegexKinds (const langType language, bool indent); extern void freeRegexResources (void); extern void checkRegex (void); Modified: ctags/main/read.c 64 lines changed, 32 insertions(+), 32 deletions(-) =================================================================== @@ -103,10 +103,10 @@ static void setSourceFileParameters (vString *const fileName, const langType lan File.input.language = File.source.language; } -static boolean setSourceFileName (vString *const fileName) +static bool setSourceFileName (vString *const fileName) { const langType language = getFileLanguage (vStringValue (fileName)); - boolean result = FALSE; + bool result = false; if (language != LANG_IGNORE) { vString *pathName; @@ -116,7 +116,7 @@ static boolean setSourceFileName (vString *const fileName) pathName = combinePathAndFile (vStringValue (File.path), vStringValue (fileName)); setSourceFileParameters (pathName, -1); - result = TRUE; + result = true; } return result; } @@ -161,13 +161,13 @@ static unsigned long readLineNumber (void) static vString *readFileName (void) { vString *const fileName = vStringNew (); - boolean quoteDelimited = FALSE; + bool quoteDelimited = false; int c = skipWhite (); if (c == '"') { c = mio_getc (File.mio); /* skip double-quote */ - quoteDelimited = TRUE; + quoteDelimited = true; } while (c != EOF && c != '\n' && (quoteDelimited ? (c != '"') : (c != ' ' && c != '\t'))) @@ -182,16 +182,16 @@ static vString *readFileName (void) return fileName; } -static boolean parseLineDirective (void) +static bool parseLineDirective (void) { - boolean result = FALSE; + bool result = false; int c = skipWhite (); DebugStatement ( const char* lineStr = ""; ) if (isdigit (c)) { mio_ungetc (File.mio, c); - result = TRUE; + result = true; } else if (c == 'l' && mio_getc (File.mio) == 'i' && mio_getc (File.mio) == 'n' && mio_getc (File.mio) == 'e') @@ -200,14 +200,14 @@ static boolean parseLineDirective (void) if (c == ' ' || c == '\t') { DebugStatement ( lineStr = "line"; ) - result = TRUE; + result = true; } } if (result) { const unsigned long lNum = readLineNumber (); if (lNum == 0) - result = FALSE; + result = false; else { vString *const fileName = readFileName (); @@ -229,14 +229,14 @@ static boolean parseLineDirective (void) tagEntryInfo tag; initTagEntry (&tag, baseFilename (vStringValue (fileName)), getInputLanguageFileKind ()); - tag.isFileEntry = TRUE; - tag.lineNumberEntry = TRUE; + tag.isFileEntry = true; + tag.lineNumberEntry = true; tag.lineNumber = 1; makeTagEntry (&tag); } vStringDelete (fileName); - result = TRUE; + result = true; } } return result; @@ -249,10 +249,10 @@ static boolean parseLineDirective (void) /* This function opens an input file, and resets the line counter. If it * fails, it will display an error message and leave the File.mio set to NULL. */ -extern boolean fileOpen (const char *const fileName, const langType language) +extern bool fileOpen (const char *const fileName, const langType language) { const char *const openMode = "rb"; - boolean opened = FALSE; + bool opened = false; /* If another file was already open, then close it. */ @@ -267,15 +267,15 @@ extern boolean fileOpen (const char *const fileName, const langType language) error (WARNING | PERROR, "cannot open \"%s\"", fileName); else { - opened = TRUE; + opened = true; setInputFileName (fileName); mio_getpos (File.mio, &StartOfLine); mio_getpos (File.mio, &File.filePosition); File.currentLine = NULL; File.input.lineNumber = 0L; - File.eof = FALSE; - File.newLine = TRUE; + File.eof = false; + File.newLine = true; if (File.line != NULL) vStringClear (File.line); @@ -294,10 +294,10 @@ extern boolean fileOpen (const char *const fileName, const langType language) * This func is NOT THREAD SAFE. * The user should not tamper with the buffer while this func is executing. */ -extern boolean bufferOpen (unsigned char *buffer, size_t buffer_size, - const char *const fileName, const langType language ) +extern bool bufferOpen (unsigned char *buffer, size_t buffer_size, + const char *const fileName, const langType language ) { - boolean opened = FALSE; + bool opened = false; /* Check whether a file of a buffer were already open, then close them. */ @@ -308,20 +308,20 @@ extern boolean bufferOpen (unsigned char *buffer, size_t buffer_size, /* check if we got a good buffer */ if (buffer == NULL || buffer_size == 0) { - opened = FALSE; + opened = false; return opened; } - opened = TRUE; + opened = true; File.mio = mio_new_memory (buffer, buffer_size, NULL, NULL); setInputFileName (fileName); mio_getpos (File.mio, &StartOfLine); mio_getpos (File.mio, &File.filePosition); File.currentLine = NULL; File.input.lineNumber = 0L; - File.eof = FALSE; - File.newLine = TRUE; + File.eof = false; + File.newLine = true; if (File.line != NULL) vStringClear (File.line); @@ -352,7 +352,7 @@ extern void fileClose (void) } } -extern boolean fileEOF (void) +extern bool fileEOF (void) { return File.eof; } @@ -362,7 +362,7 @@ extern boolean fileEOF (void) static void fileNewline (void) { File.filePosition = StartOfLine; - File.newLine = FALSE; + File.newLine = false; File.input.lineNumber++; File.source.lineNumber++; DebugStatement ( if (Option.breakLine == File.input.lineNumber) lineBreak (); ) @@ -396,10 +396,10 @@ static int iFileGetc (void) } if (c == EOF) - File.eof = TRUE; + File.eof = true; else if (c == NEWLINE) { - File.newLine = TRUE; + File.newLine = true; mio_getpos (File.mio, &StartOfLine); } else if (c == CRETURN) @@ -413,7 +413,7 @@ static int iFileGetc (void) mio_ungetc (File.mio, next); c = NEWLINE; /* convert CR into newline */ - File.newLine = TRUE; + File.newLine = true; mio_getpos (File.mio, &StartOfLine); } DebugStatement ( debugPutc (DEBUG_RAW, c); ) @@ -548,7 +548,7 @@ extern char *readLineRaw (vString *const vLine, MIO *const mio) error (FATAL, "NULL file pointer"); else { - boolean reReadLine; + bool reReadLine; /* If reading the line places any character other than a null or a * newline at the last character position in the buffer (one less @@ -561,7 +561,7 @@ extern char *readLineRaw (vString *const vLine, MIO *const mio) long startOfLine; startOfLine = mio_tell(mio); - reReadLine = FALSE; + reReadLine = false; *pLastChar = '\0'; result = mio_gets (mio, vStringValue (vLine), (int) vStringSize (vLine)); if (result == NULL) Modified: ctags/main/read.h 16 lines changed, 8 insertions(+), 8 deletions(-) =================================================================== @@ -31,7 +31,7 @@ #define getSourceLanguage() File.source.language #define getSourceLanguageName() getLanguageName (File.source.language) #define getSourceLineNumber() File.source.lineNumber -#define isInputLanguage(lang) (boolean)((lang) == File.input.language) +#define isInputLanguage(lang) (bool)((lang) == File.input.language) #define isInputHeaderFile() File.input.isHeader /* @@ -66,7 +66,7 @@ typedef struct sInputFileInfo { when `resetInputFile' is called on the input stream. This is needed for nested stream. */ - boolean isHeader; /* is input file a header file? */ + bool isHeader; /* is input file a header file? */ langType language; /* language of input file */ } inputFileInfo; @@ -78,8 +78,8 @@ typedef struct sInputFile { MIOPos filePosition; /* file position of current line */ unsigned int ungetchIdx; int ungetchBuf[3]; /* characters that were ungotten */ - boolean eof; /* have we reached the end of file? */ - boolean newLine; /* will the next character begin a new line? */ + bool eof; /* have we reached the end of file? */ + bool newLine; /* will the next character begin a new line? */ /* Contains data pertaining to the original source file in which the tag * was defined. This may be different from the input file when #line @@ -103,8 +103,8 @@ extern inputFile File; extern kindOption *getInputLanguageFileKind (void); extern void freeSourceFileResources (void); -extern boolean fileOpen (const char *const fileName, const langType language); -extern boolean fileEOF (void); +extern bool fileOpen (const char *const fileName, const langType language); +extern bool fileEOF (void); extern void fileClose (void); extern int getcFromInputFile (void); extern int getNthPrevCFromInputFile (unsigned int nth, int def); @@ -113,8 +113,8 @@ extern void ungetcToInputFile (int c); extern const unsigned char *readLineFromInputFile (void); extern char *readLineRaw (vString *const vLine, MIO *const mio); extern char *readSourceLine (vString *const vLine, MIOPos location, long *const pSeekValue); -extern boolean bufferOpen (unsigned char *buffer, size_t buffer_size, - const char *const fileName, const langType language ); +extern bool bufferOpen (unsigned char *buffer, size_t buffer_size, + const char *const fileName, const langType language ); #define bufferClose fileClose /* Bypass: reading from fp in inputFile WITHOUT updating fields in input fields */ Modified: ctags/main/routines.c 66 lines changed, 33 insertions(+), 33 deletions(-) =================================================================== @@ -94,15 +94,15 @@ # ifdef S_IFLNK # define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK) # else -# define S_ISLNK(mode) FALSE /* assume no soft links */ +# define S_ISLNK(mode) false /* assume no soft links */ # endif #endif #ifndef S_ISDIR # ifdef S_IFDIR # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) # else -# define S_ISDIR(mode) FALSE /* assume no soft links */ +# define S_ISDIR(mode) false /* assume no soft links */ # endif #endif @@ -314,16 +314,16 @@ static void setCurrentDirectory (void) #endif -extern boolean doesFileExist (const char *const fileName) +extern bool doesFileExist (const char *const fileName) { GStatBuf fileStatus; - return (boolean) (g_stat (fileName, &fileStatus) == 0); + return (bool) (g_stat (fileName, &fileStatus) == 0); } -extern boolean isRecursiveLink (const char* const dirName) +extern bool isRecursiveLink (const char* const dirName) { - boolean result = FALSE; + bool result = false; char* const path = absoluteFilename (dirName); while (path [strlen (path) - 1] == PATH_SEPARATOR) path [strlen (path) - 1] = '\0'; @@ -342,14 +342,14 @@ extern boolean isRecursiveLink (const char* const dirName) return result; } -extern boolean isSameFile (const char *const name1, const char *const name2) +extern bool isSameFile (const char *const name1, const char *const name2) { - boolean result = FALSE; + bool result = false; #ifdef HAVE_STAT_ST_INO GStatBuf stat1, stat2; if (g_stat (name1, &stat1) == 0 && g_stat (name2, &stat2) == 0) - result = (boolean) (stat1.st_ino == stat2.st_ino); + result = (bool) (stat1.st_ino == stat2.st_ino); #endif return result; } @@ -402,16 +402,16 @@ extern const char *fileExtension (const char *const fileName) return extension; } -extern boolean isAbsolutePath (const char *const path) +extern bool isAbsolutePath (const char *const path) { - boolean result = FALSE; + bool result = false; #if defined (MSDOS_STYLE_PATH) if (strchr (PathDelimiters, path [0]) != NULL) - result = TRUE; + result = true; else if (isalpha (path [0]) && path [1] == ':') { if (strchr (PathDelimiters, path [2]) != NULL) - result = TRUE; + result = true; else /* We don't support non-absolute file names with a drive * letter, like `d:NAME' (it's too much hassle). @@ -421,7 +421,7 @@ extern boolean isAbsolutePath (const char *const path) path); } #else - result = (boolean) (path [0] == PATH_SEPARATOR); + result = (bool) (path [0] == PATH_SEPARATOR); #endif return result; } @@ -432,9 +432,9 @@ extern vString *combinePathAndFile (const char *const path, vString *const filePath = vStringNew (); const int lastChar = path [strlen (path) - 1]; # ifdef MSDOS_STYLE_PATH - boolean terminated = (boolean) (strchr (PathDelimiters, lastChar) != NULL); + bool terminated = (bool) (strchr (PathDelimiters, lastChar) != NULL); # else - boolean terminated = (boolean) (lastChar == PATH_SEPARATOR); + bool terminated = (bool) (lastChar == PATH_SEPARATOR); # endif vStringCopyS (filePath, path); @@ -609,56 +609,56 @@ extern long unsigned int getFileSize (const char *const name) } #if 0 -static boolean isSymbolicLink (const char *const name) +static bool isSymbolicLink (const char *const name) { #if defined (WIN32) - return FALSE; + return false; #else GStatBuf fileStatus; - boolean result = FALSE; + bool result = false; if (g_lstat (name, &fileStatus) == 0) - result = (boolean) (S_ISLNK (fileStatus.st_mode)); + result = (bool) (S_ISLNK (fileStatus.st_mode)); return result; #endif } -static boolean isNormalFile (const char *const name) +static bool isNormalFile (const char *const name) { GStatBuf fileStatus; - boolean result = FALSE; + bool result = false; if (g_stat (name, &fileStatus) == 0) - result = (boolean) (S_ISREG (fileStatus.st_mode)); + result = (bool) (S_ISREG (fileStatus.st_mode)); return result; } #endif -extern boolean isExecutable (const char *const name) +extern bool isExecutable (const char *const name) { GStatBuf fileStatus; - boolean result = FALSE; + bool result = false; if (g_stat (name, &fileStatus) == 0) - result = (boolean) ((fileStatus.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) != 0); + result = (bool) ((fileStatus.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) != 0); return result; } #ifdef HAVE_MKSTEMP -static boolean isSetUID (const char *const name) +static bool isSetUID (const char *const name) { #if defined (WIN32) - return FALSE; + return false; #else GStatBuf fileStatus; - boolean result = FALSE; + bool result = false; if (g_stat (name, &fileStatus) == 0) - result = (boolean) ((fileStatus.st_mode & S_ISUID) != 0); + result = (bool) ((fileStatus.st_mode & S_ISUID) != 0); return result; #endif @@ -667,13 +667,13 @@ static boolean isSetUID (const char *const name) #endif #if 0 -static boolean isDirectory (const char *const name) +static bool isDirectory (const char *const name) { - boolean result = FALSE; + bool result = false; GStatBuf fileStatus; if (g_stat (name, &fileStatus) == 0) - result = (boolean) S_ISDIR (fileStatus.st_mode); + result = (bool) S_ISDIR (fileStatus.st_mode); return result; } #endif Modified: ctags/main/routines.h 10 lines changed, 5 insertions(+), 5 deletions(-) =================================================================== @@ -80,11 +80,11 @@ extern char* newLowerString (const char* str); extern char* newUpperString (const char* str); /* File system functions */ -extern boolean doesFileExist (const char *const fileName); -extern boolean isRecursiveLink (const char* const dirName); -extern boolean isSameFile (const char *const name1, const char *const name2); +extern bool doesFileExist (const char *const fileName); +extern bool isRecursiveLink (const char* const dirName); +extern bool isSameFile (const char *const name1, const char *const name2); extern const char *baseFilename (const char *const filePath); -extern boolean isAbsolutePath (const char *const path); +extern bool isAbsolutePath (const char *const path); extern vString *combinePathAndFile (const char *const path, const char *const file); extern char* absoluteFilename (const char *file); extern char* absoluteDirname (char *file); @@ -94,7 +94,7 @@ extern void processExcludeOption (const char *const option, const char *const pa extern const char *fileExtension (const char *const fileName); extern char* eStrdup (const char* str); extern long unsigned int getFileSize (const char *const name); -extern boolean isExecutable (const char *const name); +extern bool isExecutable (const char *const name); #ifndef HAVE_STRICMP extern int stricmp (const char *s1, const char *s2); Modified: ctags/main/sort.c 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -57,7 +57,7 @@ extern void catFile (const char *const name) # define PE_CONST const #endif -extern void externalSortTags (const boolean toStdout) +extern void externalSortTags (const bool toStdout) { const char *const sortCommand = "sort -u -o"; PE_CONST char *const sortOrder1 = "LC_COLLATE=C"; @@ -124,7 +124,7 @@ static int compareTags (const void *const one, const void *const two) } static void writeSortedTags ( - char **const table, const size_t numTags, const boolean toStdout) + char **const table, const size_t numTags, const bool toStdout) { MIO *mio; size_t i; @@ -153,7 +153,7 @@ static void writeSortedTags ( mio_free (mio); } -extern void internalSortTags (const boolean toStdout) +extern void internalSortTags (const bool toStdout) { vString *vLine = vStringNew (); MIO *mio = NULL; Modified: ctags/main/sort.h 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -20,9 +20,9 @@ extern void catFile (const char *const name); #ifdef EXTERNAL_SORT -extern void externalSortTags (const boolean toStdout); +extern void externalSortTags (const bool toStdout); #else -extern void internalSortTags (const boolean toStdout); +extern void internalSortTags (const bool toStdout); #endif #endif /* CTAGS_MAIN_SORT_H */ Modified: ctags/main/strlist.c 44 lines changed, 22 insertions(+), 22 deletions(-) =================================================================== @@ -157,22 +157,22 @@ extern void stringListDelete (stringList *const current) } } -static boolean compareString ( +static bool compareString ( const char *const string, vString *const itm) { - return (boolean) (strcmp (string, vStringValue (itm)) == 0); + return (bool) (strcmp (string, vStringValue (itm)) == 0); } -static boolean compareStringInsensitive ( +static bool compareStringInsensitive ( const char *const string, vString *const itm) { - return (boolean) (strcasecmp (string, vStringValue (itm)) == 0); + return (bool) (strcasecmp (string, vStringValue (itm)) == 0); } static int stringListIndex ( const stringList *const current, const char *const string, - boolean (*test)(const char *s, vString *const vs)) + bool (*test)(const char *s, vString *const vs)) { int result = -1; unsigned int i; @@ -185,40 +185,40 @@ static int stringListIndex ( return result; } -extern boolean stringListHas ( +extern bool stringListHas ( const stringList *const current, const char *const string) { - boolean result = FALSE; + bool result = false; Assert (current != NULL); result = stringListIndex (current, string, compareString) != -1; return result; } -extern boolean stringListHasInsensitive ( +extern bool stringListHasInsensitive ( const stringList *const current, const char *const string) { - boolean result = FALSE; + bool result = false; Assert (current != NULL); Assert (string != NULL); result = stringListIndex (current, string, compareStringInsensitive) != -1; return result; } -extern boolean stringListHasTest ( - const stringList *const current, boolean (*test)(const char *s)) +extern bool stringListHasTest ( + const stringList *const current, bool (*test)(const char *s)) { - boolean result = FALSE; + bool result = false; unsigned int i; Assert (current != NULL); for (i = 0 ; ! result && i < current->count ; ++i) result = (*test)(vStringValue (current->list [i])); return result; } -extern boolean stringListRemoveExtension ( +extern bool stringListRemoveExtension ( stringList* const current, const char* const extension) { - boolean result = FALSE; + bool result = false; int where; #ifdef CASE_INSENSITIVE_FILENAMES where = stringListIndex (current, extension, compareStringInsensitive); @@ -231,12 +231,12 @@ extern boolean stringListRemoveExtension ( (current->count - where) * sizeof (*current->list)); current->list [current->count - 1] = NULL; --current->count; - result = TRUE; + result = true; } return result; } -extern boolean stringListExtensionMatched ( +extern bool stringListExtensionMatched ( const stringList* const current, const char* const extension) { #ifdef CASE_INSENSITIVE_FILENAMES @@ -246,23 +246,23 @@ extern boolean stringListExtensionMatched ( #endif } -static boolean fileNameMatched ( +static bool fileNameMatched ( const vString* const vpattern, const char* const fileName) { const char* const pattern = vStringValue (vpattern); #if defined (HAVE_FNMATCH) - return (boolean) (fnmatch (pattern, fileName, 0) == 0); + return (bool) (fnmatch (pattern, fileName, 0) == 0); #elif defined (CASE_INSENSITIVE_FILENAMES) - return (boolean) (strcasecmp (pattern, fileName) == 0); + return (bool) (strcasecmp (pattern, fileName) == 0); #else - return (boolean) (strcmp (pattern, fileName) == 0); + return (bool) (strcmp (pattern, fileName) == 0); #endif } -extern boolean stringListFileMatched ( +extern bool stringListFileMatched ( const stringList* const current, const char* const fileName) { - boolean result = FALSE; + bool result = false; unsigned int i; for (i = 0 ; ! result && i < stringListCount (current) ; ++i) result = fileNameMatched (stringListItem (current, i), fileName); Modified: ctags/main/strlist.h 12 lines changed, 6 insertions(+), 6 deletions(-) =================================================================== @@ -39,12 +39,12 @@ extern unsigned int stringListCount (const stringList *const current); extern vString* stringListItem (const stringList *const current, const unsigned int indx); extern vString* stringListLast (const stringList *const current); extern void stringListDelete (stringList *const current); -extern boolean stringListHasInsensitive (const stringList *const current, const char *const string); -extern boolean stringListHas (const stringList *const current, const char *const string); -extern boolean stringListHasTest (const stringList *const current, boolean (*test)(const char *s)); -extern boolean stringListRemoveExtension (stringList* const current, const char* const extension); -extern boolean stringListExtensionMatched (const stringList* const list, const char* const extension); -extern boolean stringListFileMatched (const stringList* const list, const char* const str); +extern bool stringListHasInsensitive (const stringList *const current, const char *const string); +extern bool stringListHas (const stringList *const current, const char *const string); +extern bool stringListHasTest (const stringList *const current, bool (*test)(const char *s)); +extern bool stringListRemoveExtension (stringList* const current, const char* const extension); +extern bool stringListExtensionMatched (const stringList* const list, const char* const extension); +extern bool stringListFileMatched (const stringList* const list, const char* const str); extern void stringListPrint (const stringList *const current); #endif /* CTAGS_MAIN_STRLIST_H */ Modified: ctags/main/vstring.c 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -41,9 +41,9 @@ static void vStringResize (vString *const string, const size_t newSize) * External interface */ -extern boolean vStringAutoResize (vString *const string) +extern bool vStringAutoResize (vString *const string) { - boolean ok = TRUE; + bool ok = true; if (string->size <= INT_MAX / 2) { Modified: ctags/main/vstring.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -58,7 +58,7 @@ typedef struct sVString { /* * FUNCTION PROTOTYPES */ -extern boolean vStringAutoResize (vString *const string); +extern bool vStringAutoResize (vString *const string); extern void vStringClear (vString *const string); extern vString *vStringNew (void); extern void vStringDelete (vString *const string); Modified: ctags/main/xtag.c 30 lines changed, 15 insertions(+), 15 deletions(-) =================================================================== @@ -20,24 +20,24 @@ #include <string.h> -static boolean isPseudoTagsEnabled (xtagDesc *pdesc CTAGS_ATTR_UNUSED) +static bool isPseudoTagsEnabled (xtagDesc *pdesc CTAGS_ATTR_UNUSED) { return ! isDestinationStdout (); } static xtagDesc xtagDescs [] = { - { TRUE, 'F', "fileScope", + { true, 'F', "fileScope", "Include tags of file scope" }, - { FALSE, 'f', "inputFile", + { false, 'f', "inputFile", "Include an entry for the base file name of every input file"}, - { FALSE, 'p', "pseudo", + { false, 'p', "pseudo", "Include pseudo tags", isPseudoTagsEnabled}, - { FALSE, 'q', "qualified", + { false, 'q', "qualified", "Include an extra class-qualified tag entry for each tag"}, - { FALSE, 'r', "reference", + { false, 'r', "reference", "Include reference tags"}, - { FALSE, 's', "subparser", + { false, 's', "subparser", "Include tags generated by sub parsers"}, }; @@ -47,7 +47,7 @@ extern xtagDesc* getXtagDesc (xtagType type) return xtagDescs + type; } -typedef boolean (* xtagPredicate) (xtagDesc *pdesc, const void *user_data); +typedef bool (* xtagPredicate) (xtagDesc *pdesc, const void *user_data); static xtagType getXtagTypeGeneric (xtagPredicate predicate, const void *user_data) { int i; @@ -60,19 +60,19 @@ static xtagType getXtagTypeGeneric (xtagPredicate predicate, const void *user_d return XTAG_UNKNOWN; } -static boolean xtagEqualByLetter (xtagDesc *pdesc, const void *user_data) +static bool xtagEqualByLetter (xtagDesc *pdesc, const void *user_data) { - return (pdesc->letter == *((char *)user_data))? TRUE: FALSE; + return (pdesc->letter == *((char *)user_data))? true: false; } extern xtagType getXtagTypeForLetter (char letter) { return getXtagTypeGeneric (xtagEqualByLetter, &letter); } -static boolean xtagEqualByName (xtagDesc *pdesc, const void *user_data) +static bool xtagEqualByName (xtagDesc *pdesc, const void *user_data) { - return (strcmp (pdesc->name, user_data) == 0)? TRUE: FALSE; + return (strcmp (pdesc->name, user_data) == 0)? true: false; } extern xtagType getXtagTypeForName (const char *name) @@ -119,7 +119,7 @@ extern void printXtags (void) printXtag (i); } -extern boolean isXtagEnabled (xtagType type) +extern bool isXtagEnabled (xtagType type) { xtagDesc* desc = getXtagDesc (type); @@ -131,9 +131,9 @@ extern boolean isXtagEnabled (xtagType type) return desc->enabled; } -extern boolean enableXtag (xtagType type, boolean state) +extern bool enableXtag (xtagType type, bool state) { - boolean old; + bool old; xtagDesc* desc = getXtagDesc (type); Assert (desc); Modified: ctags/main/xtag.h 8 lines changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -28,7 +28,7 @@ typedef enum eXtagType { /* extra tag content control */ } xtagType; typedef struct sXtagDesc { - boolean enabled; + bool enabled; unsigned char letter; const char* name; /* used in extra: field */ const char* description; /* displayed in --list-extra output */ @@ -41,14 +41,14 @@ typedef struct sXtagDesc { to standared output, the tag is disabled by default. If it is connected to a regular file, the tag is enabled by default. */ - boolean (* isEnabled) (struct sXtagDesc *desc); + bool (* isEnabled) (struct sXtagDesc *desc); } xtagDesc; extern xtagDesc* getXtagDesc (xtagType type); extern xtagType getXtagTypeForLetter (char letter); extern xtagType getXtagTypeForName (const char *name); -extern boolean isXtagEnabled (xtagType type); -extern boolean enableXtag (xtagType type, boolean state); +extern bool isXtagEnabled (xtagType type); +extern bool enableXtag (xtagType type, bool state); const char* getXtagName (xtagType type); extern void printXtags (void); Modified: ctags/parsers/abaqus.c 10 lines changed, 5 insertions(+), 5 deletions(-) =================================================================== @@ -29,9 +29,9 @@ typedef enum { } AbaqusKind; static kindOption AbaqusKinds[] = { - { TRUE, 'c', "class", "Parts" }, - { TRUE, 'm', "member", "Assembly" }, - { TRUE, 'n', "namespace", "Steps" } + { true, 'c', "class", "Parts" }, + { true, 'm', "member", "Assembly" }, + { true, 'n', "namespace", "Steps" } }; /* @@ -44,10 +44,10 @@ static int getWord(const char *ref, const char **ptr) while ((*ref != '\0') && (*p != '\0') && (tolower(*ref) == tolower(*p))) ref++, p++; - if (*ref) return FALSE; + if (*ref) return false; *ptr = p; - return TRUE; + return true; } Modified: ctags/parsers/abc.c 20 lines changed, 10 insertions(+), 10 deletions(-) =================================================================== @@ -27,29 +27,29 @@ */ static kindOption AbcKinds[] = { - { TRUE, 'm', "member", "sections" }, - { TRUE, 's', "struct", "header1"} + { true, 'm', "member", "sections" }, + { true, 's', "struct", "header1"} }; /* * FUNCTION DEFINITIONS */ /* checks if str is all the same character */ -/*static boolean issame(const char *str) +/*static bool issame(const char *str) { char first = *str; while (*(++str)) { if (*str && *str != first) - return FALSE; + return false; } - return TRUE; + return true; }*/ -static void makeAbcTag (const vString* const name, boolean name_before) +static void makeAbcTag (const vString* const name, bool name_before) { tagEntryInfo e; initTagEntry (&e, vStringValue(name), &(AbcKinds[0])); @@ -60,7 +60,7 @@ static void makeAbcTag (const vString* const name, boolean name_before) makeTagEntry(&e); } -/*static void makeAbcTag2 (const vString* const name, boolean name_before) +/*static void makeAbcTag2 (const vString* const name, bool name_before) { tagEntryInfo e; initTagEntry (&e, vStringValue(name)); @@ -85,20 +85,20 @@ static void findAbcTags (void) /* underlines must be the same length or more */ /*if (name_len > 0 && (line[0] == '=' || line[0] == '-') && issame((const char*) line)) { - makeAbcTag(name, TRUE); + makeAbcTag(name, true); }*/ /* if (line[1] == '%') { vStringClear(name); vStringCatS(name, (const char *) line); vStringTerminate(name); - makeAbcTag(name, FALSE); + makeAbcTag(name, false); }*/ if (line[0] == 'T') { /*vStringClear(name);*/ vStringCatS(name, " / "); vStringCatS(name, (const char *) line); vStringTerminate(name); - makeAbcTag(name, FALSE); + makeAbcTag(name, false); } else { vStringClear (name); Modified: ctags/parsers/asciidoc.c 10 lines changed, 5 insertions(+), 5 deletions(-) =================================================================== @@ -36,11 +36,11 @@ typedef enum { } asciidocKind; static kindOption AsciidocKinds[] = { - { TRUE, 'n', "namespace", "chapters"}, - { TRUE, 'm', "member", "sections" }, - { TRUE, 'd', "macro", "level2sections" }, - { TRUE, 'v', "variable", "level3sections" }, - { TRUE, 's', "struct", "level4sections" } + { true, 'n', "namespace", "chapters"}, + { true, 'm', "member", "sections" }, + { true, 'd', "macro", "level2sections" }, + { true, 'v', "variable", "level3sections" }, + { true, 's', "struct", "level4sections" } }; static char kindchars[SECTION_COUNT]={ '=', '-', '~', '^', '+' }; Modified: ctags/parsers/asm.c 52 lines changed, 26 insertions(+), 26 deletions(-) =================================================================== @@ -61,10 +61,10 @@ typedef struct { static langType Lang_asm; static kindOption AsmKinds [] = { - { TRUE, 'd', "define", "defines" }, - { TRUE, 'l', "label", "labels" }, - { TRUE, 'm', "macro", "macros" }, - { TRUE, 't', "type", "types (structs and records)" } + { true, 'd', "define", "defines" }, + { true, 'l', "label", "labels" }, + { true, 'm', "macro", "macros" }, + { true, 't', "type", "types (structs and records)" } }; static const keywordTable AsmKeywords [] = { @@ -120,20 +120,20 @@ static opKeyword analyzeOperator (const vString *const op) return result; } -static boolean isInitialSymbolCharacter (int c) +static bool isInitialSymbolCharacter (int c) { - return (boolean) (c != '\0' && (isalpha (c) || strchr ("_$", c) != NULL)); + return (bool) (c != '\0' && (isalpha (c) || strchr ("_$", c) != NULL)); } -static boolean isSymbolCharacter (int c) +static bool isSymbolCharacter (int c) { /* '?' character is allowed in AMD 29K family */ - return (boolean) (c != '\0' && (isalnum (c) || strchr ("_$?", c) != NULL)); + return (bool) (c != '\0' && (isalnum (c) || strchr ("_$?", c) != NULL)); } -static boolean readPreProc (const unsigned char *const line) +static bool readPreProc (const unsigned char *const line) { - boolean result; + bool result; const unsigned char *cp = line; vString *name = vStringNew (); while (isSymbolCharacter ((int) *cp)) @@ -142,7 +142,7 @@ static boolean readPreProc (const unsigned char *const line) ++cp; } vStringTerminate (name); - result = (boolean) (strcmp (vStringValue (name), "define") == 0); + result = (bool) (strcmp (vStringValue (name), "define") == 0); if (result) { while (isspace ((int) *cp)) @@ -162,11 +162,11 @@ static boolean readPreProc (const unsigned char *const line) static AsmKind operatorKind ( const vString *const operator, - boolean *const found) + bool *const found) { AsmKind result = K_NONE; const opKeyword kw = analyzeOperator (operator); - *found = (boolean) (kw != OP_UNDEFINED); + *found = (bool) (kw != OP_UNDEFINED); if (*found) { result = OpKinds [kw].kind; @@ -177,12 +177,12 @@ static AsmKind operatorKind ( /* We must check for "DB", "DB.L", "DCB.W" (68000) */ -static boolean isDefineOperator (const vString *const operator) +static bool isDefineOperator (const vString *const operator) { const unsigned char *const op = (unsigned char*) vStringValue (operator); const size_t length = vStringLength (operator); - const boolean result = (boolean) (length > 0 && + const bool result = (bool) (length > 0 && toupper ((int) *op) == 'D' && (length == 2 || (length == 4 && (int) op [2] == '.') || @@ -193,12 +193,12 @@ static boolean isDefineOperator (const vString *const operator) static void makeAsmTag ( const vString *const name, const vString *const operator, - const boolean labelCandidate, - const boolean nameFollows) + const bool labelCandidate, + const bool nameFollows) { if (vStringLength (name) > 0) { - boolean found; + bool found; const AsmKind kind = operatorKind (operator, &found); if (found) { @@ -257,20 +257,20 @@ static void findAsmTags (void) vString *name = vStringNew (); vString *operator = vStringNew (); const unsigned char *line; - boolean inCComment = FALSE; + bool inCComment = false; while ((line = readLineFromInputFile ()) != NULL) { const unsigned char *cp = line; - boolean labelCandidate = (boolean) (! isspace ((int) *cp)); - boolean nameFollows = FALSE; - const boolean isComment = (boolean) + bool labelCandidate = (bool) (! isspace ((int) *cp)); + bool nameFollows = false; + const bool isComment = (bool) (*cp != '\0' && strchr (";*@", *cp) != NULL); /* skip comments */ if (strncmp ((const char*) cp, "/*", (size_t) 2) == 0) { - inCComment = TRUE; + inCComment = true; cp += 2; } if (inCComment) @@ -279,7 +279,7 @@ static void findAsmTags (void) { if (strncmp ((const char*) cp, "*/", (size_t) 2) == 0) { - inCComment = FALSE; + inCComment = false; cp += 2; break; } @@ -305,7 +305,7 @@ static void findAsmTags (void) cp = readSymbol (cp, name); if (vStringLength (name) > 0 && *cp == ':') { - labelCandidate = TRUE; + labelCandidate = true; ++cp; } @@ -330,7 +330,7 @@ static void findAsmTags (void) while (isspace ((int) *cp)) ++cp; cp = readSymbol (cp, name); - nameFollows = TRUE; + nameFollows = true; } makeAsmTag (name, operator, labelCandidate, nameFollows); } Modified: ctags/parsers/basic.c 12 lines changed, 6 insertions(+), 6 deletions(-) =================================================================== @@ -40,12 +40,12 @@ typedef struct { } KeyWord; static kindOption BasicKinds[] = { - {TRUE, 'c', "constant", "constants"}, - {TRUE, 'f', "function", "functions"}, - {TRUE, 'l', "label", "labels"}, - {TRUE, 't', "type", "types"}, - {TRUE, 'v', "variable", "variables"}, - {TRUE, 'g', "enum", "enumerations"} + {true, 'c', "constant", "constants"}, + {true, 'f', "function", "functions"}, + {true, 'l', "label", "labels"}, + {true, 't', "type", "types"}, + {true, 'v', "variable", "variables"}, + {true, 'g', "enum", "enumerations"} }; static KeyWord freebasic_keywords[] = { Modified: ctags/parsers/c.c 458 lines changed, 229 insertions(+), 229 deletions(-) =================================================================== @@ -34,14 +34,14 @@ #define activeToken(st) ((st)->token [(int) (st)->tokenIndex]) #define parentDecl(st) ((st)->parent == NULL ? \ DECL_NONE : (st)->parent->declaration) -#define isType(token,t) (boolean) ((token)->type == (t)) -#define insideEnumBody(st) (boolean) ((st)->parent == NULL ? FALSE : \ +#define isType(token,t) (bool) ((token)->type == (t)) +#define insideEnumBody(st) (bool) ((st)->parent == NULL ? false : \ ((st)->parent->declaration == DECL_ENUM)) -#define isExternCDecl(st,c) (boolean) ((c) == STRING_SYMBOL && \ +#define isExternCDecl(st,c) (bool) ((c) == STRING_SYMBOL && \ ! (st)->haveQualifyingName && \ (st)->scope == SCOPE_EXTERN) -#define isOneOf(c,s) (boolean) (strchr ((s), (c)) != NULL) +#define isOneOf(c,s) (bool) (strchr ((s), (c)) != NULL) /* * DATA DECLARATIONS @@ -201,10 +201,10 @@ typedef struct sStatementInfo { tagScope scope; declType declaration; /* specifier associated with TOKEN_SPEC */ - boolean gotName; /* was a name parsed yet? */ - boolean haveQualifyingName; /* do we have a name we are considering? */ - boolean gotParenName; /* was a name inside parentheses parsed yet? */ - boolean gotArgs; /* was a list of parameters parsed yet? */ + bool gotName; /* was a name parsed yet? */ + bool haveQualifyingName; /* do we have a name we are considering? */ + bool gotParenName; /* was a name inside parentheses parsed yet? */ + bool gotArgs; /* was a list of parameters parsed yet? */ unsigned int nSemicolons; /* how many semicolons did we see in that statement */ impType implementation; /* abstract or concrete implementation? */ unsigned int tokenIndex; /* currently active token */ @@ -249,11 +249,11 @@ typedef enum eTagType typedef struct sParenInfo { - boolean isParamList; - boolean isKnrParamList; - boolean isNameCandidate; - boolean invalidContents; - boolean nestedArgs; + bool isParamList; + bool isKnrParamList; + bool isNameCandidate; + bool invalidContents; + bool nestedArgs; unsigned int parameterCount; } parenInfo; @@ -283,19 +283,19 @@ typedef enum } cKind; static kindOption CKinds [] = { - { TRUE, 'c', "class", "classes"}, - { TRUE, 'd', "macro", "macro definitions"}, - { TRUE, 'e', "enumerator", "enumerators (values inside an enumeration)"}, - { TRUE, 'f', "function", "function definitions"}, - { TRUE, 'g', "enum", "enumeration names"}, - { TRUE, 'm', "member", "class, struct, and union members"}, - { TRUE, 'n', "namespace", "namespaces"}, - { FALSE, 'p', "prototype", "function prototypes"}, - { TRUE, 's', "struct", "structure names"}, - { TRUE, 't', "typedef", "typedefs"}, - { TRUE, 'u', "union", "union names"}, - { TRUE, 'v', "variable", "variable definitions"}, - { FALSE, 'x', "externvar", "external variable declarations"}, + { true, 'c', "class", "classes"}, + { true, 'd', "macro", "macro definitions"}, + { true, 'e', "enumerator", "enumerators (values inside an enumeration)"}, + { true, 'f', "function", "function definitions"}, + { true, 'g', "enum", "enumeration names"}, + { true, 'm', "member", "class, struct, and union members"}, + { true, 'n', "namespace", "namespaces"}, + { false, 'p', "prototype", "function prototypes"}, + { true, 's', "struct", "structure names"}, + { true, 't', "typedef", "typedefs"}, + { true, 'u', "union", "union names"}, + { true, 'v', "variable", "variable definitions"}, + { false, 'x', "externvar", "external variable declarations"}, }; /* Used to index into the DKinds table. */ @@ -309,19 +309,19 @@ typedef enum } dKind; static kindOption DKinds [] = { - { TRUE, 'c', "class", "classes"}, - { TRUE, 'e', "enumerator", "enumerators (values inside an enumeration)"}, - { TRUE, 'f', "function", "function definitions"}, - { TRUE, 'g'@@ Diff output truncated at 100000 characters. @@ -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
← Newer
1
2
3
4
5
6
Older →
Jump to page:
1
2
3
4
5
6
Results per page:
10
25
50
100
200