Fix some more -Wextra warnings
This commit is contained in:
parent
03c9cb1388
commit
12a9049cfe
@ -7,7 +7,7 @@
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
|
||||
unsigned long prev_used_mem;
|
||||
long prev_used_mem;
|
||||
int used_mem_change_threshold;
|
||||
int delay;
|
||||
int usr1_received;
|
||||
@ -27,7 +27,7 @@ const char *parse(const char *buf)
|
||||
|
||||
while (nitems != (1<<6)-1 || !*ptr) {
|
||||
ret = sscanf(ptr, "%*s %d kB\n%n", &val, &len);
|
||||
if (ret < 1 || len < sizeof (unsigned long long)) {
|
||||
if (ret < 1 || len < (int)sizeof (unsigned long long)) {
|
||||
ptr += len;
|
||||
continue;
|
||||
}
|
||||
@ -95,7 +95,7 @@ void send_to_qmemman(struct xs_handle *xs, const char *data)
|
||||
}
|
||||
}
|
||||
|
||||
void usr1_handler(int sig) {
|
||||
void usr1_handler(int sig __attribute__((__unused__))) {
|
||||
usr1_received = 1;
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ typedef void (notify_progress_t)(int, int);
|
||||
void register_notify_progress(notify_progress_t *func);
|
||||
int copy_file(int outfd, int infd, long long size, unsigned long *crc32);
|
||||
const char *copy_file_status_to_str(int status);
|
||||
void set_size_limit(long long new_bytes_limit, long long new_files_limit);
|
||||
void set_size_limit(unsigned long long new_bytes_limit, unsigned long long new_files_limit);
|
||||
void set_verbose(int value);
|
||||
int write_all(int fd, const void *buf, int size);
|
||||
int read_all(int fd, void *buf, int size);
|
||||
|
@ -13,12 +13,14 @@
|
||||
#include "crc32.h"
|
||||
|
||||
char untrusted_namebuf[MAX_PATH_LENGTH];
|
||||
long long bytes_limit = 0;
|
||||
long long files_limit = 0;
|
||||
long long total_bytes = 0;
|
||||
long long total_files = 0;
|
||||
unsigned long long bytes_limit = 0;
|
||||
unsigned long long files_limit = 0;
|
||||
unsigned long long total_bytes = 0;
|
||||
unsigned long long total_files = 0;
|
||||
int verbose = 0;
|
||||
|
||||
void send_status_and_crc(int code, const char *last_filename);
|
||||
|
||||
void do_exit(int code, const char *last_filename)
|
||||
{
|
||||
close(0);
|
||||
@ -26,11 +28,8 @@ void do_exit(int code, const char *last_filename)
|
||||
exit(code);
|
||||
}
|
||||
|
||||
void set_size_limit(long long new_bytes_limit, long long new_files_limit)
|
||||
void set_size_limit(unsigned long long new_bytes_limit, unsigned long long new_files_limit)
|
||||
{
|
||||
if (new_bytes_limit < 0 || new_files_limit < 0) {
|
||||
do_exit(EINVAL, "");
|
||||
}
|
||||
bytes_limit = new_bytes_limit;
|
||||
files_limit = new_files_limit;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user