[geany/geany] 40396a: ctags: drop vStringTerminate()

Jiří Techet git-noreply at geany.org
Tue Oct 4 16:06:33 UTC 2016


Branch:      refs/heads/master
Author:      Jiří Techet <techet at gmail.com>
Committer:   Jiří Techet <techet at gmail.com>
Date:        Tue, 04 Oct 2016 16:06:33 UTC
Commit:      40396a392e5239ed79aad79ad1b1f1239670cbe7
             https://github.com/geany/geany/commit/40396a392e5239ed79aad79ad1b1f1239670cbe7

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).


More information about the Commits mailing list