diff options
author | Dan McGee <dan@archlinux.org> | 2011-04-21 22:39:31 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-04-22 22:58:19 +0200 |
commit | 53c749ce0aa55307fff2b419501da509212ae9ba (patch) | |
tree | 5d4ee2e66fdea328710f37a0bb5fc1355767eb0c /lib | |
parent | 1ff04b980f65769ae63b162f7206579da2f57e1c (diff) | |
download | pacman-53c749ce0aa55307fff2b419501da509212ae9ba.tar.gz pacman-53c749ce0aa55307fff2b419501da509212ae9ba.tar.xz |
libalpm/dload: const and static correctness
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libalpm/dload.c | 11 | ||||
-rw-r--r-- | lib/libalpm/dload.h | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 40099b61..f7568282 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -46,7 +46,7 @@ static double prevprogress; /* last download amount */ #endif -static char *get_filename(const char *url) +static const char *get_filename(const char *url) { char *filename = strrchr(url, '/'); if(filename != NULL) { @@ -71,9 +71,10 @@ static char *get_fullpath(const char *path, const char *filename, #define check_stop() if(dload_interrupted) { ret = -1; goto cleanup; } enum sighandlers { OLD = 0, NEW = 1 }; -int dload_interrupted; +static int dload_interrupted; static void inthandler(int signum) { + (void)signum; dload_interrupted = 1; } @@ -119,7 +120,7 @@ static int curl_progress(void *file, double dltotal, double dlnow, static int curl_gethost(const char *url, char *buffer) { - int hostlen; + size_t hostlen; char *p; if(strncmp(url, "file://", 7) == 0) { @@ -382,8 +383,8 @@ int _alpm_download_files(alpm_list_t *files, /** Fetch a remote pkg. */ char SYMEXPORT *alpm_fetch_pkgurl(const char *url) { - char *filename, *filepath; - const char *cachedir; + char *filepath; + const char *filename, *cachedir; int ret; ALPM_LOG_FUNC; diff --git a/lib/libalpm/dload.h b/lib/libalpm/dload.h index 5ce44b8a..324bd118 100644 --- a/lib/libalpm/dload.h +++ b/lib/libalpm/dload.h @@ -27,7 +27,7 @@ /* internal structure for communicating with curl progress callback */ struct fileinfo { - char *filename; + const char *filename; double initial_size; }; |