Remove nonnullret deadcode: xmalloc & xrealloc.

This commit is contained in:
Eliseo Martínez 2015-01-23 15:02:51 +01:00
parent 00f18e2e09
commit 5deb06597c

View File

@ -1649,7 +1649,6 @@ static void cs_print_tags_priv(char **matches, char **cntxts, int num_matches)
char *cntxformat = " <<%s>>"; char *cntxformat = " <<%s>>";
char *context; char *context;
char *cstag_msg = _("Cscope tag: %s"); char *cstag_msg = _("Cscope tag: %s");
char *csfmt_str = "%4d %6s ";
assert (num_matches > 0); assert (num_matches > 0);
@ -1691,17 +1690,15 @@ static void cs_print_tags_priv(char **matches, char **cntxts, int num_matches)
lno[strlen(lno)-2] = '\0'; /* ignore ;" at the end */ lno[strlen(lno)-2] = '\0'; /* ignore ;" at the end */
const char *csfmt_str = "%4d %6s ";
/* hopefully 'num' (num of matches) will be less than 10^16 */ /* hopefully 'num' (num of matches) will be less than 10^16 */
newsize = strlen(csfmt_str) + 16 + strlen(lno); newsize = strlen(csfmt_str) + 16 + strlen(lno);
if (bufsize < newsize) { if (bufsize < newsize) {
buf = xrealloc(buf, newsize); buf = xrealloc(buf, newsize);
bufsize = newsize; bufsize = newsize;
} }
if (buf != NULL) {
/* csfmt_str = "%4d %6s "; */
(void)sprintf(buf, csfmt_str, num, lno); (void)sprintf(buf, csfmt_str, num, lno);
MSG_PUTS_ATTR(buf, hl_attr(HLF_CM)); MSG_PUTS_ATTR(buf, hl_attr(HLF_CM));
}
MSG_PUTS_LONG_ATTR(cs_pathcomponents(fname), hl_attr(HLF_CM)); MSG_PUTS_LONG_ATTR(cs_pathcomponents(fname), hl_attr(HLF_CM));
/* compute the required space for the context */ /* compute the required space for the context */
@ -1715,7 +1712,6 @@ static void cs_print_tags_priv(char **matches, char **cntxts, int num_matches)
buf = xrealloc(buf, newsize); buf = xrealloc(buf, newsize);
bufsize = newsize; bufsize = newsize;
} }
if (buf != NULL) {
(void)sprintf(buf, cntxformat, context); (void)sprintf(buf, cntxformat, context);
/* print the context only if it fits on the same line */ /* print the context only if it fits on the same line */
@ -1724,7 +1720,6 @@ static void cs_print_tags_priv(char **matches, char **cntxts, int num_matches)
msg_advance(12); msg_advance(12);
MSG_PUTS_LONG(buf); MSG_PUTS_LONG(buf);
msg_putchar('\n'); msg_putchar('\n');
}
if (extra != NULL) { if (extra != NULL) {
msg_advance(13); msg_advance(13);
MSG_PUTS_LONG(extra); MSG_PUTS_LONG(extra);