Remove all usages of alpm_list_getdata() from the library

No need for the indirection; just access ->data instead.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2011-09-19 14:32:53 -05:00
parent 70e2c34f0f
commit 79cbce60ac
4 changed files with 6 additions and 5 deletions

View File

@ -644,7 +644,8 @@ static alpm_pkg_t *resolvedep(alpm_handle_t *handle, alpm_depend_t *dep,
providers, dep, NULL, &index);
}
if(index >= 0 && index < count) {
alpm_pkg_t *pkg = alpm_list_getdata(alpm_list_nth(providers, index));
alpm_list_t *nth = alpm_list_nth(providers, index);
alpm_pkg_t *pkg = nth->data;
alpm_list_free(providers);
return pkg;
}

View File

@ -696,7 +696,7 @@ int _alpm_pkg_should_ignore(alpm_handle_t *handle, alpm_pkg_t *pkg)
/* next see if the package is in a group that is ignored */
for(groups = handle->ignoregroup; groups; groups = groups->next) {
char *grp = (char *)alpm_list_getdata(groups);
char *grp = groups->data;
if(alpm_list_find_str(alpm_pkg_get_groups(pkg), grp)) {
return 1;
}

View File

@ -767,7 +767,7 @@ static int validate_deltas(alpm_handle_t *handle, alpm_list_t *deltas,
EVENT(handle, ALPM_EVENT_DELTA_INTEGRITY_START, NULL, NULL);
for(i = deltas; i; i = i->next) {
alpm_delta_t *d = alpm_list_getdata(i);
alpm_delta_t *d = i->data;
char *filepath = _alpm_filecache_find(handle, d->delta);
if(_alpm_test_checksum(filepath, d->delta_md5, ALPM_CSUM_MD5)) {

View File

@ -652,7 +652,7 @@ char *_alpm_filecache_find(alpm_handle_t *handle, const char *filename)
/* Loop through the cache dirs until we find a matching file */
for(i = handle->cachedirs; i; i = i->next) {
snprintf(path, PATH_MAX, "%s%s", (char *)alpm_list_getdata(i),
snprintf(path, PATH_MAX, "%s%s", (char *)i->data,
filename);
if(stat(path, &buf) == 0 && S_ISREG(buf.st_mode)) {
retpath = strdup(path);
@ -677,7 +677,7 @@ const char *_alpm_filecache_setup(alpm_handle_t *handle)
/* Loop through the cache dirs until we find a usable directory */
for(i = handle->cachedirs; i; i = i->next) {
cachedir = alpm_list_getdata(i);
cachedir = i->data;
if(stat(cachedir, &buf) != 0) {
/* cache directory does not exist.... try creating it */
_alpm_log(handle, ALPM_LOG_WARNING, _("no %s cache exists, creating...\n"),