Patchwork [review] Make startswith return a bool

login
register
mail settings
Submitter Simon Marchi (Code Review)
Date Oct. 19, 2019, 8:53 p.m.
Message ID <gerrit.1571518408000.I1c11b9bb7f89b3885c1bb55097adb5be6d333ad4@gnutoolchain-gerrit.osci.io>
Download mbox | patch
Permalink /patch/35161/
State New
Headers show

Comments

Simon Marchi (Code Review) - Oct. 19, 2019, 8:53 p.m.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/162
......................................................................

Make startswith return a bool

gdb/ChangeLog:

	* gdbsupport/common-utils.h (startswith): Change return type to
	bool.

Change-Id: I1c11b9bb7f89b3885c1bb55097adb5be6d333ad4
---
M gdb/gdbsupport/common-utils.h
1 file changed, 2 insertions(+), 3 deletions(-)

Patch

diff --git a/gdb/gdbsupport/common-utils.h b/gdb/gdbsupport/common-utils.h
index a5312cb..e96fc21 100644
--- a/gdb/gdbsupport/common-utils.h
+++ b/gdb/gdbsupport/common-utils.h
@@ -110,10 +110,9 @@ 
 
 extern char *safe_strerror (int);
 
-/* Return non-zero if the start of STRING matches PATTERN, zero
-   otherwise.  */
+/* Return true if the start of STRING matches PATTERN, false otherwise.  */
 
-static inline int
+static inline bool
 startswith (const char *string, const char *pattern)
 {
   return strncmp (string, pattern, strlen (pattern)) == 0;