From 357e4fe1bd55861e5a6f70b3d2417a05ca2b29a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ji=C5=99=C3=AD=20Techet?= Date: Sat, 30 Jul 2016 12:31:59 +0200 Subject: [PATCH] Rename fileUngetc() to ungetcToInputFile() --- ctags/main/get.c | 36 ++++++++++++++++++------------------ ctags/main/read.c | 2 +- ctags/main/read.h | 2 +- ctags/parsers/css.c | 4 ++-- ctags/parsers/fortran.c | 6 +++--- ctags/parsers/go.c | 12 ++++++------ ctags/parsers/haskell.c | 4 ++-- ctags/parsers/jscript.c | 20 ++++++++++---------- ctags/parsers/json.c | 2 +- ctags/parsers/make.c | 10 +++++----- ctags/parsers/php.c | 34 +++++++++++++++++----------------- ctags/parsers/powershell.c | 12 ++++++------ ctags/parsers/sql.c | 12 ++++++------ ctags/parsers/verilog.c | 2 +- 14 files changed, 79 insertions(+), 79 deletions(-) diff --git a/ctags/main/get.c b/ctags/main/get.c index 9843f9db8..540b8b29e 100644 --- a/ctags/main/get.c +++ b/ctags/main/get.c @@ -183,7 +183,7 @@ static boolean readDirective (int c, char *const name, unsigned int maxLength) c = getcFromInputFile (); if (c == EOF || ! isalpha (c)) { - fileUngetc (c); + ungetcToInputFile (c); break; } } @@ -205,7 +205,7 @@ static void readIdentifier (int c, vString *const name) vStringPut (name, c); c = getcFromInputFile (); } while (c != EOF && isident (c)); - fileUngetc (c); + ungetcToInputFile (c); vStringTerminate (name); } @@ -335,7 +335,7 @@ static void directiveDefine (const int c) { readIdentifier (c, Cpp.directive.name); nc = getcFromInputFile (); - fileUngetc (nc); + ungetcToInputFile (nc); parameterized = (boolean) (nc == '('); if (! isIgnore ()) makeDefineTag (vStringValue (Cpp.directive.name), parameterized); @@ -445,7 +445,7 @@ static Comment isComment (void) comment = COMMENT_D; else { - fileUngetc (next); + ungetcToInputFile (next); comment = COMMENT_NONE; } return comment; @@ -550,7 +550,7 @@ static int skipToEndOfCxxRawLiteralString (void) if (c != '(' && ! isCxxRawLiteralDelimiterChar (c)) { - fileUngetc (c); + ungetcToInputFile (c); c = skipToEndOfString (FALSE); } else @@ -578,7 +578,7 @@ static int skipToEndOfCxxRawLiteralString (void) if (i == delimLen && c == DOUBLE_QUOTE) break; else - fileUngetc (c); + ungetcToInputFile (c); } } while ((c = getcFromInputFile ()) != EOF); @@ -605,14 +605,14 @@ static int skipToEndOfChar (void) break; else if (c == NEWLINE) { - fileUngetc (c); + ungetcToInputFile (c); break; } else if (count == 1 && strchr ("DHOB", toupper (c)) != NULL) veraBase = c; else if (veraBase != '\0' && ! isalnum (c)) { - fileUngetc (c); + ungetcToInputFile (c); break; } } @@ -687,7 +687,7 @@ process: { c = skipOverCplusComment (); if (c == NEWLINE) - fileUngetc (c); + ungetcToInputFile (c); } else if (comment == COMMENT_D) c = skipOverDComment (); @@ -703,7 +703,7 @@ process: if (next == NEWLINE) continue; else - fileUngetc (next); + ungetcToInputFile (next); break; } @@ -711,7 +711,7 @@ process: { int next = getcFromInputFile (); if (next != '?') - fileUngetc (next); + ungetcToInputFile (next); else { next = getcFromInputFile (); @@ -727,8 +727,8 @@ process: case '-': c = '~'; break; case '=': c = '#'; goto process; default: - fileUngetc ('?'); - fileUngetc (next); + ungetcToInputFile ('?'); + ungetcToInputFile (next); break; } } @@ -745,7 +745,7 @@ process: { case ':': c = '['; break; case '%': c = '{'; break; - default: fileUngetc (next); + default: ungetcToInputFile (next); } goto enter; } @@ -755,7 +755,7 @@ process: if (next == '>') c = ']'; else - fileUngetc (next); + ungetcToInputFile (next); goto enter; } case '%': @@ -765,7 +765,7 @@ process: { case '>': c = '}'; break; case ':': c = '#'; goto process; - default: fileUngetc (next); + default: ungetcToInputFile (next); } goto enter; } @@ -781,7 +781,7 @@ process: break; } else - fileUngetc (next); + ungetcToInputFile (next); } else if (c == 'R' && Cpp.hasCxxRawLiteralStrings) { @@ -812,7 +812,7 @@ process: { int next = getcFromInputFile (); if (next != DOUBLE_QUOTE) - fileUngetc (next); + ungetcToInputFile (next); else { Cpp.directive.accept = FALSE; diff --git a/ctags/main/read.c b/ctags/main/read.c index c0995b770..381b3e185 100644 --- a/ctags/main/read.c +++ b/ctags/main/read.c @@ -416,7 +416,7 @@ readnext: return c; } -extern void fileUngetc (int c) +extern void ungetcToInputFile (int c) { const size_t len = sizeof File.ungetchBuf / sizeof File.ungetchBuf[0]; diff --git a/ctags/main/read.h b/ctags/main/read.h index d47c54533..5b3b1d2cb 100644 --- a/ctags/main/read.h +++ b/ctags/main/read.h @@ -109,7 +109,7 @@ extern void fileClose (void); extern int getcFromInputFile (void); extern int fileGetNthPrevC (unsigned int nth, int def); extern int fileSkipToCharacter (int c); -extern void fileUngetc (int c); +extern void ungetcToInputFile (int c); extern const unsigned char *fileReadLine (void); extern char *readLine (vString *const vLine, MIO *const mio); extern char *readSourceLine (vString *const vLine, MIOPos location, long *const pSeekValue); diff --git a/ctags/parsers/css.c b/ctags/parsers/css.c index 4e0264f85..b84307692 100644 --- a/ctags/parsers/css.c +++ b/ctags/parsers/css.c @@ -62,7 +62,7 @@ static void parseSelector (vString *const string, const int firstChar) vStringPut (string, (char) c); c = getcFromInputFile (); } while (isSelectorChar (c)); - fileUngetc (c); + ungetcToInputFile (c); vStringTerminate (string); } @@ -106,7 +106,7 @@ getNextChar: int d = getcFromInputFile (); if (d != '*') { - fileUngetc (d); + ungetcToInputFile (d); vStringPut (token->string, c); token->type = c; } diff --git a/ctags/parsers/fortran.c b/ctags/parsers/fortran.c index edd1eac38..7e83c10e3 100644 --- a/ctags/parsers/fortran.c +++ b/ctags/parsers/fortran.c @@ -648,7 +648,7 @@ static int getFixedFormChar (void) if (c2 == '\n') longjmp (Exception, (int) ExceptionFixedFormat); else - fileUngetc (c2); + ungetcToInputFile (c2); } } while (Column == 0) @@ -691,7 +691,7 @@ static int getFixedFormChar (void) Column = 0; else if (Column > 6) { - fileUngetc (c); + ungetcToInputFile (c); c = ' '; } break; @@ -734,7 +734,7 @@ static int getFreeFormChar (boolean inComment) advanceLine = TRUE; else { - fileUngetc (c); + ungetcToInputFile (c); c = '&'; } } diff --git a/ctags/parsers/go.c b/ctags/parsers/go.c index 95627a0a6..bd74cc888 100644 --- a/ctags/parsers/go.c +++ b/ctags/parsers/go.c @@ -203,7 +203,7 @@ static void parseIdentifier (vString *const string, const int firstChar) c = getcFromInputFile (); } while (isIdentChar (c)); vStringTerminate (string); - fileUngetc (c); /* always unget, LF might add a semicolon */ + ungetcToInputFile (c); /* always unget, LF might add a semicolon */ } static void readToken (tokenInfo *const token) @@ -264,7 +264,7 @@ getNextChar: * continue through the next * newline. A line comment acts * like a newline. */ - fileUngetc ('\n'); + ungetcToInputFile ('\n'); goto getNextChar; case '*': do @@ -282,14 +282,14 @@ getNextChar: if (c == '/') break; else - fileUngetc (c); + ungetcToInputFile (c); } while (c != EOF && c != '\0'); - fileUngetc (hasNewline ? '\n' : ' '); + ungetcToInputFile (hasNewline ? '\n' : ' '); goto getNextChar; default: token->type = TOKEN_OTHER; - fileUngetc (d); + ungetcToInputFile (d); break; } } @@ -311,7 +311,7 @@ getNextChar: token->type = TOKEN_LEFT_ARROW; else { - fileUngetc (d); + ungetcToInputFile (d); token->type = TOKEN_OTHER; } } diff --git a/ctags/parsers/haskell.c b/ctags/parsers/haskell.c index 82031a6fd..73617fe35 100644 --- a/ctags/parsers/haskell.c +++ b/ctags/parsers/haskell.c @@ -81,7 +81,7 @@ static int get_next_char(void) nxt = getcFromInputFile(); if (nxt == EOF) return c; - fileUngetc(nxt); + ungetcToInputFile(nxt); if (c == '-' && nxt == '-') { skip_rest_of_line(); @@ -127,7 +127,7 @@ static int get_token(char *token, int n) if (c == EOF) return 0; if (i != n) { - fileUngetc(c); + ungetcToInputFile(c); return 1; } else { return 0; diff --git a/ctags/parsers/jscript.c b/ctags/parsers/jscript.c index 31383720b..3ec392b18 100644 --- a/ctags/parsers/jscript.c +++ b/ctags/parsers/jscript.c @@ -357,7 +357,7 @@ static void parseString (vString *const string, const int delimiter) { c = getcFromInputFile(); if (c != '\n') - fileUngetc (c); + ungetcToInputFile (c); } } else if (c == delimiter) @@ -368,7 +368,7 @@ static void parseString (vString *const string, const int delimiter) end = TRUE; /* we don't want to eat the newline itself to let the automatic * semicolon insertion code kick in */ - fileUngetc (c); + ungetcToInputFile (c); } else vStringPut (string, c); @@ -390,7 +390,7 @@ static void parseRegExp (void) { c = getcFromInputFile (); } while (isalpha (c)); - fileUngetc (c); + ungetcToInputFile (c); break; } else if (c == '\\') @@ -415,7 +415,7 @@ static void parseIdentifier (vString *const string, const int firstChar) c = getcFromInputFile (); } while (isIdentChar (c)); vStringTerminate (string); - fileUngetc (c); /* unget non-identifier character */ + ungetcToInputFile (c); /* unget non-identifier character */ } static keywordId analyzeToken (vString *const name) @@ -480,7 +480,7 @@ getNextChar: token->type = TOKEN_POSTFIX_OPERATOR; else { - fileUngetc (d); + ungetcToInputFile (d); token->type = TOKEN_BINARY_OPERATOR; } break; @@ -547,7 +547,7 @@ getNextChar: case '\\': c = getcFromInputFile (); if (c != '\\' && c != '"' && !isspace (c)) - fileUngetc (c); + ungetcToInputFile (c); token->type = TOKEN_CHARACTER; token->lineNumber = getSourceLineNumber (); token->filePosition = getInputFilePosition (); @@ -559,7 +559,7 @@ getNextChar: if ( (d != '*') && /* is this the start of a comment? */ (d != '/') ) /* is a one line comment? */ { - fileUngetc (d); + ungetcToInputFile (d); switch (LastTokenType) { case TOKEN_CHARACTER: @@ -592,7 +592,7 @@ getNextChar: if (c == '/') break; else - fileUngetc (c); + ungetcToInputFile (c); } while (c != EOF && c != '\0'); goto getNextChar; } @@ -601,7 +601,7 @@ getNextChar: skipToCharacter ('\n'); /* if we care about newlines, put it back so it is seen */ if (include_newlines) - fileUngetc ('\n'); + ungetcToInputFile ('\n'); goto getNextChar; } } @@ -614,7 +614,7 @@ getNextChar: token->type = TOKEN_UNDEFINED; else if ((c = getcFromInputFile ()) != '!') { - fileUngetc (c); + ungetcToInputFile (c); token->type = TOKEN_UNDEFINED; } else diff --git a/ctags/parsers/json.c b/ctags/parsers/json.c index 095ba4bbe..7394257d5 100644 --- a/ctags/parsers/json.c +++ b/ctags/parsers/json.c @@ -200,7 +200,7 @@ static void readTokenFull (tokenInfo *const token, } while (c != EOF && isIdentChar (c)); vStringTerminate (token->string); - fileUngetc (c); + ungetcToInputFile (c); switch (lookupKeyword (vStringValue (token->string), Lang_json)) { case KEYWORD_true: token->type = TOKEN_TRUE; break; diff --git a/ctags/parsers/make.c b/ctags/parsers/make.c index ef47f08ed..1fe561a62 100644 --- a/ctags/parsers/make.c +++ b/ctags/parsers/make.c @@ -58,7 +58,7 @@ static void skipLine (void) c = nextChar (); while (c != EOF && c != '\n'); if (c == '\n') - fileUngetc (c); + ungetcToInputFile (c); } static int skipToNonWhite (int c) @@ -119,7 +119,7 @@ static void readIdentifier (const int first, vString *const id) vStringPut (id, c); c = nextChar (); } - fileUngetc (c); + ungetcToInputFile (c); vStringTerminate (id); } @@ -159,14 +159,14 @@ static void findMakeTags (void) else if (variable_possible && c == '?') { c = nextChar (); - fileUngetc (c); + ungetcToInputFile (c); variable_possible = (c == '='); } else if (variable_possible && c == ':' && stringListCount (identifiers) > 0) { c = nextChar (); - fileUngetc (c); + ungetcToInputFile (c); if (c != '=') { unsigned int i; @@ -207,7 +207,7 @@ static void findMakeTags (void) c = nextChar (); } if (c == '\n') - fileUngetc (c); + ungetcToInputFile (c); vStringTerminate (name); vStringStripTrailing (name); newMacro (name); diff --git a/ctags/parsers/php.c b/ctags/parsers/php.c index 36894eba8..44aa0f389 100644 --- a/ctags/parsers/php.c +++ b/ctags/parsers/php.c @@ -590,14 +590,14 @@ static void parseHeredoc (vString *const string) c = getcFromInputFile (); if (delimiter[len] != 0) - fileUngetc (c); + ungetcToInputFile (c); else { /* line start matched the delimiter, now check whether there * is anything after it */ if (c == '\r' || c == '\n') { - fileUngetc (c); + ungetcToInputFile (c); break; } else if (c == ';') @@ -608,14 +608,14 @@ static void parseHeredoc (vString *const string) /* put back the semicolon since it's not part of the * string. we can't put back the newline, but it's a * whitespace character nobody cares about it anyway */ - fileUngetc (';'); + ungetcToInputFile (';'); break; } else { /* put semicolon in the string and continue */ extra = ';'; - fileUngetc (d); + ungetcToInputFile (d); } } } @@ -634,7 +634,7 @@ static void parseHeredoc (vString *const string) return; error: - fileUngetc (c); + ungetcToInputFile (c); } static void parseIdentifier (vString *const string, const int firstChar) @@ -645,7 +645,7 @@ static void parseIdentifier (vString *const string, const int firstChar) vStringPut (string, (char) c); c = getcFromInputFile (); } while (isIdentChar (c)); - fileUngetc (c); + ungetcToInputFile (c); vStringTerminate (string); } @@ -739,7 +739,7 @@ static int findPhpStart (void) /*