From 0ff2a9149711b9179d288f579c792890cd81d79b Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 11 Oct 2010 20:20:06 -0500 Subject: util: fall cleaning on single file programs * Add a bunch of static declarations where possible * Fix void functions to be proper syntax, e.g. void func(void) * Consistency fixes (such as argv references) * Remove dead str_cmp() function from testdb * Remove unneeded config.h header includes * vercmp: remove completely unnecessary string copying Signed-off-by: Dan McGee --- src/util/testdb.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/util/testdb.c') diff --git a/src/util/testdb.c b/src/util/testdb.c index 45a2626d..28f2b2b3 100644 --- a/src/util/testdb.c +++ b/src/util/testdb.c @@ -30,11 +30,6 @@ #define BASENAME "testdb" -int str_cmp(const void *s1, const void *s2) -{ - return(strcmp(s1, s2)); -} - static void cleanup(int signum) { if(alpm_release() == -1) { fprintf(stderr, "error releasing alpm: %s\n", alpm_strerrorlast()); @@ -100,7 +95,7 @@ static int db_test(char *dbpath, int local) return(ret); } -int checkdeps(alpm_list_t *pkglist) +static int checkdeps(alpm_list_t *pkglist) { alpm_list_t *data, *i; int ret = 0; @@ -119,7 +114,7 @@ int checkdeps(alpm_list_t *pkglist) return(ret); } -int checkconflicts(alpm_list_t *pkglist) +static int checkconflicts(alpm_list_t *pkglist) { alpm_list_t *data, *i; int ret = 0; @@ -135,7 +130,7 @@ int checkconflicts(alpm_list_t *pkglist) return(ret); } -int check_localdb(char *dbpath) { +static int check_localdb(char *dbpath) { char localdbpath[PATH_MAX]; int ret = 0; pmdb_t *db = NULL; @@ -159,7 +154,7 @@ int check_localdb(char *dbpath) { return(ret); } -int check_syncdbs(char *dbpath, alpm_list_t *dbnames) { +static int check_syncdbs(char *dbpath, alpm_list_t *dbnames) { char syncdbpath[PATH_MAX]; int ret = 0; pmdb_t *db = NULL; @@ -190,7 +185,7 @@ cleanup: return(ret); } -void usage() { +static void usage(void) { fprintf(stderr, "usage:\n"); fprintf(stderr, "\t%s [-b ] : check the local database\n", BASENAME); @@ -199,7 +194,7 @@ void usage() { exit(1); } -int main(int argc, char **argv) +int main(int argc, char *argv[]) { int ret = 0; char *dbpath = DBPATH; -- cgit v1.2.3-24-g4f1b