summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2014-10-16 15:36:55 +0200
committerAllan McRae <allan@archlinux.org>2014-10-19 20:48:40 +1000
commitd649dc669db2201b274919223ed0aa6b7c37d70d (patch)
tree3b2e729db64ab7cac2632ae7cdb3d736750a6356 /lib
parent91876c21f16ec14b8b7362a98b72588aeb893ea3 (diff)
downloadpacman-d649dc669db2201b274919223ed0aa6b7c37d70d.tar.xz
dload: mark final_url as const
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/be_sync.c3
-rw-r--r--lib/libalpm/dload.c8
-rw-r--r--lib/libalpm/dload.h2
3 files changed, 6 insertions, 7 deletions
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 */