public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-889] d: Use startswith function instead of strncmp
@ 2021-05-18 21:01 Iain Buclaw
  0 siblings, 0 replies; only message in thread
From: Iain Buclaw @ 2021-05-18 21:01 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:f87ce01441881cbb3093e3ddace875c0ed23e595

commit r12-889-gf87ce01441881cbb3093e3ddace875c0ed23e595
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Tue May 18 22:56:10 2021 +0200

    d: Use startswith function instead of strncmp
    
    gcc/d/ChangeLog:
    
            * types.cc (TypeVisitor::visit (TypeEnum *)): Use startswith function
            instead of strncmp.

Diff:
---
 gcc/d/types.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/d/types.cc b/gcc/d/types.cc
index 3b121f5b042..ba2d6d4dc66 100644
--- a/gcc/d/types.cc
+++ b/gcc/d/types.cc
@@ -874,7 +874,7 @@ public:
 	Type *underlying = NULL;
 
 	/* Skip over the prefixing `__c_'.  */
-	gcc_assert (strncmp (ident, "__c_", strlen ("__c_")) == 0);
+	gcc_assert (startswith (ident, "__c_"));
 	ident = ident + strlen ("__c_");
 
 	/* To keep things compatible within the code generation we stick to


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-18 21:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 21:01 [gcc r12-889] d: Use startswith function instead of strncmp Iain Buclaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).