From ccda6b3752d28c97473b50b1b50e3d89fb6680a0 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Thu, 3 May 2012 17:15:45 +0000 Subject: [PATCH] everywhere: warning cleanups --- Makefile | 2 +- parse.c | 1 - pkg.c | 10 +++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index e1d4905..8ec9f06 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/parse.c b/parse.c index 0afbc59..4a93170 100644 --- a/parse.c +++ b/parse.c @@ -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; diff --git a/pkg.c b/pkg.c index 3015523..bf4409e 100644 --- a/pkg.c +++ b/pkg.c @@ -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;