Thread (29 messages) read the whole thread 29 messages, 7 authors, 2025-07-22

Re: [PATCH v3 3/3] strbuf: convert predicates to return bool

From: Karthik Nayak <hidden>
Date: 2025-07-16 10:28:16
Subsystem: the rest · Maintainer: Linus Torvalds

Phillip Wood [off-list ref] writes:
From: Phillip Wood <redacted>

Now that the string predicates defined in git-compat-util.h all
return bool let's convert the return type of the string predicates
in strbuf.{c,h} to match them.

Signed-off-by: Phillip Wood <redacted>
---
 strbuf.c | 28 ++++++++++++++--------------
 strbuf.h | 12 ++++++------
 2 files changed, 20 insertions(+), 20 deletions(-)
Nit: same here as the previous patch

$ ./ci/run-style-check.sh @~1
diff --git a/strbuf.c b/strbuf.c
index 6c3851a7f8..d9e040c13b 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -38,7 +38,7 @@ bool starts_with_mem(const char *str, size_t len,
const char *prefix)
 }

 bool skip_to_optional_arg_default(const char *str, const char *prefix,
-				 const char **arg, const char *def)
+				  const char **arg, const char *def)
 {
 	const char *p;
diff --git a/strbuf.h b/strbuf.h
index a580ac6084..d2ff9839a9 100644
--- a/strbuf.h
+++ b/strbuf.h
@@ -679,10 +679,10 @@ bool starts_with_mem(const char *str, size_t
len, const char *prefix);
  * skip_prefix(arg, "--key=", &arg) to parse such an option.
  */
 bool skip_to_optional_arg_default(const char *str, const char *prefix,
-				 const char **arg, const char *def);
+				  const char **arg, const char *def);

 static inline bool skip_to_optional_arg(const char *str, const char *prefix,
-				       const char **arg)
+					const char **arg)
 {
 	return skip_to_optional_arg_default(str, prefix, arg, "");
 }

[snip]

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help