diff options
| author | riastradh <riastradh@NetBSD.org> | 2022-08-03 21:13:46 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2022-08-03 21:13:46 +0000 |
| commit | f7c0aabf1d92bfb1b3254ca43327e1e9a8af26d1 (patch) | |
| tree | e465b99b42b3b8cdce3e9fd99cd38855bee07bab /common | |
| parent | 5d2f980304d3929011b8e33c47f1b4b92389de36 (diff) | |
proplib: Nix trailing whitespace.
Diffstat (limited to 'common')
| -rw-r--r-- | common/lib/libprop/prop_array_util.c | 4 | ||||
| -rw-r--r-- | common/lib/libprop/prop_data.c | 12 | ||||
| -rw-r--r-- | common/lib/libprop/prop_dictionary.c | 14 | ||||
| -rw-r--r-- | common/lib/libprop/prop_dictionary_util.c | 6 | ||||
| -rw-r--r-- | common/lib/libprop/prop_kern.c | 10 | ||||
| -rw-r--r-- | common/lib/libprop/prop_number.c | 14 | ||||
| -rw-r--r-- | common/lib/libprop/prop_object.c | 48 | ||||
| -rw-r--r-- | common/lib/libprop/prop_string.c | 28 |
8 files changed, 68 insertions, 68 deletions
diff --git a/common/lib/libprop/prop_array_util.c b/common/lib/libprop/prop_array_util.c index 579cc5e01ab..eef18e61e05 100644 --- a/common/lib/libprop/prop_array_util.c +++ b/common/lib/libprop/prop_array_util.c @@ -1,4 +1,4 @@ -/* $NetBSD: prop_array_util.c,v 1.8 2020/06/14 21:31:01 christos Exp $ */ +/* $NetBSD: prop_array_util.c,v 1.9 2022/08/03 21:13:46 riastradh Exp $ */ /*- * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc. @@ -49,7 +49,7 @@ prop_array_get_bool(prop_array_t array, unsigned int indx, bool *valp) b = prop_array_get(array, indx); if (prop_object_type(b) != PROP_TYPE_BOOL) return (false); - + *valp = prop_bool_true(b); return (true); diff --git a/common/lib/libprop/prop_data.c b/common/lib/libprop/prop_data.c index b469b29fd0f..d67e52f930c 100644 --- a/common/lib/libprop/prop_data.c +++ b/common/lib/libprop/prop_data.c @@ -1,4 +1,4 @@ -/* $NetBSD: prop_data.c,v 1.17 2020/06/08 21:31:56 thorpej Exp $ */ +/* $NetBSD: prop_data.c,v 1.18 2022/08/03 21:13:46 riastradh Exp $ */ /*- * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc. @@ -171,7 +171,7 @@ _prop_data_externalize(struct _prop_object_externalize_context *ctx, void *v) if (_prop_object_externalize_end_tag(ctx, "data") == false) return (false); - + return (true); } @@ -377,7 +377,7 @@ prop_data_copy_value(prop_data_t pd, void *buf, size_t buflen) if (! prop_object_is_data(pd)) return (false); - + if (buf == NULL || buflen < pd->pd_size) return (false); @@ -411,7 +411,7 @@ prop_data_data(prop_data_t pd) v = _PROP_MALLOC(pd->pd_size, M_TEMP); if (v != NULL) memcpy(v, pd->pd_immutable, pd->pd_size); - + return (v); } @@ -569,7 +569,7 @@ _prop_data_internalize_decode(struct _prop_object_internalize_context *ctx, return (false); ch = (unsigned char) *src; /* FALLTHROUGH */ - + case 3: /* Valid, two bytes of info */ /* * We know this char is a =. Is there anything but @@ -662,7 +662,7 @@ _prop_data_internalize(prop_stack_t stack, prop_object_t *obj, buf = _PROP_MALLOC(len + 1, M_PROP_DATA); if (buf == NULL) return (true); - + if (_prop_data_internalize_decode(ctx, buf, len + 1, &alen, &ctx->poic_cp) == false) { _PROP_FREE(buf, M_PROP_DATA); diff --git a/common/lib/libprop/prop_dictionary.c b/common/lib/libprop/prop_dictionary.c index 419ab81ad13..fd8dd79cb7a 100644 --- a/common/lib/libprop/prop_dictionary.c +++ b/common/lib/libprop/prop_dictionary.c @@ -1,4 +1,4 @@ -/* $NetBSD: prop_dictionary.c,v 1.44 2022/07/02 16:30:13 andvar Exp $ */ +/* $NetBSD: prop_dictionary.c,v 1.45 2022/08/03 21:13:46 riastradh Exp $ */ /*- * Copyright (c) 2006, 2007, 2020 The NetBSD Foundation, Inc. @@ -133,7 +133,7 @@ static const struct _prop_object_type _prop_object_type_dictionary = { .pot_equals = _prop_dictionary_equals, .pot_equals_finish = _prop_dictionary_equals_finish, .pot_lock = _prop_dictionary_lock, - .pot_unlock = _prop_dictionary_unlock, + .pot_unlock = _prop_dictionary_unlock, }; static _prop_object_free_rv_t @@ -257,7 +257,7 @@ _prop_dict_keysym_externalize(struct _prop_object_externalize_context *ctx, pdk->pdk_key) == false || _prop_object_externalize_end_tag(ctx, "string") == false) return (false); - + return (true); } @@ -448,7 +448,7 @@ _prop_dictionary_externalize(struct _prop_object_externalize_context *ctx, pi = _prop_dictionary_iterator_locked(pd); if (pi == NULL) goto out; - + ctx->poec_depth++; _PROP_ASSERT(ctx->poec_depth != 0); @@ -475,7 +475,7 @@ _prop_dictionary_externalize(struct _prop_object_externalize_context *ctx, } if (_prop_object_externalize_end_tag(ctx, "dict") == false) goto out; - + rv = true; out: @@ -597,7 +597,7 @@ _prop_dictionary_expand(prop_dictionary_t pd, unsigned int capacity) if (oarray != NULL) _PROP_FREE(oarray, M_PROP_DICT); - + return (true); } @@ -1356,7 +1356,7 @@ _prop_dictionary_internalize_body(prop_stack_t stack, prop_object_t *obj, if (_prop_object_internalize_find_tag(ctx, "key", _PROP_TAG_TYPE_END) == false) goto bad; - + /* ..and now the beginning of the value. */ if (_prop_object_internalize_find_tag(ctx, NULL, _PROP_TAG_TYPE_START) == false) diff --git a/common/lib/libprop/prop_dictionary_util.c b/common/lib/libprop/prop_dictionary_util.c index 4c3fd447498..5dd54c97e3d 100644 --- a/common/lib/libprop/prop_dictionary_util.c +++ b/common/lib/libprop/prop_dictionary_util.c @@ -1,4 +1,4 @@ -/* $NetBSD: prop_dictionary_util.c,v 1.8 2020/06/15 00:46:00 christos Exp $ */ +/* $NetBSD: prop_dictionary_util.c,v 1.9 2022/08/03 21:13:46 riastradh Exp $ */ /*- * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ prop_dictionary_get_bool(prop_dictionary_t dict, const char *key, bool *valp) b = prop_dictionary_get(dict, key); if (prop_object_type(b) != PROP_TYPE_BOOL) return (false); - + *valp = prop_bool_true(b); return (true); @@ -179,7 +179,7 @@ prop_dictionary_get_string(prop_dictionary_t dict, const char *key, cp = prop_string_value(str); if (cp == NULL) return (false); - + *cpp = cp; return (true); } diff --git a/common/lib/libprop/prop_kern.c b/common/lib/libprop/prop_kern.c index fa35842d336..576aded5246 100644 --- a/common/lib/libprop/prop_kern.c +++ b/common/lib/libprop/prop_kern.c @@ -1,4 +1,4 @@ -/* $NetBSD: prop_kern.c,v 1.24 2018/10/14 17:37:40 jdolecek Exp $ */ +/* $NetBSD: prop_kern.c,v 1.25 2022/08/03 21:13:46 riastradh Exp $ */ /*- * Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. @@ -143,7 +143,7 @@ _prop_object_send_ioctl(prop_object_t obj, int fd, unsigned long cmd) error = errno; else error = 0; - + free(buf); return (error); @@ -162,7 +162,7 @@ prop_array_send_ioctl(prop_array_t array, int fd, unsigned long cmd) if (rv != 0) { errno = rv; /* pass up error value in errno */ return rv; - } else + } else return 0; } @@ -179,7 +179,7 @@ prop_dictionary_send_ioctl(prop_dictionary_t dict, int fd, unsigned long cmd) if (rv != 0) { errno = rv; /* pass up error value in errno */ return rv; - } else + } else return 0; } @@ -354,7 +354,7 @@ prop_dictionary_sendrecv_ioctl(prop_dictionary_t dict, int fd, error = errno; else error = 0; - + free(buf); if (error != 0) diff --git a/common/lib/libprop/prop_number.c b/common/lib/libprop/prop_number.c index 4e971f225a9..f9d2d0975d3 100644 --- a/common/lib/libprop/prop_number.c +++ b/common/lib/libprop/prop_number.c @@ -1,4 +1,4 @@ -/* $NetBSD: prop_number.c,v 1.33 2020/06/06 22:23:31 thorpej Exp $ */ +/* $NetBSD: prop_number.c,v 1.34 2022/08/03 21:13:46 riastradh Exp $ */ /*- * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc. @@ -176,7 +176,7 @@ _prop_number_init(void) return 0; } -static void +static void _prop_number_lock(void) { /* XXX: init necessary? */ @@ -189,7 +189,7 @@ _prop_number_unlock(void) { _PROP_MUTEX_UNLOCK(_prop_number_tree_mutex); } - + static bool _prop_number_externalize(struct _prop_object_externalize_context *ctx, void *v) @@ -212,7 +212,7 @@ _prop_number_externalize(struct _prop_object_externalize_context *ctx, _prop_object_externalize_append_cstring(ctx, tmpstr) == false || _prop_object_externalize_end_tag(ctx, "integer") == false) return (false); - + return (true); } @@ -571,7 +571,7 @@ prop_number_equals_signed(prop_number_t pn, intmax_t val) if (pn->pn_value.pnv_is_unsigned && (pn->pn_value.pnv_unsigned > INTMAX_MAX || val < 0)) return (false); - + return (pn->pn_value.pnv_signed == val); } @@ -595,11 +595,11 @@ prop_number_equals_unsigned(prop_number_t pn, uintmax_t val) if (! prop_object_is_number(pn)) return (false); - + if (! pn->pn_value.pnv_is_unsigned && (pn->pn_value.pnv_signed < 0 || val > INT64_MAX)) return (false); - + return (pn->pn_value.pnv_unsigned == val); } diff --git a/common/lib/libprop/prop_object.c b/common/lib/libprop/prop_object.c index 0252c23fc4e..3cf205052dc 100644 --- a/common/lib/libprop/prop_object.c +++ b/common/lib/libprop/prop_object.c @@ -1,4 +1,4 @@ -/* $NetBSD: prop_object.c,v 1.31 2019/05/08 04:34:33 thorpej Exp $ */ +/* $NetBSD: prop_object.c,v 1.32 2022/08/03 21:13:46 riastradh Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ _prop_standalone_realloc(void *v, size_t size) memcpy(rv, v, size); /* XXX */ dealloc(v, 0); /* XXX */ } - + return (rv); } #endif /* _STANDALONE */ @@ -116,7 +116,7 @@ _prop_object_externalize_start_tag( _prop_object_externalize_append_cstring(ctx, tag) == false || _prop_object_externalize_append_char(ctx, '>') == false) return (false); - + return (true); } @@ -160,7 +160,7 @@ _prop_object_externalize_empty_tag( _prop_object_externalize_append_char(ctx, '>') == false || _prop_object_externalize_append_char(ctx, '\n') == false) return (false); - + return (true); } @@ -429,7 +429,7 @@ _prop_object_internalize_find_tag(struct _prop_object_internalize_context *ctx, (taglen != ctx->poic_tagname_len || memcmp(tag, ctx->poic_tagname, taglen) != 0)) return (false); - + /* Check for empty tag. */ if (*cp == '/') { if (ctx->poic_tag_type != _PROP_TAG_TYPE_START) @@ -470,14 +470,14 @@ _prop_object_internalize_find_tag(struct _prop_object_internalize_context *ctx, } ctx->poic_tagattr_len = cp - ctx->poic_tagattr; - + cp++; if (*cp != '\"') return (false); cp++; if (_PROP_EOF(*cp)) return (false); - + ctx->poic_tagattrval = cp; while (*cp != '\"') { if (_PROP_EOF(*cp)) @@ -485,7 +485,7 @@ _prop_object_internalize_find_tag(struct _prop_object_internalize_context *ctx, cp++; } ctx->poic_tagattrval_len = cp - ctx->poic_tagattrval; - + cp++; if (*cp != '>') return (false); @@ -507,7 +507,7 @@ _prop_object_internalize_decode_string( const char *src; size_t tarindex; char c; - + tarindex = 0; src = ctx->poic_cp; @@ -566,7 +566,7 @@ _prop_object_internalize_decode_string( *sizep = tarindex; if (cpp != NULL) *cpp = src; - + return (true); } @@ -722,7 +722,7 @@ _prop_object_internalize_context_alloc(const char *xml) M_TEMP); if (ctx == NULL) return (NULL); - + ctx->poic_xml = ctx->poic_cp = xml; /* @@ -805,12 +805,12 @@ _prop_object_externalize_file_dirname(const char *path, char *result) */ if (path == NULL || *path == '\0') goto singledot; - + /* String trailing slashes, if any. */ lastp = path + strlen(path) - 1; while (lastp != path && *lastp == '/') lastp--; - + /* Terminate path at the last occurrence of '/'. */ do { if (*lastp == '/') { @@ -915,7 +915,7 @@ _prop_object_internalize_map_file(const char *fname) mf = _PROP_MALLOC(sizeof(*mf), M_TEMP); if (mf == NULL) return (NULL); - + fd = open(fname, O_RDONLY, 0400); if (fd == -1) { _PROP_FREE(mf, M_TEMP); @@ -1028,7 +1028,7 @@ prop_object_release_emergency(prop_object_t obj) /* Save pointerto unlock function */ unlock = po->po_type->pot_unlock; - + /* Dance a bit to make sure we always get the non-racy ocnt */ _PROP_ATOMIC_DEC32_NV(&po->po_refcnt, ocnt); ocnt++; @@ -1039,8 +1039,8 @@ prop_object_release_emergency(prop_object_t obj) unlock(); break; } - - _PROP_ASSERT(po->po_type); + + _PROP_ASSERT(po->po_type); if ((po->po_type->pot_free)(NULL, &obj) == _PROP_OBJECT_FREE_DONE) { if (unlock != NULL) @@ -1050,7 +1050,7 @@ prop_object_release_emergency(prop_object_t obj) if (unlock != NULL) unlock(); - + parent = po; _PROP_ATOMIC_INC32(&po->po_refcnt); } @@ -1072,7 +1072,7 @@ prop_object_release(prop_object_t obj) { struct _prop_object *po; struct _prop_stack stack; - void (*unlock)(void); + void (*unlock)(void); int ret; uint32_t ocnt; @@ -1088,7 +1088,7 @@ prop_object_release(prop_object_t obj) /* Save pointer to object unlock function */ unlock = po->po_type->pot_unlock; - + _PROP_ATOMIC_DEC32_NV(&po->po_refcnt, ocnt); ocnt++; _PROP_ASSERT(ocnt != 0); @@ -1099,7 +1099,7 @@ prop_object_release(prop_object_t obj) unlock(); break; } - + ret = (po->po_type->pot_free)(&stack, &obj); if (unlock != NULL) @@ -1107,7 +1107,7 @@ prop_object_release(prop_object_t obj) if (ret == _PROP_OBJECT_FREE_DONE) break; - + _PROP_ATOMIC_INC32(&po->po_refcnt); } while (ret == _PROP_OBJECT_FREE_RECURSE); if (ret == _PROP_OBJECT_FREE_FAILED) @@ -1163,7 +1163,7 @@ prop_object_equals_with_error(prop_object_t obj1, prop_object_t obj2, if (po1->po_type != po2->po_type) return (false); - + continue_subtree: ret = (*po1->po_type->pot_equals)(obj1, obj2, &stored_pointer1, &stored_pointer2, @@ -1195,7 +1195,7 @@ finish: po1 = obj1; (*po1->po_type->pot_equals_finish)(obj1, obj2); } - return (false); + return (false); } /* diff --git a/common/lib/libprop/prop_string.c b/common/lib/libprop/prop_string.c index 74ea6d2f3f2..903c8f293c5 100644 --- a/common/lib/libprop/prop_string.c +++ b/common/lib/libprop/prop_string.c @@ -1,4 +1,4 @@ -/* $NetBSD: prop_string.c,v 1.16 2021/09/07 13:24:45 andvar Exp $ */ +/* $NetBSD: prop_string.c,v 1.17 2022/08/03 21:13:46 riastradh Exp $ */ /*- * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc. @@ -132,7 +132,7 @@ _prop_string_init(void) _PROP_MUTEX_INIT(_prop_string_tree_mutex); rb_tree_init(&_prop_string_tree, &_prop_string_rb_tree_ops); - + return 0; } @@ -181,7 +181,7 @@ _prop_string_externalize(struct _prop_object_externalize_context *ctx, ps->ps_immutable) == false || _prop_object_externalize_end_tag(ctx, "string") == false) return (false); - + return (true); } @@ -388,7 +388,7 @@ prop_string_copy(prop_string_t ops) cp = _PROP_MALLOC(ops->ps_size + 1, M_PROP_STRING); if (cp == NULL) return NULL; - + strcpy(cp, prop_string_contents(ops)); ps = _prop_string_instantiate(PS_F_MUTABLE, cp, ops->ps_size); @@ -413,7 +413,7 @@ prop_string_copy_mutable(prop_string_t ops) cp = _PROP_MALLOC(ops->ps_size + 1, M_PROP_STRING); if (cp == NULL) return NULL; - + strcpy(cp, prop_string_contents(ops)); ps = _prop_string_instantiate(PS_F_MUTABLE, cp, ops->ps_size); @@ -451,7 +451,7 @@ prop_string_value(prop_string_t ps) if ((ps->ps_flags & PS_F_MUTABLE) == 0) return (ps->ps_immutable); - + return (prop_string_contents(ps)); } @@ -468,7 +468,7 @@ prop_string_copy_value(prop_string_t ps, void *buf, size_t buflen) if (buf == NULL || buflen < ps->ps_size + 1) return (false); - + strcpy(buf, prop_string_contents(ps)); return (true); @@ -501,7 +501,7 @@ prop_string_cstring(prop_string_t ps) cp = _PROP_MALLOC(ps->ps_size + 1, M_TEMP); if (cp != NULL) strcpy(cp, prop_string_contents(ps)); - + return (cp); } @@ -545,7 +545,7 @@ prop_string_append(prop_string_t dst, prop_string_t src) dst->ps_size = len; if (ocp != NULL) _PROP_FREE(ocp, M_PROP_STRING); - + return (true); } @@ -576,7 +576,7 @@ prop_string_append_cstring(prop_string_t dst, const char *src) dst->ps_size = len; if (ocp != NULL) _PROP_FREE(ocp, M_PROP_STRING); - + return (true); } @@ -663,7 +663,7 @@ _prop_string_internalize(prop_stack_t stack, prop_object_t *obj, *obj = prop_string_create(); return (true); } - + /* No attributes recognized here. */ if (ctx->poic_tagattr != NULL) return (true); @@ -672,11 +672,11 @@ _prop_string_internalize(prop_stack_t stack, prop_object_t *obj, if (_prop_object_internalize_decode_string(ctx, NULL, 0, &len, NULL) == false) return (true); - + str = _PROP_MALLOC(len + 1, M_PROP_STRING); if (str == NULL) return (true); - + if (_prop_object_internalize_decode_string(ctx, str, len, &alen, &ctx->poic_cp) == false || alen != len) { @@ -694,7 +694,7 @@ _prop_string_internalize(prop_stack_t stack, prop_object_t *obj, string = _prop_string_instantiate(0, str, len); if (string == NULL) _PROP_FREE(str, M_PROP_STRING); - + *obj = string; return (true); } |
