git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] strbuf_add_wrapped*(): Remove unused return value

From
Steffen Prohaska <prohaska@zib.de>
Date
Dec 11, 2012, 05:59 UTC
Message-ID
<1355205562-23459-3-git-send-email-prohaska@zib.de>
In-Reply-To
<1355205562-23459-1-git-send-email-prohaska@zib.de>

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>
---
 utf8.c | 13 ++++++-------
 utf8.h |  4 ++--
 2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/utf8.c b/utf8.c
index 5c61bbe..a4ee665 100644
--- a/utf8.c
+++ b/utf8.c
@@ -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
  * 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)
 {
 	int indent, w, assume_utf8 = 1;
@@ -332,7 +332,7 @@ int strbuf_add_wrapped_text(struct strbuf *buf,
 
 	if (width <= 0) {
 		strbuf_add_indented_text(buf, text, indent1, indent2);
-		return 1;
+		return;
 	}
 
 retry:
@@ -356,14 +356,14 @@ retry:
 			if (w <= width || !space) {
 				const char *start = bol;
 				if (!c && text == start)
-					return w;
+					return;
 				if (space)
 					start = space;
 				else
 					strbuf_addchars(buf, ' ', indent);
 				strbuf_add(buf, start, text - start);
 				if (!c)
-					return w;
+					return;
 				space = text;
 				if (c == '\t')
 					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)
 {
 	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);
-	return r;
 }
 
 int is_encoding_utf8(const char *name)
diff --git a/utf8.h b/utf8.h
index 93ef600..a214238 100644
--- a/utf8.h
+++ b/utf8.h
@@ -9,9 +9,9 @@ int is_utf8(const char *text);
 int is_encoding_utf8(const char *name);
 int same_encoding(const char *, const char *);
 
-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);
-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);
 
 #ifndef NO_ICONV
-- 
1.8.1.rc1.2.gfb98a3a
Previous: Jan H. Schönherr
Message 6 of 6 in “shortlog: Fix wrapping lines of wraplen (was broken since recent off-by-one fix)”
  1. shortlog: Fix wrapping lines of wraplen (was broken since recent off-by-one fix)Steffen Prohaska, Dec 8, 2012
  2. Junio C HamanoDec 9, 2012
  3. 0/2 Re: [PATCH] shortlog: Fix wrapping lines of wraplenSteffen Prohaska, Dec 11, 2012
  4. 1/2 shortlog: Fix wrapping lines of wraplen (was broken since recent off-by-one fix)Steffen Prohaska, Dec 11, 2012
  5. Jan H. SchönherrDec 11, 2012
  6. 2/2 strbuf_add_wrapped*(): Remove unused return valueSteffen Prohaska, Dec 11, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.