Skip to content

Commit e0db176

Browse files
sprohaskagitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5b59708 commit e0db176

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

utf8.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ static size_t display_mode_esc_sequence_len(const char *s)
323323
* If indent is negative, assume that already -indent columns have been
324324
* consumed (and no extra indent is necessary for the first line).
325325
*/
326-
int strbuf_add_wrapped_text(struct strbuf *buf,
326+
void strbuf_add_wrapped_text(struct strbuf *buf,
327327
const char *text, int indent1, int indent2, int width)
328328
{
329329
int indent, w, assume_utf8 = 1;
@@ -332,7 +332,7 @@ int strbuf_add_wrapped_text(struct strbuf *buf,
332332

333333
if (width <= 0) {
334334
strbuf_add_indented_text(buf, text, indent1, indent2);
335-
return 1;
335+
return;
336336
}
337337

338338
retry:
@@ -356,14 +356,14 @@ int strbuf_add_wrapped_text(struct strbuf *buf,
356356
if (w <= width || !space) {
357357
const char *start = bol;
358358
if (!c && text == start)
359-
return w;
359+
return;
360360
if (space)
361361
start = space;
362362
else
363363
strbuf_addchars(buf, ' ', indent);
364364
strbuf_add(buf, start, text - start);
365365
if (!c)
366-
return w;
366+
return;
367367
space = text;
368368
if (c == '\t')
369369
w |= 0x07;
@@ -405,13 +405,12 @@ int strbuf_add_wrapped_text(struct strbuf *buf,
405405
}
406406
}
407407

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,
409409
int indent, int indent2, int width)
410410
{
411411
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);
413413
free(tmp);
414-
return r;
415414
}
416415

417416
int is_encoding_utf8(const char *name)

utf8.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ int utf8_strwidth(const char *string);
88
int is_utf8(const char *text);
99
int is_encoding_utf8(const char *name);
1010

11-
int strbuf_add_wrapped_text(struct strbuf *buf,
11+
void strbuf_add_wrapped_text(struct strbuf *buf,
1212
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,
1414
int indent, int indent2, int width);
1515

1616
#ifndef NO_ICONV

0 commit comments

Comments
 (0)