Misc cleanups: use __attribute__((__unused__)); remove dead code.
This commit is contained in:
@@ -39,11 +39,11 @@ struct list_pkgver_cb {
|
||||
};
|
||||
|
||||
int
|
||||
list_pkgs_in_dict(struct xbps_handle *xhp,
|
||||
list_pkgs_in_dict(struct xbps_handle *xhp _unused,
|
||||
xbps_object_t obj,
|
||||
const char *key,
|
||||
const char *key _unused,
|
||||
void *arg,
|
||||
bool *loop_done)
|
||||
bool *loop_done _unused)
|
||||
{
|
||||
struct list_pkgver_cb *lpc = arg;
|
||||
const char *pkgver, *short_desc, *state_str;
|
||||
@@ -51,10 +51,6 @@ list_pkgs_in_dict(struct xbps_handle *xhp,
|
||||
int i, len = 0;
|
||||
pkg_state_t state;
|
||||
|
||||
(void)xhp;
|
||||
(void)key;
|
||||
(void)loop_done;
|
||||
|
||||
xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
|
||||
xbps_dictionary_get_cstring_nocopy(obj, "short_desc", &short_desc);
|
||||
if (!pkgver || !short_desc)
|
||||
@@ -93,20 +89,15 @@ list_pkgs_in_dict(struct xbps_handle *xhp,
|
||||
}
|
||||
|
||||
int
|
||||
list_manual_pkgs(struct xbps_handle *xhp,
|
||||
list_manual_pkgs(struct xbps_handle *xhp _unused,
|
||||
xbps_object_t obj,
|
||||
const char *key,
|
||||
void *arg,
|
||||
bool *loop_done)
|
||||
const char *key _unused,
|
||||
void *arg _unused,
|
||||
bool *loop_done _unused)
|
||||
{
|
||||
const char *pkgver;
|
||||
bool automatic = false;
|
||||
|
||||
(void)xhp;
|
||||
(void)key;
|
||||
(void)arg;
|
||||
(void)loop_done;
|
||||
|
||||
xbps_dictionary_get_bool(obj, "automatic-install", &automatic);
|
||||
if (automatic == false) {
|
||||
xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
|
||||
@@ -117,16 +108,14 @@ list_manual_pkgs(struct xbps_handle *xhp,
|
||||
}
|
||||
|
||||
int
|
||||
list_hold_pkgs(struct xbps_handle *xhp, xbps_object_t obj,
|
||||
const char *key, void *arg, bool *loop_done)
|
||||
list_hold_pkgs(struct xbps_handle *xhp _unused,
|
||||
xbps_object_t obj,
|
||||
const char *key _unused,
|
||||
void *arg _unused,
|
||||
bool *loop_done _unused)
|
||||
{
|
||||
const char *pkgver;
|
||||
|
||||
(void)xhp;
|
||||
(void)key;
|
||||
(void)arg;
|
||||
(void)loop_done;
|
||||
|
||||
if (xbps_dictionary_get(obj, "hold")) {
|
||||
xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
|
||||
printf("%s\n", pkgver);
|
||||
@@ -166,11 +155,8 @@ list_pkgs_pkgdb(struct xbps_handle *xhp)
|
||||
}
|
||||
|
||||
static int
|
||||
repo_list_uri_cb(struct xbps_repo *repo, void *arg, bool *done)
|
||||
repo_list_uri_cb(struct xbps_repo *repo, void *arg _unused, bool *done _unused)
|
||||
{
|
||||
(void)arg;
|
||||
(void)done;
|
||||
|
||||
printf("%5zd %s\n", repo->idx ? (ssize_t)xbps_dictionary_count(repo->idx) : -1, repo->uri);
|
||||
|
||||
return 0;
|
||||
@@ -196,20 +182,16 @@ struct fflongest {
|
||||
};
|
||||
|
||||
static int
|
||||
_find_longest_pkgver_cb(struct xbps_handle *xhp,
|
||||
_find_longest_pkgver_cb(struct xbps_handle *xhp _unused,
|
||||
xbps_object_t obj,
|
||||
const char *key,
|
||||
const char *key _unused,
|
||||
void *arg,
|
||||
bool *loop_done)
|
||||
bool *loop_done _unused)
|
||||
{
|
||||
struct fflongest *ffl = arg;
|
||||
const char *pkgver;
|
||||
unsigned int len;
|
||||
|
||||
(void)xhp;
|
||||
(void)key;
|
||||
(void)loop_done;
|
||||
|
||||
xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
|
||||
len = strlen(pkgver);
|
||||
if (ffl->len == 0 || len > ffl->len)
|
||||
|
@@ -87,7 +87,11 @@ match_files_by_pattern(xbps_dictionary_t pkg_filesd,
|
||||
}
|
||||
|
||||
static int
|
||||
ownedby_pkgdb_cb(struct xbps_handle *xhp, xbps_object_t obj, const char *obj_key, void *arg, bool *done)
|
||||
ownedby_pkgdb_cb(struct xbps_handle *xhp,
|
||||
xbps_object_t obj,
|
||||
const char *obj_key _unused,
|
||||
void *arg,
|
||||
bool *done _unused)
|
||||
{
|
||||
xbps_dictionary_t pkgmetad;
|
||||
xbps_array_t files_keys;
|
||||
@@ -138,16 +142,17 @@ ownedby(struct xbps_handle *xhp, int npatterns, char **patterns)
|
||||
}
|
||||
|
||||
static int
|
||||
repo_match_cb(struct xbps_handle *xhp, xbps_object_t obj, const char *key, void *arg, bool *done)
|
||||
repo_match_cb(struct xbps_handle *xhp _unused,
|
||||
xbps_object_t obj,
|
||||
const char *key,
|
||||
void *arg,
|
||||
bool *done _unused)
|
||||
{
|
||||
struct ffdata *ffd = arg;
|
||||
const char *filestr;
|
||||
unsigned int i;
|
||||
int x;
|
||||
|
||||
(void)xhp;
|
||||
(void)done;
|
||||
|
||||
for (i = 0; i < xbps_array_count(obj); i++) {
|
||||
xbps_array_get_cstring_nocopy(obj, i, &filestr);
|
||||
for (x = 0; x < ffd->npatterns; x++) {
|
||||
@@ -162,15 +167,13 @@ repo_match_cb(struct xbps_handle *xhp, xbps_object_t obj, const char *key, void
|
||||
}
|
||||
|
||||
static int
|
||||
repo_ownedby_cb(struct xbps_repo *repo, void *arg, bool *done)
|
||||
repo_ownedby_cb(struct xbps_repo *repo, void *arg, bool *done _unused)
|
||||
{
|
||||
xbps_array_t allkeys;
|
||||
xbps_dictionary_t filesd;
|
||||
struct ffdata *ffd = arg;
|
||||
int rv;
|
||||
|
||||
(void)done;
|
||||
|
||||
filesd = xbps_repo_get_plist(repo, XBPS_PKGINDEX_FILES);
|
||||
if (filesd == NULL)
|
||||
return 0;
|
||||
|
@@ -98,16 +98,16 @@ print_results(struct xbps_handle *xhp, struct search_data *sd)
|
||||
}
|
||||
|
||||
static int
|
||||
search_array_cb(struct xbps_handle *xhp, xbps_object_t obj, const char *key, void *arg, bool *done)
|
||||
search_array_cb(struct xbps_handle *xhp _unused,
|
||||
xbps_object_t obj,
|
||||
const char *key _unused,
|
||||
void *arg,
|
||||
bool *done _unused)
|
||||
{
|
||||
struct search_data *sd = arg;
|
||||
const char *pkgver, *desc;
|
||||
int x;
|
||||
|
||||
(void)xhp;
|
||||
(void)key;
|
||||
(void)done;
|
||||
|
||||
xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
|
||||
xbps_dictionary_get_cstring_nocopy(obj, "short_desc", &desc);
|
||||
|
||||
@@ -130,14 +130,12 @@ search_array_cb(struct xbps_handle *xhp, xbps_object_t obj, const char *key, voi
|
||||
}
|
||||
|
||||
static int
|
||||
search_pkgs_cb(struct xbps_repo *repo, void *arg, bool *done)
|
||||
search_pkgs_cb(struct xbps_repo *repo, void *arg, bool *done _unused)
|
||||
{
|
||||
xbps_array_t allkeys;
|
||||
struct search_data *sd = arg;
|
||||
int rv;
|
||||
|
||||
(void)done;
|
||||
|
||||
if (repo->idx == NULL)
|
||||
return 0;
|
||||
|
||||
|
Reference in New Issue
Block a user