From 789165339a378735ea8fa5b55a327ac281ef6cfb Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 18 Aug 2013 10:25:17 +0200 Subject: [PATCH] Drop useless/unused xbps_add_obj_to_{array,dict} functions. --- include/xbps_api_impl.h | 4 ---- lib/plist.c | 34 ---------------------------------- lib/transaction_dictionary.c | 6 +++--- 3 files changed, 3 insertions(+), 41 deletions(-) diff --git a/include/xbps_api_impl.h b/include/xbps_api_impl.h index 08b5d0fb..3eccb87b 100644 --- a/include/xbps_api_impl.h +++ b/include/xbps_api_impl.h @@ -113,10 +113,6 @@ void HIDDEN xbps_pkgdb_release(struct xbps_handle *); * @private * From lib/plist.c */ -bool HIDDEN xbps_add_obj_to_dict(xbps_dictionary_t, - xbps_object_t, const char *); -bool HIDDEN xbps_add_obj_to_array(xbps_array_t, xbps_object_t); - int HIDDEN xbps_array_replace_dict_by_name(xbps_array_t, xbps_dictionary_t, const char *); diff --git a/lib/plist.c b/lib/plist.c index 25214bca..b9859277 100644 --- a/lib/plist.c +++ b/lib/plist.c @@ -52,40 +52,6 @@ struct thread_data { * These functions manipulate plist files and objects shared by almost * all library functions. */ -bool HIDDEN -xbps_add_obj_to_dict(xbps_dictionary_t dict, xbps_object_t obj, - const char *key) -{ - assert(xbps_object_type(dict) == XBPS_TYPE_DICTIONARY); - assert(obj != NULL); - assert(key != NULL); - - if (!xbps_dictionary_set(dict, key, obj)) { - xbps_object_release(dict); - errno = EINVAL; - return false; - } - - xbps_object_release(obj); - return true; -} - -bool HIDDEN -xbps_add_obj_to_array(xbps_array_t array, xbps_object_t obj) -{ - assert(xbps_object_type(array) == XBPS_TYPE_ARRAY); - assert(obj != NULL); - - if (!xbps_array_add(array, obj)) { - xbps_object_release(array); - errno = EINVAL; - return false; - } - - xbps_object_release(obj); - return true; -} - static void * array_foreach_thread(void *arg) { diff --git a/lib/transaction_dictionary.c b/lib/transaction_dictionary.c index 72aba74e..476b8513 100644 --- a/lib/transaction_dictionary.c +++ b/lib/transaction_dictionary.c @@ -205,7 +205,7 @@ xbps_transaction_init(struct xbps_handle *xhp) xhp->transd = NULL; return ENOMEM; } - if (!xbps_add_obj_to_dict(xhp->transd, unsorted, "unsorted_deps")) { + if (!xbps_dictionary_set(xhp->transd, "unsorted_deps", unsorted)) { xbps_object_release(xhp->transd); xhp->transd = NULL; return EINVAL; @@ -215,7 +215,7 @@ xbps_transaction_init(struct xbps_handle *xhp) xhp->transd = NULL; return ENOMEM; } - if (!xbps_add_obj_to_dict(xhp->transd, mdeps, "missing_deps")) { + if (!xbps_dictionary_set(xhp->transd, "missing_deps", mdeps)) { xbps_object_release(xhp->transd); xhp->transd = NULL; return EINVAL; @@ -225,7 +225,7 @@ xbps_transaction_init(struct xbps_handle *xhp) xhp->transd = NULL; return ENOMEM; } - if (!xbps_add_obj_to_dict(xhp->transd, conflicts, "conflicts")) { + if (!xbps_dictionary_set(xhp->transd, "conflicts", conflicts)) { xbps_object_release(xhp->transd); xhp->transd = NULL; return EINVAL;