pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/plist-utils/files Expand __arraycount macro -...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/152b11a6cfed
branches:  trunk
changeset: 363432:152b11a6cfed
user:      adam <adam%pkgsrc.org@localhost>
date:      Thu Jun 08 18:14:51 2017 +0000

description:
Expand __arraycount macro - it is not portable

diffstat:

 pkgtools/plist-utils/files/plist_tree.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r a43d58b6bf44 -r 152b11a6cfed pkgtools/plist-utils/files/plist_tree.c
--- a/pkgtools/plist-utils/files/plist_tree.c   Thu Jun 08 14:56:35 2017 +0000
+++ b/pkgtools/plist-utils/files/plist_tree.c   Thu Jun 08 18:14:51 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: plist_tree.c,v 1.1 2016/10/01 18:37:15 kamil Exp $ */
+/* $NetBSD: plist_tree.c,v 1.2 2017/06/08 18:14:51 adam Exp $ */
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: plist_tree.c,v 1.1 2016/10/01 18:37:15 kamil Exp $");
+__RCSID("$NetBSD: plist_tree.c,v 1.2 2017/06/08 18:14:51 adam Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -139,10 +139,10 @@
 
        /* 1. Strip all ${PLIST.option}-like strings */
        ret = regexec(&plist_tree_singleton.plist_regex_options, entry,
-                     __arraycount(rm), rm, 0);
+                     sizeof(rm)/sizeof(rm[0]), rm, 0);
        if (!ret) { /* Something found! */
                /* Set pointer just after the matched string */
-               for(i = 0; i < __arraycount(rm); i++) {
+               for(i = 0; i < sizeof(rm)/sizeof(rm[0]); i++) {
                        if (rm[i].rm_so == -1)
                                break;
 



Home | Main Index | Thread Index | Old Index