mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 9.0.0925: two conditions are always false
Problem: Two conditions are always false. Solution: Remove the conditions. Update return value types to make clear what could be returned. (closes #11593)
This commit is contained in:
58
src/tag.c
58
src/tag.c
@@ -202,7 +202,7 @@ free_tagfunc_option(void)
|
|||||||
|
|
||||||
#if defined(FEAT_EVAL) || defined(PROTO)
|
#if defined(FEAT_EVAL) || defined(PROTO)
|
||||||
/*
|
/*
|
||||||
* Mark the global 'tagfunc' callback with 'copyID' so that it is not garbage
|
* Mark the global 'tagfunc' callback with "copyID" so that it is not garbage
|
||||||
* collected.
|
* collected.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
@@ -1773,7 +1773,7 @@ findtags_in_help_init(findtags_state_T *st)
|
|||||||
int i;
|
int i;
|
||||||
char_u *s;
|
char_u *s;
|
||||||
|
|
||||||
// Keep 'en' as the language if the file extension is '.txt'
|
// Keep "en" as the language if the file extension is ".txt"
|
||||||
if (st->is_txt)
|
if (st->is_txt)
|
||||||
STRCPY(st->help_lang, "en");
|
STRCPY(st->help_lang, "en");
|
||||||
else
|
else
|
||||||
@@ -1883,9 +1883,9 @@ emacs_tags_incstack_free(void)
|
|||||||
/*
|
/*
|
||||||
* Emacs tags line with CTRL-L: New file name on next line.
|
* Emacs tags line with CTRL-L: New file name on next line.
|
||||||
* The file name is followed by a ','. Remember etag file name in ebuf.
|
* The file name is followed by a ','. Remember etag file name in ebuf.
|
||||||
* The FILE pointer to the tags file is stored in 'st->fp'. If another tags
|
* The FILE pointer to the tags file is stored in "st->fp". If another tags
|
||||||
* file is included, then the FILE pointer to the new tags file is stored in
|
* file is included, then the FILE pointer to the new tags file is stored in
|
||||||
* 'st->fp'. The old file pointer is saved in incstack.
|
* "st->fp". The old file pointer is saved in incstack.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
emacs_tags_new_filename(findtags_state_T *st)
|
emacs_tags_new_filename(findtags_state_T *st)
|
||||||
@@ -2131,7 +2131,7 @@ findtags_get_next_line(findtags_state_T *st, tagsearch_info_T *sinfo_p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parse a tags file header line in 'st->lbuf'.
|
* Parse a tags file header line in "st->lbuf".
|
||||||
* Returns TRUE if the current line in st->lbuf is not a tags header line and
|
* Returns TRUE if the current line in st->lbuf is not a tags header line and
|
||||||
* should be parsed as a regular tag line. Returns FALSE if the line is a
|
* should be parsed as a regular tag line. Returns FALSE if the line is a
|
||||||
* header line and the next header line should be read.
|
* header line and the next header line should be read.
|
||||||
@@ -2254,10 +2254,16 @@ findtags_start_state_handler(
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Parse a tag line read from a tags file.
|
* Parse a tag line read from a tags file.
|
||||||
* Returns OK if a tags line is successfully parsed.
|
* Also compares the tag name in "tagpp->tagname" with a search pattern in
|
||||||
* Returns FAIL if a format error is encountered.
|
* "st->orgpat->head" as a quick check if the tag may match.
|
||||||
|
* Returns:
|
||||||
|
* - TAG_MATCH_SUCCESS if the tag may match
|
||||||
|
* - TAG_MATCH_FAIL if the tag doesn't match
|
||||||
|
* - TAG_MATCH_NEXT to look for the next matching tag (used in a binary search)
|
||||||
|
* - TAG_MATCH_STOP if all the tags are processed without a match. Uses the
|
||||||
|
* values in "margs" for doing the comparison.
|
||||||
*/
|
*/
|
||||||
static int
|
static tagmatch_status_T
|
||||||
findtags_parse_line(
|
findtags_parse_line(
|
||||||
findtags_state_T *st,
|
findtags_state_T *st,
|
||||||
tagptrs_T *tagpp,
|
tagptrs_T *tagpp,
|
||||||
@@ -2424,14 +2430,12 @@ findtags_matchargs_init(findtags_match_args_T *margs, int flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Compares the tag name in 'tagpp->tagname' with a search pattern in
|
* Compares the tag name in "tagpp->tagname" with a search pattern in
|
||||||
* 'st->orgpat.head'.
|
* "st->orgpat->pat".
|
||||||
* Returns TAG_MATCH_SUCCESS if the tag matches, TAG_MATCH_FAIL if the tag
|
* Returns TRUE if the tag matches, FALSE if the tag doesn't match.
|
||||||
* doesn't match, TAG_MATCH_NEXT to look for the next matching tag (used in a
|
* Uses the values in "margs" for doing the comparison.
|
||||||
* binary search) and TAG_MATCH_STOP if all the tags are processed without a
|
|
||||||
* match. Uses the values in 'margs' for doing the comparison.
|
|
||||||
*/
|
*/
|
||||||
static tagmatch_status_T
|
static int
|
||||||
findtags_match_tag(
|
findtags_match_tag(
|
||||||
findtags_state_T *st,
|
findtags_state_T *st,
|
||||||
tagptrs_T *tagpp,
|
tagptrs_T *tagpp,
|
||||||
@@ -2487,11 +2491,11 @@ findtags_match_tag(
|
|||||||
margs->match_re = TRUE;
|
margs->match_re = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return match ? TAG_MATCH_SUCCESS : TAG_MATCH_FAIL;
|
return match;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert the encoding of a line read from a tags file in 'st->lbuf'.
|
* Convert the encoding of a line read from a tags file in "st->lbuf".
|
||||||
* Converting the pattern from 'enc' to the tags file encoding doesn't work,
|
* Converting the pattern from 'enc' to the tags file encoding doesn't work,
|
||||||
* because characters are not recognized. The converted line is saved in
|
* because characters are not recognized. The converted line is saved in
|
||||||
* st->lbuf.
|
* st->lbuf.
|
||||||
@@ -2756,7 +2760,7 @@ findtags_add_match(
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Read and get all the tags from file st->tag_fname.
|
* Read and get all the tags from file st->tag_fname.
|
||||||
* Sets 'st->stop_searching' to TRUE to stop searching for additional tags.
|
* Sets "st->stop_searching" to TRUE to stop searching for additional tags.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
findtags_get_all_tags(
|
findtags_get_all_tags(
|
||||||
@@ -2885,14 +2889,8 @@ line_read_in:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = findtags_match_tag(st, &tagp, margs);
|
|
||||||
if (retval == TAG_MATCH_NEXT)
|
|
||||||
continue;
|
|
||||||
if (retval == TAG_MATCH_STOP)
|
|
||||||
break;
|
|
||||||
|
|
||||||
// If a match is found, add it to ht_match[] and ga_match[].
|
// If a match is found, add it to ht_match[] and ga_match[].
|
||||||
if (retval == TAG_MATCH_SUCCESS)
|
if (findtags_match_tag(st, &tagp, margs))
|
||||||
{
|
{
|
||||||
if (findtags_add_match(st, &tagp, margs, buf_ffname, &hash)
|
if (findtags_add_match(st, &tagp, margs, buf_ffname, &hash)
|
||||||
== FAIL)
|
== FAIL)
|
||||||
@@ -2902,10 +2900,10 @@ line_read_in:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Search for tags matching 'st->orgpat.pat' in the 'st->tag_fname' tags file.
|
* Search for tags matching "st->orgpat->pat" in the "st->tag_fname" tags file.
|
||||||
* Information needed to search for the tags is in the 'st' state structure.
|
* Information needed to search for the tags is in the "st" state structure.
|
||||||
* The matching tags are returned in 'st'. If an error is encountered, then
|
* The matching tags are returned in "st". If an error is encountered, then
|
||||||
* 'st->stop_searching' is set to TRUE.
|
* "st->stop_searching" is set to TRUE.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
findtags_in_file(findtags_state_T *st, char_u *buf_ffname)
|
findtags_in_file(findtags_state_T *st, char_u *buf_ffname)
|
||||||
@@ -2977,7 +2975,7 @@ findtags_in_file(findtags_state_T *st, char_u *buf_ffname)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copy the tags found by find_tags() to 'matchesp'.
|
* Copy the tags found by find_tags() to "matchesp".
|
||||||
* Returns the number of matches copied.
|
* Returns the number of matches copied.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
|
@@ -695,6 +695,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
925,
|
||||||
/**/
|
/**/
|
||||||
924,
|
924,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user