1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-11 03:54:59 -05:00

Remove FREESERVER macro and correctly type _alpm_server_free

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2007-04-26 20:23:03 -04:00
parent 3cf8a333d0
commit 69bc2e62fe
4 changed files with 7 additions and 8 deletions

View File

@ -404,7 +404,7 @@ alpm_list_t *alpm_list_reverse(alpm_list_t *list)
* *
* @return the first element in the 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); return(list);
} }

View File

@ -83,7 +83,10 @@ void _alpm_db_free(pmdb_t *db)
{ {
ALPM_LOG_FUNC; 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->path);
FREE(db); FREE(db);

View File

@ -76,10 +76,8 @@ pmserver_t *_alpm_server_new(const char *url)
return server; return server;
} }
void _alpm_server_free(void *data) void _alpm_server_free(pmserver_t *server)
{ {
pmserver_t *server = data;
ALPM_LOG_FUNC; ALPM_LOG_FUNC;
if(server == NULL) { if(server == NULL) {

View File

@ -27,8 +27,6 @@
#include <time.h> #include <time.h>
#include <download.h> #include <download.h>
#define FREESERVER(p) do { if(p){_alpm_server_free(p); p = NULL;}} while(0)
/* Servers */ /* Servers */
struct __pmserver_t { struct __pmserver_t {
/* useless abstraction now? */ /* useless abstraction now? */
@ -38,7 +36,7 @@ struct __pmserver_t {
#define PM_DLBUF_LEN (1024 * 10) #define PM_DLBUF_LEN (1024 * 10)
pmserver_t *_alpm_server_new(const char *url); 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(alpm_list_t *servers, const char *localpath, alpm_list_t *files);
int _alpm_downloadfiles_forreal(alpm_list_t *servers, const char *localpath, int _alpm_downloadfiles_forreal(alpm_list_t *servers, const char *localpath,
alpm_list_t *files, const char *mtime1, char *mtime2); alpm_list_t *files, const char *mtime1, char *mtime2);