From: Simon Marchi Date: Sat, 19 Oct 2019 21:00:35 +0000 (-0400) Subject: gdb: Make startswith return a bool X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2377111731972d841731bc674ed6a7fb3ab90a53;p=binutils-gdb.git gdb: Make startswith return a bool gdb/ChangeLog: * gdbsupport/common-utils.h (startswith): Change return type to bool. Change-Id: I1c11b9bb7f89b3885c1bb55097adb5be6d333ad4 --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d8e3fe1a2dc..7c737ac9f41 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2019-10-19 Simon Marchi + + * gdbsupport/common-utils.h (startswith): Change return type to + bool. + 2019-10-19 Christian Biesinger * bcache.c (bcache::print_statistics): Use std::sort instead of qsort. diff --git a/gdb/gdbsupport/common-utils.h b/gdb/gdbsupport/common-utils.h index a5312cb0c49..e96fc21e3f2 100644 --- a/gdb/gdbsupport/common-utils.h +++ b/gdb/gdbsupport/common-utils.h @@ -110,10 +110,9 @@ std::string extract_string_maybe_quoted (const char **arg); 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;