Fix some compiler warnings introduced recently.

This commit is contained in:
Milan Broz
2015-01-15 12:27:34 +01:00
parent ea8864badf
commit b789b011a2
4 changed files with 6 additions and 4 deletions

View File

@@ -57,7 +57,6 @@ struct volume_key {
char key[]; char key[];
}; };
void crypt_memzero(void *s, size_t n);
struct volume_key *crypt_alloc_volume_key(unsigned keylength, const char *key); struct volume_key *crypt_alloc_volume_key(unsigned keylength, const char *key);
struct volume_key *crypt_generate_volume_key(struct crypt_device *cd, unsigned keylength); struct volume_key *crypt_generate_volume_key(struct crypt_device *cd, unsigned keylength);
void crypt_free_volume_key(struct volume_key *vk); void crypt_free_volume_key(struct volume_key *vk);

View File

@@ -374,7 +374,8 @@ static int crypt_uuid_cmp(const char *dm_uuid, const char *hdr_uuid)
static int crypt_uuid_type_cmp(struct crypt_device *cd, const char *type) static int crypt_uuid_type_cmp(struct crypt_device *cd, const char *type)
{ {
struct crypt_dm_active_device dmd = {}; struct crypt_dm_active_device dmd = {};
int r, len; size_t len;
int r;
/* Must user header-on-disk if we know type here */ /* Must user header-on-disk if we know type here */
if (cd->type || !cd->u.none.active_name) if (cd->type || !cd->u.none.active_name)

View File

@@ -45,6 +45,8 @@ void *crypt_safe_alloc(size_t size);
void crypt_safe_free(void *data); void crypt_safe_free(void *data);
void *crypt_safe_realloc(void *data, size_t size); void *crypt_safe_realloc(void *data, size_t size);
void crypt_memzero(void *s, size_t n);
ssize_t crypt_hex_to_bytes(const char *hex, char **result, int safe_alloc); ssize_t crypt_hex_to_bytes(const char *hex, char **result, int safe_alloc);
int crypt_string_to_size(struct crypt_device *cd, const char *s, uint64_t *size); int crypt_string_to_size(struct crypt_device *cd, const char *s, uint64_t *size);

View File

@@ -665,10 +665,10 @@ static ssize_t read_buf(int fd, void *buf, size_t count)
if (s == 0) if (s == 0)
return (ssize_t)read_size; return (ssize_t)read_size;
if (s > 0) { if (s > 0) {
if (s != count) if (s != (ssize_t)count)
log_dbg("Partial read %zd / %zu.", s, count); log_dbg("Partial read %zd / %zu.", s, count);
read_size += (size_t)s; read_size += (size_t)s;
buf += s; buf = (uint8_t*)buf + s;
} }
} while (read_size != count); } while (read_size != count);