Misc cleanups: use __attribute__((__unused__)); remove dead code.

This commit is contained in:
Juan RP
2013-08-29 10:45:30 +02:00
parent efcb373f96
commit a039330f3c
15 changed files with 56 additions and 111 deletions

View File

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