aboutsummaryrefslogtreecommitdiff
path: root/ld/ldbuildid.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2021-03-22 14:56:16 +0100
committerMartin Liska <mliska@suse.cz>2021-04-01 15:00:56 +0200
commite9b095a538c189369b4792662ea455d2314b0492 (patch)
tree8a6918add18cd366abcee7964b40605471ce18df /ld/ldbuildid.c
parentd34049e8bb32ae2dd717dbac88dbcebefe2d6c09 (diff)
downloadgdb-e9b095a538c189369b4792662ea455d2314b0492.zip
gdb-e9b095a538c189369b4792662ea455d2314b0492.tar.gz
gdb-e9b095a538c189369b4792662ea455d2314b0492.tar.bz2
Remove strneq macro and use startswith.
bfd/ChangeLog: * ecoff.c (strneq): Remove strneq and use startswith. (_bfd_ecoff_slurp_armap): Likewise. binutils/ChangeLog: * elfcomm.h (strneq): Remove strneq and use startswith. * readelf.c (ia64_process_unwind): Likewise. (process_note): Likewise. gas/ChangeLog: * config/obj-coff.c (strneq): Remove strneq and use startswith. (weak_is_altname): Likewise. (obj_coff_section): Likewise. * config/tc-cr16.c (process_label_constant): Likewise. * config/tc-crx.c (strneq): Likewise. include/ChangeLog: * opcode/cr16.h (strneq): Remove strneq and use startswith. ld/ChangeLog: * ldbuildid.c (strneq): Remove strneq and use startswith. (validate_build_id_style): Likewise. (compute_build_id_size): Likewise. opcodes/ChangeLog: * arm-dis.c (strneq): Remove strneq and use startswith. * cr16-dis.c (print_insn_cr16): Likewise. * score-dis.c (streq): Likewise. (strneq): Likewise. * score7-dis.c (strneq): Likewise.
Diffstat (limited to 'ld/ldbuildid.c')
-rw-r--r--ld/ldbuildid.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ld/ldbuildid.c b/ld/ldbuildid.c
index c0e91bc..0642ec0 100644
--- a/ld/ldbuildid.c
+++ b/ld/ldbuildid.c
@@ -30,13 +30,12 @@
#endif
#define streq(a,b) strcmp ((a), (b)) == 0
-#define strneq(a,b,n) strncmp ((a), (b), (n)) == 0
bool
validate_build_id_style (const char *style)
{
if ((streq (style, "md5")) || (streq (style, "sha1"))
- || (streq (style, "uuid")) || (strneq (style, "0x", 2)))
+ || (streq (style, "uuid")) || (startswith (style, "0x")))
return true;
return false;
@@ -51,7 +50,7 @@ compute_build_id_size (const char *style)
if (streq (style, "sha1"))
return 160 / 8;
- if (strneq (style, "0x", 2))
+ if (startswith (style, "0x"))
{
bfd_size_type size = 0;
/* ID is in string form (hex). Count the bytes. */
@@ -156,7 +155,7 @@ generate_build_id (bfd *abfd,
(size_t) size < sizeof (UUID) ? (size_t) size : sizeof (UUID));
#endif /* __MINGW32__ */
}
- else if (strneq (style, "0x", 2))
+ else if (startswith (style, "0x"))
{
/* ID is in string form (hex). Convert to bits. */
const char *id = style + 2;