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>
Steffen Prohaska committed
Dec 11, 2012 at 06:59 UTC
e0db1765c3bb108b55ebf82b4e5962f9d1f5e5b7
2 files changed
+8
-9
utf8.c
+6
-7
@@ -323,7 +323,7 @@ static size_t display_mode_esc_sequence_len(const char *s)
323
* If indent is negative, assume that already -indent columns have been
324
* consumed (and no extra indent is necessary for the first line).
325
*/
326
-int strbuf_add_wrapped_text(struct strbuf *buf,
326
+void strbuf_add_wrapped_text(struct strbuf *buf,
327
const char *text, int indent1, int indent2, int width)
328
{
329
int indent, w, assume_utf8 = 1;
@@ -332,7 +332,7 @@ int strbuf_add_wrapped_text(struct strbuf *buf,
332
333
if (width <= 0) {
334
strbuf_add_indented_text(buf, text, indent1, indent2);
335
- return 1;
335
+ return;
336
}
337
338
retry:
@@ -356,14 +356,14 @@ retry:
356
if (w <= width || !space) {
357
const char *start = bol;
358
if (!c && text == start)
359
- return w;
359
+ return;
360
if (space)
361
start = space;
362
else
363
strbuf_addchars(buf, ' ', indent);
364
strbuf_add(buf, start, text - start);
365
if (!c)
366
- return w;
366
+ return;
367
space = text;
368
if (c == '\t')
369
w |= 0x07;
@@ -405,13 +405,12 @@ new_line:
405
}
406
}
407
408
-int strbuf_add_wrapped_bytes(struct strbuf *buf, const char *data, int len,
408
+void strbuf_add_wrapped_bytes(struct strbuf *buf, const char *data, int len,
409
int indent, int indent2, int width)
410
{
411
char *tmp = xstrndup(data, len);
412
- int r = strbuf_add_wrapped_text(buf, tmp, indent, indent2, width);
412
+ strbuf_add_wrapped_text(buf, tmp, indent, indent2, width);
413
free(tmp);
414
- return r;
414
}
415
416
int is_encoding_utf8(const char *name)
utf8.h
+2
-2
@@ -8,9 +8,9 @@ int utf8_strwidth(const char *string);
8
int is_utf8(const char *text);
9
int is_encoding_utf8(const char *name);
10
11
-int strbuf_add_wrapped_text(struct strbuf *buf,
11
+void strbuf_add_wrapped_text(struct strbuf *buf,
12
const char *text, int indent, int indent2, int width);
13
-int strbuf_add_wrapped_bytes(struct strbuf *buf, const char *data, int len,
13
+void strbuf_add_wrapped_bytes(struct strbuf *buf, const char *data, int len,
14
int indent, int indent2, int width);
15
16
#ifndef NO_ICONV