Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc rename the macros ftsent_ since they apply to the f...



details:   https://anonhg.NetBSD.org/src/rev/2ac72aa4409d
branches:  trunk
changeset: 778044:2ac72aa4409d
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Mar 14 00:25:19 2012 +0000

description:
rename the macros ftsent_ since they apply to the ftsent struct not the
fts one.

diffstat:

 lib/libc/compat/gen/compat___fts13.c |  10 ++++++----
 lib/libc/compat/gen/compat___fts30.c |   9 +++++----
 lib/libc/compat/gen/compat___fts31.c |  10 +++++++---
 lib/libc/gen/fts.c                   |  26 +++++++++++++-------------
 4 files changed, 31 insertions(+), 24 deletions(-)

diffs (152 lines):

diff -r ba2129bcbb73 -r 2ac72aa4409d lib/libc/compat/gen/compat___fts13.c
--- a/lib/libc/compat/gen/compat___fts13.c      Tue Mar 13 22:37:51 2012 +0000
+++ b/lib/libc/compat/gen/compat___fts13.c      Wed Mar 14 00:25:19 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat___fts13.c,v 1.8 2012/03/13 22:37:51 joerg Exp $ */
+/*     $NetBSD: compat___fts13.c,v 1.9 2012/03/14 00:25:19 christos Exp $      */
 
 #include "namespace.h"
 #include <sys/cdefs.h>
@@ -33,12 +33,14 @@
 #define        __fts_dev_t     uint32_t
 #define        __fts_level_t   short
 
-#undef fts_namelen_truncate
-#define fts_namelen_truncate(a)        \
+#ifndef ftsent_namelen_truncate
+#define ftsent_namelen_truncate(a)     \
     ((a) > USHRT_MAX ? USHRT_MAX : (unsigned short)(a))
-#undef fts_pathlen_truncate
+#endif
+#ifndef ftsent_pathlen_truncate
 #define ftsent_pathlen_truncate(a)     \
     ((a) > USHRT_MAX ? USHRT_MAX : (unsigned short)(a))
+#endif
 
 #define        stat            __stat13
 #define        lstat           __lstat13
diff -r ba2129bcbb73 -r 2ac72aa4409d lib/libc/compat/gen/compat___fts30.c
--- a/lib/libc/compat/gen/compat___fts30.c      Tue Mar 13 22:37:51 2012 +0000
+++ b/lib/libc/compat/gen/compat___fts30.c      Wed Mar 14 00:25:19 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat___fts30.c,v 1.5 2012/03/13 22:37:51 joerg Exp $ */
+/*     $NetBSD: compat___fts30.c,v 1.6 2012/03/14 00:25:19 christos Exp $      */
 
 #include "namespace.h"
 #include <sys/cdefs.h>
@@ -36,13 +36,14 @@
 #define        lstat           __lstat30
 #define        fstat           __fstat30
 
-#ifndef fts_namelen_truncate
-#define fts_namelen_truncate(a)        \
+#ifndef ftsent_namelen_truncate
+#define ftsent_namelen_truncate(a)     \
     ((a) > USHRT_MAX ? USHRT_MAX : (unsigned short)(a))
 #endif
-#undef fts_pathlen_truncate
+#ifndef ftsent_pathlen_truncate
 #define ftsent_pathlen_truncate(a)     \
     ((a) > USHRT_MAX ? USHRT_MAX : (unsigned short)(a))
+#endif
 
 #undef fts_children
 #define        fts_children __fts_children30
diff -r ba2129bcbb73 -r 2ac72aa4409d lib/libc/compat/gen/compat___fts31.c
--- a/lib/libc/compat/gen/compat___fts31.c      Tue Mar 13 22:37:51 2012 +0000
+++ b/lib/libc/compat/gen/compat___fts31.c      Wed Mar 14 00:25:19 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat___fts31.c,v 1.3 2012/03/13 21:13:31 christos Exp $      */
+/*     $NetBSD: compat___fts31.c,v 1.4 2012/03/14 00:25:19 christos Exp $      */
 
 #include "namespace.h"
 #include <sys/cdefs.h>
