strbuf_add_wrapped*(): Remove unused return value

Since shortlog isn't using the return value anymore (see previous
commit), the functions can be changed to void.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Steffen Prohaska 2012-12-11 06:59:22 +01:00 committed by Junio C Hamano
parent 5b59708268
commit e0db1765c3
2 changed files with 8 additions and 9 deletions

13
utf8.c
View File

@ -323,7 +323,7 @@ static size_t display_mode_esc_sequence_len(const char *s)
* If indent is negative, assume that already -indent columns have been * If indent is negative, assume that already -indent columns have been
* consumed (and no extra indent is necessary for the first line). * consumed (and no extra indent is necessary for the first line).
*/ */
int strbuf_add_wrapped_text(struct strbuf *buf, void strbuf_add_wrapped_text(struct strbuf *buf,
const char *text, int indent1, int indent2, int width) const char *text, int indent1, int indent2, int width)
{ {
int indent, w, assume_utf8 = 1; int indent, w, assume_utf8 = 1;
@ -332,7 +332,7 @@ int strbuf_add_wrapped_text(struct strbuf *buf,
if (width <= 0) { if (width <= 0) {
strbuf_add_indented_text(buf, text, indent1, indent2); strbuf_add_indented_text(buf, text, indent1, indent2);
return 1; return;
} }
retry: retry:
@ -356,14 +356,14 @@ retry:
if (w <= width || !space) { if (w <= width || !space) {
const char *start = bol; const char *start = bol;
if (!c && text == start) if (!c && text == start)
return w; return;
if (space) if (space)
start = space; start = space;
else else
strbuf_addchars(buf, ' ', indent); strbuf_addchars(buf, ' ', indent);
strbuf_add(buf, start, text - start); strbuf_add(buf, start, text - start);
if (!c) if (!c)
return w; return;
space = text; space = text;
if (c == '\t') if (c == '\t')
w |= 0x07; w |= 0x07;
@ -405,13 +405,12 @@ new_line:
} }
} }
int strbuf_add_wrapped_bytes(struct strbuf *buf, const char *data, int len, void strbuf_add_wrapped_bytes(struct strbuf *buf, const char *data, int len,
int indent, int indent2, int width) int indent, int indent2, int width)
{ {
char *tmp = xstrndup(data, len); char *tmp = xstrndup(data, len);
int r = strbuf_add_wrapped_text(buf, tmp, indent, indent2, width); strbuf_add_wrapped_text(buf, tmp, indent, indent2, width);
free(tmp); free(tmp);
return r;
} }
int is_encoding_utf8(const char *name) int is_encoding_utf8(const char *name)

4
utf8.h
View File

@ -8,9 +8,9 @@ int utf8_strwidth(const char *string);
int is_utf8(const char *text); int is_utf8(const char *text);
int is_encoding_utf8(const char *name); int is_encoding_utf8(const char *name);
int strbuf_add_wrapped_text(struct strbuf *buf, void strbuf_add_wrapped_text(struct strbuf *buf,
const char *text, int indent, int indent2, int width); const char *text, int indent, int indent2, int width);
int strbuf_add_wrapped_bytes(struct strbuf *buf, const char *data, int len, void strbuf_add_wrapped_bytes(struct strbuf *buf, const char *data, int len,
int indent, int indent2, int width); int indent, int indent2, int width);
#ifndef NO_ICONV #ifndef NO_ICONV