1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-23 00:08:50 -05:00

libalpm/dload: const and static correctness

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2011-04-21 15:39:31 -05:00
parent 1ff04b980f
commit 53c749ce0a
2 changed files with 7 additions and 6 deletions

View File

@ -46,7 +46,7 @@
static double prevprogress; /* last download amount */ static double prevprogress; /* last download amount */
#endif #endif
static char *get_filename(const char *url) static const char *get_filename(const char *url)
{ {
char *filename = strrchr(url, '/'); char *filename = strrchr(url, '/');
if(filename != NULL) { 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; } #define check_stop() if(dload_interrupted) { ret = -1; goto cleanup; }
enum sighandlers { OLD = 0, NEW = 1 }; enum sighandlers { OLD = 0, NEW = 1 };
int dload_interrupted; static int dload_interrupted;
static void inthandler(int signum) static void inthandler(int signum)
{ {
(void)signum;
dload_interrupted = 1; 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) static int curl_gethost(const char *url, char *buffer)
{ {
int hostlen; size_t hostlen;
char *p; char *p;
if(strncmp(url, "file://", 7) == 0) { if(strncmp(url, "file://", 7) == 0) {
@ -382,8 +383,8 @@ int _alpm_download_files(alpm_list_t *files,
/** Fetch a remote pkg. */ /** Fetch a remote pkg. */
char SYMEXPORT *alpm_fetch_pkgurl(const char *url) char SYMEXPORT *alpm_fetch_pkgurl(const char *url)
{ {
char *filename, *filepath; char *filepath;
const char *cachedir; const char *filename, *cachedir;
int ret; int ret;
ALPM_LOG_FUNC; ALPM_LOG_FUNC;

View File

@ -27,7 +27,7 @@
/* internal structure for communicating with curl progress callback */ /* internal structure for communicating with curl progress callback */
struct fileinfo { struct fileinfo {
char *filename; const char *filename;
double initial_size; double initial_size;
}; };