summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pacman/callback.c10
-rw-r--r--src/pacman/sync.c4
-rw-r--r--src/pacman/upgrade.c1
-rw-r--r--src/pacman/util.c2
-rw-r--r--src/util/pactree.c4
-rw-r--r--src/util/testpkg.c2
6 files changed, 10 insertions, 13 deletions
diff --git a/src/pacman/callback.c b/src/pacman/callback.c
index 66b14cdd..ffca8bec 100644
--- a/src/pacman/callback.c
+++ b/src/pacman/callback.c
@@ -623,14 +623,14 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total)
/* if padwid is < 0, we need to trim the string so padwid = 0 */
if(padwid < 0) {
int i = filenamelen - 3;
- wchar_t *p = wcfname;
+ wchar_t *wcp = wcfname;
/* grab the max number of char columns we can fill */
- while(i > 0 && wcwidth(*p) < i) {
- i -= wcwidth(*p);
- p++;
+ while(i > 0 && wcwidth(*wcp) < i) {
+ i -= wcwidth(*wcp);
+ wcp++;
}
/* then add the ellipsis and fill out any extra padding */
- wcscpy(p, L"...");
+ wcscpy(wcp, L"...");
padwid = i;
}
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index f242c827..fa30b8da 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -443,7 +443,6 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets)
if(targets) {
for(i = targets; i; i = alpm_list_next(i)) {
- pmdb_t *db = NULL;
int foundpkg = 0;
char target[512]; /* TODO is this enough space? */
@@ -452,6 +451,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets)
strncpy(target, i->data, 512);
pkgstr = strchr(target, '/');
if(pkgstr) {
+ pmdb_t *db = NULL;
repo = target;
*pkgstr = '\0';
++pkgstr;
@@ -767,7 +767,6 @@ static int sync_trans(alpm_list_t *targets)
pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"),
alpm_strerror(err));
switch(err) {
- alpm_list_t *i;
case PM_ERR_PKG_INVALID_ARCH:
for(i = data; i; i = alpm_list_next(i)) {
char *pkg = alpm_list_getdata(i);
@@ -835,7 +834,6 @@ static int sync_trans(alpm_list_t *targets)
pm_fprintf(stderr, PM_LOG_ERROR, _("failed to commit transaction (%s)\n"),
alpm_strerror(err));
switch(err) {
- alpm_list_t *i;
case PM_ERR_FILE_CONFLICTS:
for(i = data; i; i = alpm_list_next(i)) {
pmfileconflict_t *conflict = alpm_list_getdata(i);
diff --git a/src/pacman/upgrade.c b/src/pacman/upgrade.c
index 6587671b..c1f72f6d 100644
--- a/src/pacman/upgrade.c
+++ b/src/pacman/upgrade.c
@@ -166,7 +166,6 @@ int pacman_upgrade(alpm_list_t *targets)
pm_fprintf(stderr, PM_LOG_ERROR, _("failed to commit transaction (%s)\n"),
alpm_strerror(err));
switch(err) {
- alpm_list_t *i;
case PM_ERR_FILE_CONFLICTS:
for(i = data; i; i = alpm_list_next(i)) {
pmfileconflict_t *conflict = alpm_list_getdata(i);
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 77a7e56c..75e67170 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -589,7 +589,7 @@ void list_display(const char *title, const alpm_list_t *list)
printf("%s", str);
cols += string_length(str);
for(i = alpm_list_next(list); i; i = alpm_list_next(i)) {
- const char *str = alpm_list_getdata(i);
+ str = alpm_list_getdata(i);
int s = string_length(str);
/* wrap only if we have enough usable column space */
if(maxcols > len && cols + s + 2 >= maxcols) {
diff --git a/src/util/pactree.c b/src/util/pactree.c
index 2f79b66d..5beaa5a7 100644
--- a/src/util/pactree.c
+++ b/src/util/pactree.c
@@ -120,7 +120,7 @@ static char *strtrim(char *str)
return str;
}
-static int register_syncs(pmhandle_t *handle) {
+static int register_syncs(void) {
FILE *fp;
char *ptr, *section = NULL;
char line[LINE_MAX];
@@ -421,7 +421,7 @@ int main(int argc, char *argv[])
}
if(searchsyncs) {
- if(register_syncs(handle) != 0) {
+ if(register_syncs() != 0) {
fprintf(stderr, "error: failed to register sync DBs\n");
ret = 1;
goto finish;
diff --git a/src/util/testpkg.c b/src/util/testpkg.c
index c6f02e34..d4d058d8 100644
--- a/src/util/testpkg.c
+++ b/src/util/testpkg.c
@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
if(alpm_pkg_load(handle, argv[1], 1, PM_PGP_VERIFY_OPTIONAL, &pkg) == -1
|| pkg == NULL) {
- enum _pmerrno_t err = alpm_errno(handle);
+ err = alpm_errno(handle);
switch(err) {
case PM_ERR_PKG_OPEN:
printf("Cannot open the given file.\n");