Module Name:    src
Committed By:   martin
Date:           Sun Apr 28 13:19:21 UTC 2024

Modified Files:
        src/external/gpl3/gcc/dist/gcc/cp [netbsd-10]: cfns.h
        src/usr.sbin/mtree [netbsd-10]: create.c

Log Message:
Pull up following revision(s) (requested by hgutch in ticket #677):

        usr.sbin/mtree/create.c: revision 1.78
        external/gpl3/gcc.old/dist/gcc/cp/cfns.h: revision 1.12
        (applied to external/gpl3/gcc/dist/gcc/cp/cfns.h)

For the NetBSD tools build we provide our own fts.h not FreeBSD's so the
comparator should have the NetBSD signature.

Fix gcc build on FreeBSD 14 (and possibly other systems using clang >= 16).
Pointed out by Eirik �verby.
OK mrg@


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.6.1 src/external/gpl3/gcc/dist/gcc/cp/cfns.h
cvs rdiff -u -r1.76 -r1.76.10.1 src/usr.sbin/mtree/create.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/cp/cfns.h
diff -u src/external/gpl3/gcc/dist/gcc/cp/cfns.h:1.7 src/external/gpl3/gcc/dist/gcc/cp/cfns.h:1.7.6.1
--- src/external/gpl3/gcc/dist/gcc/cp/cfns.h:1.7	Sun Apr 11 00:02:15 2021
+++ src/external/gpl3/gcc/dist/gcc/cp/cfns.h	Sun Apr 28 13:19:21 2024
@@ -60,7 +60,7 @@ public:
 };
 
 inline unsigned int
-libc_name::hash (register const char *str, register unsigned int len)
+libc_name::hash (const char *str, unsigned int len)
 {
   static const unsigned short asso_values[] =
     {
@@ -91,7 +91,7 @@ libc_name::hash (register const char *st
       1488, 1488, 1488, 1488, 1488, 1488, 1488, 1488, 1488, 1488,
       1488, 1488, 1488, 1488, 1488, 1488, 1488
     };
-  register int hval = len;
+  int hval = len;
 
   switch (hval)
     {
@@ -118,7 +118,7 @@ libc_name::hash (register const char *st
 }
 
 const struct libc_name_struct *
-libc_name::libc_name_p (register const char *str, register unsigned int len)
+libc_name::libc_name_p (const char *str, unsigned int len)
 {
   enum
     {
@@ -1116,15 +1116,15 @@ libc_name::libc_name_p (register const c
 
   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
     {
-      register int key = hash (str, len);
+      int key = hash (str, len);
 
       if (key <= MAX_HASH_VALUE && key >= 0)
         {
-          register int index = lookup[key];
+          int index = lookup[key];
 
           if (index >= 0)
             {
-              register const char *s = wordlist[index].name;
+              const char *s = wordlist[index].name;
 
               if (*str == *s && !strcmp (str + 1, s + 1))
                 return &wordlist[index];

Index: src/usr.sbin/mtree/create.c
diff -u src/usr.sbin/mtree/create.c:1.76 src/usr.sbin/mtree/create.c:1.76.10.1
--- src/usr.sbin/mtree/create.c:1.76	Sun Nov 18 23:03:36 2018
+++ src/usr.sbin/mtree/create.c	Sun Apr 28 13:19:21 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: create.c,v 1.76 2018/11/18 23:03:36 sevan Exp $	*/
+/*	$NetBSD: create.c,v 1.76.10.1 2024/04/28 13:19:21 martin Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)create.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: create.c,v 1.76 2018/11/18 23:03:36 sevan Exp $");
+__RCSID("$NetBSD: create.c,v 1.76.10.1 2024/04/28 13:19:21 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -84,7 +84,7 @@ static uid_t uid;
 static mode_t mode;
 static u_long flags;
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) && !defined(HAVE_NBTOOL_CONFIG_H)
 #define	FTS_CONST const
 #else
 #define	FTS_CONST

Reply via email to