Drop useless/unused xbps_add_obj_to_{array,dict} functions.
This commit is contained in:
parent
22ae6295f5
commit
789165339a
@ -113,10 +113,6 @@ void HIDDEN xbps_pkgdb_release(struct xbps_handle *);
|
|||||||
* @private
|
* @private
|
||||||
* From lib/plist.c
|
* 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,
|
int HIDDEN xbps_array_replace_dict_by_name(xbps_array_t,
|
||||||
xbps_dictionary_t,
|
xbps_dictionary_t,
|
||||||
const char *);
|
const char *);
|
||||||
|
34
lib/plist.c
34
lib/plist.c
@ -52,40 +52,6 @@ struct thread_data {
|
|||||||
* These functions manipulate plist files and objects shared by almost
|
* These functions manipulate plist files and objects shared by almost
|
||||||
* all library functions.
|
* 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 *
|
static void *
|
||||||
array_foreach_thread(void *arg)
|
array_foreach_thread(void *arg)
|
||||||
{
|
{
|
||||||
|
@ -205,7 +205,7 @@ xbps_transaction_init(struct xbps_handle *xhp)
|
|||||||
xhp->transd = NULL;
|
xhp->transd = NULL;
|
||||||
return ENOMEM;
|
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);
|
xbps_object_release(xhp->transd);
|
||||||
xhp->transd = NULL;
|
xhp->transd = NULL;
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
@ -215,7 +215,7 @@ xbps_transaction_init(struct xbps_handle *xhp)
|
|||||||
xhp->transd = NULL;
|
xhp->transd = NULL;
|
||||||
return ENOMEM;
|
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);
|
xbps_object_release(xhp->transd);
|
||||||
xhp->transd = NULL;
|
xhp->transd = NULL;
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
@ -225,7 +225,7 @@ xbps_transaction_init(struct xbps_handle *xhp)
|
|||||||
xhp->transd = NULL;
|
xhp->transd = NULL;
|
||||||
return ENOMEM;
|
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);
|
xbps_object_release(xhp->transd);
|
||||||
xhp->transd = NULL;
|
xhp->transd = NULL;
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
|
Loading…
Reference in New Issue
Block a user