Drop useless/unused xbps_add_obj_to_{array,dict} functions.

This commit is contained in:
Juan RP 2013-08-18 10:25:17 +02:00
parent 22ae6295f5
commit 789165339a
3 changed files with 3 additions and 41 deletions

View File

@ -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 *);

View File

@ -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)
{

View File

@ -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;