From 371be9703e320352c6f70155881abd759fbeb4f7 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 3 Jun 2019 17:55:15 +0200 Subject: [PATCH] Sync with portableproplib-0.6.8. --- 3RDPARTY | 2 +- lib/portableproplib/prop/prop_array.h | 1 + lib/portableproplib/prop_array.c | 2 -- lib/portableproplib/prop_ingest.c | 6 +++--- lib/portableproplib/prop_number.c | 24 +++++++++++++----------- lib/portableproplib/rb.c | 6 +++--- 6 files changed, 21 insertions(+), 20 deletions(-) diff --git a/3RDPARTY b/3RDPARTY index 52e8f798..79ad40ea 100644 --- a/3RDPARTY +++ b/3RDPARTY @@ -17,5 +17,5 @@ internal use in the code: - libfetch-2.34 from NetBSD (pkgsrc/net/libfetch): lib/fetch -- portableproplib-0.6.4 (lib/portableproplib) from +- portableproplib-0.6.8 (lib/portableproplib) from https://github.com/xtraeme/portableproplib diff --git a/lib/portableproplib/prop/prop_array.h b/lib/portableproplib/prop/prop_array.h index 684c68f6..436ee3b3 100644 --- a/lib/portableproplib/prop/prop_array.h +++ b/lib/portableproplib/prop/prop_array.h @@ -1,6 +1,7 @@ /* $NetBSD: prop_array.h,v 1.8 2008/09/11 13:15:13 haad Exp $ */ /*- + * Copyright (c) 2014 Juan Romero Pardines. * Copyright (c) 2006 The NetBSD Foundation, Inc. * All rights reserved. * diff --git a/lib/portableproplib/prop_array.c b/lib/portableproplib/prop_array.c index 95a846e7..489a3bdd 100644 --- a/lib/portableproplib/prop_array.c +++ b/lib/portableproplib/prop_array.c @@ -640,13 +640,11 @@ _prop_array_add_first(prop_array_t pa, prop_object_t po) prop_object_retain(opo); pa->pa_array[cnt] = opo; prop_object_release(opo); - //printf("%s: po %p\n", __func__, pa->pa_array[cnt]); } /* passed in object is now the first element */ pa->pa_array[0] = po; pa->pa_version++; pa->pa_count++; - //printf("%s: po %p\n", __func__, pa->pa_array[0]); } else { pa->pa_array[pa->pa_count++] = po; pa->pa_version++; diff --git a/lib/portableproplib/prop_ingest.c b/lib/portableproplib/prop_ingest.c index 9d161b57..5d3c63a0 100644 --- a/lib/portableproplib/prop_ingest.c +++ b/lib/portableproplib/prop_ingest.c @@ -1,4 +1,4 @@ -/* $NetBSD: prop_ingest.c,v 1.4 2012/07/27 09:10:59 pooka Exp $ */ +/* $NetBSD: prop_ingest.c,v 1.5 2014/09/05 05:19:24 matt Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ struct _prop_ingest_context { * Allocate and initialize an ingest context. */ prop_ingest_context_t -prop_ingest_context_alloc(void *private) +prop_ingest_context_alloc(void *xprivate) { prop_ingest_context_t ctx; @@ -53,7 +53,7 @@ prop_ingest_context_alloc(void *private) ctx->pic_error = PROP_INGEST_ERROR_NO_ERROR; ctx->pic_type = PROP_TYPE_UNKNOWN; ctx->pic_key = NULL; - ctx->pic_private = private; + ctx->pic_private = xprivate; } return (ctx); } diff --git a/lib/portableproplib/prop_number.c b/lib/portableproplib/prop_number.c index daf035c7..fc0d3057 100644 --- a/lib/portableproplib/prop_number.c +++ b/lib/portableproplib/prop_number.c @@ -1,4 +1,4 @@ -/* $NetBSD: prop_number.c,v 1.26 2014/03/26 18:12:46 christos Exp $ */ +/* $NetBSD: prop_number.c,v 1.27 2014/09/05 05:19:24 matt Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -36,19 +36,21 @@ #include #include +struct _prop_number_value { + union { + int64_t pnu_signed; + uint64_t pnu_unsigned; + } pnv_un; +#define pnv_signed pnv_un.pnu_signed +#define pnv_unsigned pnv_un.pnu_unsigned + unsigned int pnv_is_unsigned :1, + :31; +}; + struct _prop_number { struct _prop_object pn_obj; struct rb_node pn_link; - struct _prop_number_value { - union { - int64_t pnu_signed; - uint64_t pnu_unsigned; - } pnv_un; -#define pnv_signed pnv_un.pnu_signed -#define pnv_unsigned pnv_un.pnu_unsigned - unsigned int pnv_is_unsigned :1, - :31; - } pn_value; + struct _prop_number_value pn_value; }; _PROP_POOL_INIT(_prop_number_pool, sizeof(struct _prop_number), "propnmbr") diff --git a/lib/portableproplib/rb.c b/lib/portableproplib/rb.c index 27cead62..02216788 100644 --- a/lib/portableproplib/rb.c +++ b/lib/portableproplib/rb.c @@ -1,4 +1,4 @@ -/* $NetBSD: rb.c,v 1.9 2010/11/17 13:19:32 tron Exp $ */ +/* $NetBSD: rb.c,v 1.14 2019/03/08 09:14:54 roy Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -123,7 +123,7 @@ rb_tree_find_node_geq(struct rb_tree *rbt, const void *key) parent = parent->rb_nodes[diff < 0]; } - return RB_NODETOITEM(rbto, last); + return last == NULL ? NULL : RB_NODETOITEM(rbto, last); } void * @@ -144,7 +144,7 @@ rb_tree_find_node_leq(struct rb_tree *rbt, const void *key) parent = parent->rb_nodes[diff < 0]; } - return RB_NODETOITEM(rbto, last); + return last == NULL ? NULL : RB_NODETOITEM(rbto, last); } void *