summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-27 10:10:08 -0500
committerDan McGee <dan@archlinux.org>2011-06-27 10:10:08 -0500
commitf01c6f814a278a3d024d34fed0c219c8cb1e1e33 (patch)
tree759833d3d7c46bca4f962c5fd442ab3f37d85b14 /lib/libalpm
parent77a09c92c66bd06440be0ccb75daf07c620acbee (diff)
downloadpacman-f01c6f814a278a3d024d34fed0c219c8cb1e1e33.tar.xz
Fix several -Wshadow warnings
Only one of these looked like a real red flag, in find_requiredby(), but it doesn't hurt to fix several of them up anyway. Unfortunately, we can't turn this on universally due to things like the sync(), remove(), etc. builtins which we often use as variable names. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/backup.c6
-rw-r--r--lib/libalpm/backup.h2
-rw-r--r--lib/libalpm/diskspace.c8
-rw-r--r--lib/libalpm/dload.c6
-rw-r--r--lib/libalpm/package.c6
-rw-r--r--lib/libalpm/util.c18
6 files changed, 23 insertions, 23 deletions
diff --git a/lib/libalpm/backup.c b/lib/libalpm/backup.c
index 20fb8a80..dc0c5674 100644
--- a/lib/libalpm/backup.c
+++ b/lib/libalpm/backup.c
@@ -58,16 +58,16 @@ int _alpm_split_backup(const char *string, pmbackup_t **backup)
/* Look for a filename in a pmpkg_t.backup list. If we find it,
* then we return the full backup entry.
*/
-pmbackup_t *_alpm_needbackup(const char *file, const alpm_list_t *backup)
+pmbackup_t *_alpm_needbackup(const char *file, const alpm_list_t *backup_list)
{
const alpm_list_t *lp;
- if(file == NULL || backup == NULL) {
+ if(file == NULL || backup_list == NULL) {
return NULL;
}
/* run through the backup list and parse out the hash for our file */
- for(lp = backup; lp; lp = lp->next) {
+ for(lp = backup_list; lp; lp = lp->next) {
pmbackup_t *backup = lp->data;
if(strcmp(file, backup->name) == 0) {
diff --git a/lib/libalpm/backup.h b/lib/libalpm/backup.h
index 2f632d4a..be8de97a 100644
--- a/lib/libalpm/backup.h
+++ b/lib/libalpm/backup.h
@@ -24,7 +24,7 @@
#include "alpm.h"
int _alpm_split_backup(const char *string, pmbackup_t **backup);
-pmbackup_t *_alpm_needbackup(const char *file, const alpm_list_t *backup);
+pmbackup_t *_alpm_needbackup(const char *file, const alpm_list_t *backup_list);
void _alpm_backup_free(pmbackup_t *backup);
pmbackup_t *_alpm_backup_dup(const pmbackup_t *backup);
diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c
index 079e683e..51aa47f2 100644
--- a/lib/libalpm/diskspace.c
+++ b/lib/libalpm/diskspace.c
@@ -262,7 +262,7 @@ int _alpm_check_diskspace(pmhandle_t *handle)
alpm_list_t *mount_points, *i;
alpm_mountpoint_t *root_mp;
size_t replaces = 0, current = 0, numtargs;
- int abort = 0;
+ int error = 0;
alpm_list_t *targ;
pmtrans_t *trans = handle->trans;
@@ -323,7 +323,7 @@ int _alpm_check_diskspace(pmhandle_t *handle)
if(data->used && data->read_only) {
_alpm_log(handle, PM_LOG_ERROR, _("Partition %s is mounted read only\n"),
data->mount_dir);
- abort = 1;
+ error = 1;
} else if(data->used & USED_INSTALL) {
/* cushion is roughly min(5% capacity, 20MiB) */
long fivepc = ((long)data->fsp.f_blocks / 20) + 1;
@@ -338,7 +338,7 @@ int _alpm_check_diskspace(pmhandle_t *handle)
_alpm_log(handle, PM_LOG_ERROR, _("Partition %s too full: %ld blocks needed, %ld blocks free\n"),
data->mount_dir, data->max_blocks_needed + cushion,
(unsigned long)data->fsp.f_bfree);
- abort = 1;
+ error = 1;
}
}
}
@@ -349,7 +349,7 @@ int _alpm_check_diskspace(pmhandle_t *handle)
}
FREELIST(mount_points);
- if(abort) {
+ if(error) {
RET_ERR(handle, PM_ERR_DISK_SPACE, -1);
}
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index 33fb1cb8..c7903ff0 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -137,12 +137,12 @@ static int curl_gethost(const char *url, char *buffer)
return 0;
}
-static int utimes_long(const char *path, long time)
+static int utimes_long(const char *path, long seconds)
{
- if(time != -1) {
+ if(seconds != -1) {
struct timeval tv[2];
memset(&tv, 0, sizeof(tv));
- tv[0].tv_sec = tv[1].tv_sec = time;
+ tv[0].tv_sec = tv[1].tv_sec = seconds;
return utimes(path, tv);
}
return 0;
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index e99d5bd4..75ac94c7 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -379,9 +379,9 @@ static void find_requiredby(pmpkg_t *pkg, pmdb_t *db, alpm_list_t **reqs)
for(i = _alpm_db_get_pkgcache(db); i; i = i->next) {
pmpkg_t *cachepkg = i->data;
- alpm_list_t *i;
- for(i = alpm_pkg_get_depends(cachepkg); i; i = i->next) {
- if(_alpm_depcmp(pkg, i->data)) {
+ alpm_list_t *j;
+ for(j = alpm_pkg_get_depends(cachepkg); j; j = j->next) {
+ if(_alpm_depcmp(pkg, j->data)) {
const char *cachepkgname = cachepkg->name;
if(alpm_list_find_str(*reqs, cachepkgname) == NULL) {
*reqs = alpm_list_add(*reqs, strdup(cachepkgname));
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index 7bd45423..6fbe08ae 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -299,13 +299,13 @@ int _alpm_unpack(pmhandle_t *handle, const char *archive, const char *prefix,
/* If specific files were requested, skip entries that don't match. */
if(list) {
- char *prefix = strdup(entryname);
+ char *entry_prefix = strdup(entryname);
char *p = strstr(prefix,"/");
if(p) {
*(p+1) = '\0';
}
- char *found = alpm_list_find_str(list, prefix);
- free(prefix);
+ char *found = alpm_list_find_str(list, entry_prefix);
+ free(entry_prefix);
if(!found) {
if(archive_read_data_skip(_archive) != ARCHIVE_OK) {
ret = 1;
@@ -487,22 +487,22 @@ int _alpm_run_chroot(pmhandle_t *handle, const char *path, char *const argv[])
} else {
/* this code runs for the parent only (wait on the child) */
int status;
- FILE *pipe;
+ FILE *pipe_file;
close(pipefd[1]);
- pipe = fdopen(pipefd[0], "r");
- if(pipe == NULL) {
+ pipe_file = fdopen(pipefd[0], "r");
+ if(pipe_file == NULL) {
close(pipefd[0]);
retval = 1;
} else {
- while(!feof(pipe)) {
+ while(!feof(pipe_file)) {
char line[PATH_MAX];
- if(fgets(line, PATH_MAX, pipe) == NULL)
+ if(fgets(line, PATH_MAX, pipe_file) == NULL)
break;
alpm_logaction(handle, "%s", line);
EVENT(handle->trans, PM_TRANS_EVT_SCRIPTLET_INFO, line, NULL);
}
- fclose(pipe);
+ fclose(pipe_file);
}
while(waitpid(pid, &status, 0) == -1) {