@@ -31,8 +31,12 @@
 #define        __fts_dev_t     uint32_t
 #define        __fts_level_t   short
 
-#ifndef fts_namelen_truncate
-#define fts_namelen_truncate(a)        \
+#ifndef ftsent_namelen_truncate
+#define ftsent_namelen_truncate(a)     \
+    ((a) > USHRT_MAX ? USHRT_MAX : (unsigned short)(a))
+#endif
+#ifndef ftsent_pathlen_truncate
+#define ftsent_pathlen_truncate(a)     \
     ((a) > USHRT_MAX ? USHRT_MAX : (unsigned short)(a))
 #endif
 
diff -r ba2129bcbb73 -r 2ac72aa4409d lib/libc/gen/fts.c
--- a/lib/libc/gen/fts.c        Tue Mar 13 22:37:51 2012 +0000
+++ b/lib/libc/gen/fts.c        Wed Mar 14 00:25:19 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fts.c,v 1.43 2012/03/13 21:13:35 christos Exp $        */
+/*     $NetBSD: fts.c,v 1.44 2012/03/14 00:25:19 christos Exp $        */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)fts.c      8.6 (Berkeley) 8/14/94";
 #else
-__RCSID("$NetBSD: fts.c,v 1.43 2012/03/13 21:13:35 christos Exp $");
+__RCSID("$NetBSD: fts.c,v 1.44 2012/03/14 00:25:19 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -79,20 +79,20 @@
 #undef FTS_ALLOC_ALIGNED
 #endif
 
-#ifndef fts_namelen_truncate
-#define fts_namelen_truncate(a)        \
+#ifndef ftsent_namelen_truncate
+#define ftsent_namelen_truncate(a)     \
+    ((a) > UINT_MAX ? UINT_MAX : (unsigned int)(a))
+#endif
+#ifndef ftsent_pathlen_truncate
+#define ftsent_pathlen_truncate(a) \
     ((a) > UINT_MAX ? UINT_MAX : (unsigned int)(a))
 #endif
 #ifndef fts_pathlen_truncate
 #define fts_pathlen_truncate(a)        \
     ((a) > UINT_MAX ? UINT_MAX : (unsigned int)(a))
 #endif
-#ifndef ftsent_pathlen_truncate
-#define ftsent_pathlen_truncate(a) \
-    ((a) > UINT_MAX ? UINT_MAX : (unsigned int)(a))
-#endif
-#ifndef ftsent_nitems_truncate
-#define ftsent_nitems_truncate(a) \
+#ifndef fts_nitems_truncate
+#define fts_nitems_truncate(a) \
     ((a) > UINT_MAX ? UINT_MAX : (unsigned int)(a))
 #endif
 
@@ -252,7 +252,7 @@
        if ((cp = strrchr(p->fts_name, '/')) && (cp != p->fts_name || cp[1])) {
                len = strlen(++cp);
                memmove(p->fts_name, cp, len + 1);
-               p->fts_namelen = fts_namelen_truncate(len);
+               p->fts_namelen = ftsent_namelen_truncate(len);
        }
        p->fts_accpath = p->fts_path = sp->fts_path;
        sp->fts_dev = p->fts_dev;
@@ -1011,7 +1011,7 @@
                if (new == 0)
                        return (head);
                sp->fts_array = new;
-               sp->fts_nitems = ftsent_nitems_truncate(nitems + 40);
+               sp->fts_nitems = fts_nitems_truncate(nitems + 40);
        }
        for (ap = sp->fts_array, p = head; p; p = p->fts_link)
                *ap++ = p;
@@ -1069,7 +1069,7 @@
        /* Copy the name plus the trailing NULL. */
        memmove(p->fts_name, name, namelen + 1);
 
-       p->fts_namelen = fts_namelen_truncate(namelen);
+       p->fts_namelen = ftsent_namelen_truncate(namelen);
        p->fts_path = sp->fts_path;
        p->fts_errno = 0;
        p->fts_flags = 0;



Home | Main Index | Thread Index | Old Index