everywhere: warning cleanups

pull/4/merge
William Pitcock 2012-05-03 17:15:45 +00:00
parent 290107de84
commit ccda6b3752
3 changed files with 6 additions and 7 deletions

View File

@ -3,7 +3,7 @@ SRCS = main.c parse.c pkg.c bsdstubs.c getopt_long.c
include buildsys.mk
CFLAGS += -DPKG_DEFAULT_PATH=\"${libdir}/pkgconfig\"
CFLAGS += -DPKG_DEFAULT_PATH=\"${libdir}/pkgconfig\" -Wall
install-extra:
mkdir -p $(DESTDIR)/$(datarootdir)/aclocal

View File

@ -176,7 +176,6 @@ pkg_dependency_t *
parse_deplist(pkg_t *pkg, const char *depends)
{
parse_state_t state = OUTSIDE_MODULE;
parse_state_t last_state = OUTSIDE_MODULE;
pkg_dependency_t *deplist = NULL;
pkg_dependency_t *deplist_head = NULL;
pkg_comparator_t compare = PKG_ANY;

10
pkg.c
View File

@ -63,7 +63,7 @@ pkg_find(const char *name, unsigned int flags)
{
char locbuf[PKG_CONFIG_PATH_SZ];
char **path;
size_t count, iter;
size_t count, iter = 0;
const char *env_path;
FILE *f;
@ -78,7 +78,7 @@ pkg_find(const char *name, unsigned int flags)
snprintf(locbuf, sizeof locbuf, "%s/%s" PKG_CONFIG_EXT, path[iter], name);
free(path[iter]);
if (f = fopen(locbuf, "r"))
if ((f = fopen(locbuf, "r")) != NULL)
return parse_file(locbuf, f);
iter++;
@ -90,7 +90,7 @@ pkg_find(const char *name, unsigned int flags)
if (!(flags & PKGF_ENV_ONLY))
{
snprintf(locbuf, sizeof locbuf, "%s/%s" PKG_CONFIG_EXT, PKG_DEFAULT_PATH, name);
if (f = fopen(locbuf, "r"))
if ((f = fopen(locbuf, "r")) != NULL)
return parse_file(locbuf, f);
}
@ -230,6 +230,8 @@ pkg_get_comparator(pkg_dependency_t *pkgdep)
return "!=";
case PKG_ANY:
return "(any)";
default:
return "???";
}
return "???";
@ -341,8 +343,6 @@ pkg_traverse(pkg_t *root,
int maxdepth,
unsigned int flags)
{
pkg_dependency_t *node;
if (maxdepth == 0)
return;