summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXavier Chantry <shiningxc@gmail.com>2009-12-05 01:50:09 +0100
committerDan McGee <dan@archlinux.org>2010-03-15 01:25:48 +0100
commit1aa1d00248ac89fb02e762b96c58559a04679b2e (patch)
tree0326bf37268fa6167f4b17e38b58bda598a82da4 /src
parentbe2f43191d0d0cdf02d72ac72a013697b0f7e879 (diff)
downloadpacman-1aa1d00248ac89fb02e762b96c58559a04679b2e.tar.gz
pacman-1aa1d00248ac89fb02e762b96c58559a04679b2e.tar.xz
fix a few warnings reported by clang
- remove unused variables - some more sanity checks - safer printf Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/callback.c4
-rw-r--r--src/pacman/pacman.c2
-rw-r--r--src/pacman/util.c2
3 files changed, 5 insertions, 3 deletions
diff --git a/src/pacman/callback.c b/src/pacman/callback.c
index d2d94d9b..b021d9db 100644
--- a/src/pacman/callback.c
+++ b/src/pacman/callback.c
@@ -371,6 +371,8 @@ void cb_trans_progress(pmtransprog_t event, const char *pkgname, int percent,
case PM_TRANS_PROGRESS_CONFLICTS_START:
opr = _("checking for file conflicts");
break;
+ default:
+ return;
}
/* find # of digits in package counts to scale output */
@@ -517,7 +519,7 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total)
gettimeofday(&initial_time, NULL);
xfered_last = (off_t)0;
rate_last = 0.0;
- timediff = get_update_timediff(1);
+ get_update_timediff(1);
}
} else if(file_xfered == file_total) {
/* compute final values */
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index d4385ebc..4559f8c6 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -219,7 +219,7 @@ static void setarch(const char *arch)
static void cleanup(int ret) {
/* free alpm library resources */
if(alpm_release() == -1) {
- pm_printf(PM_LOG_ERROR, alpm_strerrorlast());
+ pm_printf(PM_LOG_ERROR, "%s\n", alpm_strerrorlast());
}
/* free memory */
diff --git a/src/pacman/util.c b/src/pacman/util.c
index fb6f5219..e421e9d5 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -229,7 +229,7 @@ void indentprint(const char *str, int indent)
p = wcstr;
cidx = indent;
- if(!p) {
+ if(!p || !len) {
return;
}