Fix some errors spit out by -Wextra
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
16c91bedf8
commit
fc65a9bcb1
7 changed files with 15 additions and 16 deletions
|
@ -715,7 +715,7 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
|
||||||
/* pre_upgrade scriptlet */
|
/* pre_upgrade scriptlet */
|
||||||
if(alpm_pkg_has_scriptlet(newpkg) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
|
if(alpm_pkg_has_scriptlet(newpkg) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
|
||||||
_alpm_runscriptlet(handle->root, newpkg->origin_data.file,
|
_alpm_runscriptlet(handle->root, newpkg->origin_data.file,
|
||||||
"pre_upgrade", newpkg->version, oldpkg->version, trans);
|
"pre_upgrade", newpkg->version, oldpkg->version);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
is_upgrade = 0;
|
is_upgrade = 0;
|
||||||
|
@ -727,7 +727,7 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
|
||||||
/* pre_install scriptlet */
|
/* pre_install scriptlet */
|
||||||
if(alpm_pkg_has_scriptlet(newpkg) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
|
if(alpm_pkg_has_scriptlet(newpkg) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
|
||||||
_alpm_runscriptlet(handle->root, newpkg->origin_data.file,
|
_alpm_runscriptlet(handle->root, newpkg->origin_data.file,
|
||||||
"pre_install", newpkg->version, NULL, trans);
|
"pre_install", newpkg->version, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -904,10 +904,10 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
|
||||||
if(is_upgrade) {
|
if(is_upgrade) {
|
||||||
_alpm_runscriptlet(handle->root, scriptlet, "post_upgrade",
|
_alpm_runscriptlet(handle->root, scriptlet, "post_upgrade",
|
||||||
alpm_pkg_get_version(newpkg),
|
alpm_pkg_get_version(newpkg),
|
||||||
oldpkg ? alpm_pkg_get_version(oldpkg) : NULL, trans);
|
oldpkg ? alpm_pkg_get_version(oldpkg) : NULL);
|
||||||
} else {
|
} else {
|
||||||
_alpm_runscriptlet(handle->root, scriptlet, "post_install",
|
_alpm_runscriptlet(handle->root, scriptlet, "post_install",
|
||||||
alpm_pkg_get_version(newpkg), NULL, trans);
|
alpm_pkg_get_version(newpkg), NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -293,7 +293,7 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db)
|
||||||
/* run the pre-remove scriptlet if it exists */
|
/* run the pre-remove scriptlet if it exists */
|
||||||
if(alpm_pkg_has_scriptlet(info) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
|
if(alpm_pkg_has_scriptlet(info) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
|
||||||
_alpm_runscriptlet(handle->root, scriptlet, "pre_remove",
|
_alpm_runscriptlet(handle->root, scriptlet, "pre_remove",
|
||||||
alpm_pkg_get_version(info), NULL, trans);
|
alpm_pkg_get_version(info), NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -326,7 +326,7 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db)
|
||||||
/* run the post-remove script if it exists */
|
/* run the post-remove script if it exists */
|
||||||
if(alpm_pkg_has_scriptlet(info) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
|
if(alpm_pkg_has_scriptlet(info) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
|
||||||
_alpm_runscriptlet(handle->root, scriptlet, "post_remove",
|
_alpm_runscriptlet(handle->root, scriptlet, "post_remove",
|
||||||
alpm_pkg_get_version(info), NULL, trans);
|
alpm_pkg_get_version(info), NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -569,7 +569,7 @@ static int grep(const char *fn, const char *needle)
|
||||||
|
|
||||||
int _alpm_runscriptlet(const char *root, const char *installfn,
|
int _alpm_runscriptlet(const char *root, const char *installfn,
|
||||||
const char *script, const char *ver,
|
const char *script, const char *ver,
|
||||||
const char *oldver, pmtrans_t *trans)
|
const char *oldver)
|
||||||
{
|
{
|
||||||
char scriptfn[PATH_MAX];
|
char scriptfn[PATH_MAX];
|
||||||
char cmdline[PATH_MAX];
|
char cmdline[PATH_MAX];
|
||||||
|
|
|
@ -81,7 +81,7 @@ int _alpm_trans_commit(pmtrans_t *trans, alpm_list_t **data);
|
||||||
int _alpm_trans_update_depends(pmtrans_t *trans, pmpkg_t *pkg);
|
int _alpm_trans_update_depends(pmtrans_t *trans, pmpkg_t *pkg);
|
||||||
int _alpm_runscriptlet(const char *root, const char *installfn,
|
int _alpm_runscriptlet(const char *root, const char *installfn,
|
||||||
const char *script, const char *ver,
|
const char *script, const char *ver,
|
||||||
const char *oldver, pmtrans_t *trans);
|
const char *oldver);
|
||||||
|
|
||||||
#endif /* _ALPM_TRANS_H */
|
#endif /* _ALPM_TRANS_H */
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ static int prevpercent=0; /* for less progressbar output */
|
||||||
static float get_update_timediff(int first_call)
|
static float get_update_timediff(int first_call)
|
||||||
{
|
{
|
||||||
float retval = 0.0;
|
float retval = 0.0;
|
||||||
static struct timeval last_time = {0};
|
static struct timeval last_time = {0, 0};
|
||||||
|
|
||||||
/* on first call, simply set the last time and return */
|
/* on first call, simply set the last time and return */
|
||||||
if(first_call) {
|
if(first_call) {
|
||||||
|
|
|
@ -21,8 +21,7 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
/* TODO hard to believe all these are needed just for this file */
|
#include <stdlib.h> /* atoi */
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
|
@ -31,10 +30,10 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h> /* uname */
|
||||||
#include <libintl.h>
|
#include <libintl.h> /* bindtextdomain, textdomain */
|
||||||
#include <locale.h>
|
#include <locale.h> /* setlocale */
|
||||||
#include <time.h>
|
#include <time.h> /* time_t */
|
||||||
#if defined(PACMAN_DEBUG) && defined(HAVE_MTRACE)
|
#if defined(PACMAN_DEBUG) && defined(HAVE_MTRACE)
|
||||||
#include <mcheck.h> /* debug tracing (mtrace) */
|
#include <mcheck.h> /* debug tracing (mtrace) */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -162,7 +162,7 @@ void indentprint(const char *str, int indent)
|
||||||
while(*p) {
|
while(*p) {
|
||||||
if(*p == ' ') {
|
if(*p == ' ') {
|
||||||
const char *next = NULL;
|
const char *next = NULL;
|
||||||
unsigned int len;
|
int len;
|
||||||
p++;
|
p++;
|
||||||
if(p == NULL || *p == ' ') continue;
|
if(p == NULL || *p == ' ') continue;
|
||||||
next = strchr(p, ' ');
|
next = strchr(p, ' ');
|
||||||
|
|
Loading…
Add table
Reference in a new issue