From d649dc669db2201b274919223ed0aa6b7c37d70d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 16 Oct 2014 15:36:55 +0200 Subject: dload: mark final_url as const Signed-off-by: Allan McRae --- lib/libalpm/be_sync.c | 3 +-- lib/libalpm/dload.c | 8 ++++---- lib/libalpm/dload.h | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index 6572a8ad..62fd0f04 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -209,8 +209,7 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db) } for(i = db->servers; i; i = i->next) { - char *final_db_url = NULL; - const char *server = i->data; + const char *server = i->data, *final_db_url = NULL; struct dload_payload payload; size_t len; int sig_ret = 0; diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 43c15035..e3409f99 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -388,7 +388,7 @@ static FILE *create_tempfile(struct dload_payload *payload, const char *localpat #define HOSTNAME_SIZE 256 static int curl_download_internal(struct dload_payload *payload, - const char *localpath, char **final_file, char **final_url) + const char *localpath, char **final_file, const char **final_url) { int ret = -1; FILE *localf = NULL; @@ -622,7 +622,7 @@ cleanup: * @return 0 on success, -1 on error (pm_errno is set accordingly if errors_ok == 0) */ int _alpm_download(struct dload_payload *payload, const char *localpath, - char **final_file, char **final_url) + char **final_file, const char **final_url) { alpm_handle_t *handle = payload->handle; @@ -664,8 +664,8 @@ static char *filecache_find_url(alpm_handle_t *handle, const char *url) char SYMEXPORT *alpm_fetch_pkgurl(alpm_handle_t *handle, const char *url) { char *filepath; - const char *cachedir; - char *final_file = NULL, *final_pkg_url = NULL; + const char *cachedir, *final_pkg_url = NULL; + char *final_file = NULL; struct dload_payload payload; int ret = 0; diff --git a/lib/libalpm/dload.h b/lib/libalpm/dload.h index 10c586e9..512a376b 100644 --- a/lib/libalpm/dload.h +++ b/lib/libalpm/dload.h @@ -49,7 +49,7 @@ struct dload_payload { void _alpm_dload_payload_reset(struct dload_payload *payload); int _alpm_download(struct dload_payload *payload, const char *localpath, - char **final_file, char **final_url); + char **final_file, const char **final_url); #endif /* _ALPM_DLOAD_H */ -- cgit v1.2.3-70-g09d2