summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-04-27 02:23:03 +0200
committerDan McGee <dan@archlinux.org>2007-04-28 02:40:29 +0200
commit69bc2e62fe2b94bb1189959e4ed396ffbf5088e1 (patch)
tree2a7b3720c44a2bb25b96e2a9192e18f0131896ee
parent3cf8a333d04cd8b55edfe63bd8f4dd322a88a4d0 (diff)
downloadpacman-69bc2e62fe2b94bb1189959e4ed396ffbf5088e1.tar.gz
pacman-69bc2e62fe2b94bb1189959e4ed396ffbf5088e1.tar.xz
Remove FREESERVER macro and correctly type _alpm_server_free
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--lib/libalpm/alpm_list.c2
-rw-r--r--lib/libalpm/db.c5
-rw-r--r--lib/libalpm/server.c4
-rw-r--r--lib/libalpm/server.h4
4 files changed, 7 insertions, 8 deletions
diff --git a/lib/libalpm/alpm_list.c b/lib/libalpm/alpm_list.c
index 0f05df8a..4977f1ac 100644
--- a/lib/libalpm/alpm_list.c
+++ b/lib/libalpm/alpm_list.c
@@ -404,7 +404,7 @@ alpm_list_t *alpm_list_reverse(alpm_list_t *list)
*
* @return the first element in the list
*/
-alpm_list_t SYMEXPORT *alpm_list_first(alpm_list_t *list)
+inline alpm_list_t SYMEXPORT *alpm_list_first(alpm_list_t *list)
{
return(list);
}
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index 183f71d3..eef27b7e 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -83,7 +83,10 @@ void _alpm_db_free(pmdb_t *db)
{
ALPM_LOG_FUNC;
- _FREELIST(db->servers, _alpm_server_free);
+ alpm_list_t *tmp;
+ for(tmp = db->servers; tmp; tmp = alpm_list_next(tmp)) {
+ _alpm_server_free(tmp->data);
+ }
FREE(db->path);
FREE(db);
diff --git a/lib/libalpm/server.c b/lib/libalpm/server.c
index b9182a02..1b629a81 100644
--- a/lib/libalpm/server.c
+++ b/lib/libalpm/server.c
@@ -76,10 +76,8 @@ pmserver_t *_alpm_server_new(const char *url)
return server;
}
-void _alpm_server_free(void *data)
+void _alpm_server_free(pmserver_t *server)
{
- pmserver_t *server = data;
-
ALPM_LOG_FUNC;
if(server == NULL) {
diff --git a/lib/libalpm/server.h b/lib/libalpm/server.h
index 8c357ab2..b560f831 100644
--- a/lib/libalpm/server.h
+++ b/lib/libalpm/server.h
@@ -27,8 +27,6 @@
#include <time.h>
#include <download.h>
-#define FREESERVER(p) do { if(p){_alpm_server_free(p); p = NULL;}} while(0)
-
/* Servers */
struct __pmserver_t {
/* useless abstraction now? */
@@ -38,7 +36,7 @@ struct __pmserver_t {
#define PM_DLBUF_LEN (1024 * 10)
pmserver_t *_alpm_server_new(const char *url);
-void _alpm_server_free(void *data);
+void _alpm_server_free(pmserver_t *server);
int _alpm_downloadfiles(alpm_list_t *servers, const char *localpath, alpm_list_t *files);
int _alpm_downloadfiles_forreal(alpm_list_t *servers, const char *localpath,
alpm_list_t *files, const char *mtime1, char *mtime2);