summaryrefslogtreecommitdiff
path: root/src/util/testdb.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-10-11 20:20:06 -0500
committerDan McGee <dan@archlinux.org>2010-10-11 20:29:22 -0500
commit0ff2a9149711b9179d288f579c792890cd81d79b (patch)
treee6828df064a844ecf44992f8773f3a4c69369d73 /src/util/testdb.c
parent05f0a28932c1acab7a9ddb58435d69626dad54da (diff)
downloadpacman-0ff2a9149711b9179d288f579c792890cd81d79b.tar.xz
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 <dan@archlinux.org>
Diffstat (limited to 'src/util/testdb.c')
-rw-r--r--src/util/testdb.c17
1 files changed, 6 insertions, 11 deletions
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 <pacman db>] : 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;