Sync with portableproplib-0.6.8.

This commit is contained in:
Juan RP 2019-06-03 17:55:15 +02:00 committed by Duncan Overbruck
parent 121d0fbb64
commit 371be9703e
6 changed files with 21 additions and 20 deletions

View File

@ -17,5 +17,5 @@ internal use in the code:
- libfetch-2.34 from NetBSD (pkgsrc/net/libfetch): lib/fetch - 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 https://github.com/xtraeme/portableproplib

View File

@ -1,6 +1,7 @@
/* $NetBSD: prop_array.h,v 1.8 2008/09/11 13:15:13 haad Exp $ */ /* $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. * Copyright (c) 2006 The NetBSD Foundation, Inc.
* All rights reserved. * All rights reserved.
* *

View File

@ -640,13 +640,11 @@ _prop_array_add_first(prop_array_t pa, prop_object_t po)
prop_object_retain(opo); prop_object_retain(opo);
pa->pa_array[cnt] = opo; pa->pa_array[cnt] = opo;
prop_object_release(opo); prop_object_release(opo);
//printf("%s: po %p\n", __func__, pa->pa_array[cnt]);
} }
/* passed in object is now the first element */ /* passed in object is now the first element */
pa->pa_array[0] = po; pa->pa_array[0] = po;
pa->pa_version++; pa->pa_version++;
pa->pa_count++; pa->pa_count++;
//printf("%s: po %p\n", __func__, pa->pa_array[0]);
} else { } else {
pa->pa_array[pa->pa_count++] = po; pa->pa_array[pa->pa_count++] = po;
pa->pa_version++; pa->pa_version++;

View File

@ -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. * Copyright (c) 2006 The NetBSD Foundation, Inc.
@ -44,7 +44,7 @@ struct _prop_ingest_context {
* Allocate and initialize an ingest context. * Allocate and initialize an ingest context.
*/ */
prop_ingest_context_t prop_ingest_context_t
prop_ingest_context_alloc(void *private) prop_ingest_context_alloc(void *xprivate)
{ {
prop_ingest_context_t ctx; 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_error = PROP_INGEST_ERROR_NO_ERROR;
ctx->pic_type = PROP_TYPE_UNKNOWN; ctx->pic_type = PROP_TYPE_UNKNOWN;
ctx->pic_key = NULL; ctx->pic_key = NULL;
ctx->pic_private = private; ctx->pic_private = xprivate;
} }
return (ctx); return (ctx);
} }

View File

@ -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. * Copyright (c) 2006 The NetBSD Foundation, Inc.
@ -36,19 +36,21 @@
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
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_number {
struct _prop_object pn_obj; struct _prop_object pn_obj;
struct rb_node pn_link; struct rb_node pn_link;
struct _prop_number_value { struct _prop_number_value pn_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;
}; };
_PROP_POOL_INIT(_prop_number_pool, sizeof(struct _prop_number), "propnmbr") _PROP_POOL_INIT(_prop_number_pool, sizeof(struct _prop_number), "propnmbr")

View File

@ -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. * 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]; parent = parent->rb_nodes[diff < 0];
} }
return RB_NODETOITEM(rbto, last); return last == NULL ? NULL : RB_NODETOITEM(rbto, last);
} }
void * void *
@ -144,7 +144,7 @@ rb_tree_find_node_leq(struct rb_tree *rbt, const void *key)
parent = parent->rb_nodes[diff < 0]; parent = parent->rb_nodes[diff < 0];
} }
return RB_NODETOITEM(rbto, last); return last == NULL ? NULL : RB_NODETOITEM(rbto, last);
} }
void * void *