From 7760f5fe60253bd9aa674c6a6688d9d07668db2e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 25 Apr 2007 03:15:32 -0400 Subject: Remove more unnecessary stuff * Remove libintl.h from most files, as we only need to include it once in util.h where _() is defined. * Remove other unnecessary header inclusions. * Remove a macro that was only used once and replaced it with actual code. Signed-off-by: Dan McGee --- src/pacman/add.c | 1 - src/pacman/conf.c | 3 --- src/pacman/conf.h | 2 -- src/pacman/deptest.c | 1 - src/pacman/downloadprog.c | 5 ----- src/pacman/log.c | 1 - src/pacman/package.c | 1 - src/pacman/pacman.c | 5 ++++- src/pacman/query.c | 1 - src/pacman/remove.c | 1 - src/pacman/sync.c | 1 - src/pacman/trans.c | 1 - src/pacman/util.c | 1 - src/pacman/util.h | 4 +++- 14 files changed, 7 insertions(+), 21 deletions(-) diff --git a/src/pacman/add.c b/src/pacman/add.c index f169eb84..65d666e9 100644 --- a/src/pacman/add.c +++ b/src/pacman/add.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include diff --git a/src/pacman/conf.c b/src/pacman/conf.c index 60b20515..8a438269 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -23,9 +23,6 @@ #include #include -#include -#include -#include #include diff --git a/src/pacman/conf.h b/src/pacman/conf.h index 05ef0b4c..4fff0abb 100644 --- a/src/pacman/conf.h +++ b/src/pacman/conf.h @@ -56,8 +56,6 @@ typedef struct __config_t { unsigned int ask; } config_t; -#define FREECONF(p) do { if(p) { config_free(p); p = NULL; } } while(0) - config_t *config_new(void); int config_free(config_t *config); diff --git a/src/pacman/deptest.c b/src/pacman/deptest.c index bce5641d..2877ef3d 100644 --- a/src/pacman/deptest.c +++ b/src/pacman/deptest.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include diff --git a/src/pacman/downloadprog.c b/src/pacman/downloadprog.c index 6ce8e2f5..fccdc322 100644 --- a/src/pacman/downloadprog.c +++ b/src/pacman/downloadprog.c @@ -21,15 +21,10 @@ #include "config.h" -#include #include #include #include -#include -#include -#include #include -#include #include #include diff --git a/src/pacman/log.c b/src/pacman/log.c index ca83df0b..e6298743 100644 --- a/src/pacman/log.c +++ b/src/pacman/log.c @@ -26,7 +26,6 @@ #include #include #include -#include #include diff --git a/src/pacman/package.c b/src/pacman/package.c index a09529a3..d9b63088 100644 --- a/src/pacman/package.c +++ b/src/pacman/package.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 5fd32ba7..6178b71a 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -233,7 +233,10 @@ static void cleanup(int signum) /* free memory */ FREELIST(pm_targets); - FREECONF(config); + if(config) { + config_free(config); + config = NULL; + } /* This fixes up any missing newlines (neednl) */ MSG(NL, ""); diff --git a/src/pacman/query.c b/src/pacman/query.c index 6997a7a7..02be63aa 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include diff --git a/src/pacman/remove.c b/src/pacman/remove.c index cf9b6293..e62c641d 100644 --- a/src/pacman/remove.c +++ b/src/pacman/remove.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 9c6250ce..fa781c10 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -30,7 +30,6 @@ #endif #include #include -#include #ifdef CYGWIN #include /* PATH_MAX */ #endif diff --git a/src/pacman/trans.c b/src/pacman/trans.c index 7f5c61c8..8efa6d07 100644 --- a/src/pacman/trans.c +++ b/src/pacman/trans.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include diff --git a/src/pacman/util.c b/src/pacman/util.c index 9c79cf5f..1fb6ead9 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -37,7 +37,6 @@ #include #include #include -#include #ifdef CYGWIN #include /* PATH_MAX */ #endif diff --git a/src/pacman/util.h b/src/pacman/util.h index 6eba38fe..f12ec6f1 100644 --- a/src/pacman/util.h +++ b/src/pacman/util.h @@ -23,7 +23,7 @@ #include #include -#include +#include /* here so it doesn't need to be included elsewhere */ #include @@ -49,7 +49,9 @@ /* update speed for the fill_progress based functions */ #define UPDATE_SPEED_SEC 0.2f +/* define _() as shortcut for gettext() */ #define _(str) gettext(str) + int getcols(); int makepath(char *path); int rmrf(char *path); -- cgit v1.2.3-70-g09d2