diff options
author | Randy Dunlap | 2007-10-08 18:59:18 +0200 |
---|---|---|
committer | Karel Zak | 2007-10-11 13:02:45 +0200 |
commit | 830d6af09972a79ae7a6786afcb567d9d2cd5d24 (patch) | |
tree | b80dbb3d321e6b864c304b3b78327adf85880537 /mount/lomount.c | |
parent | setterm: dump by TIOCLINUX is deprecated since linux 1.1.92. (diff) | |
download | kernel-qcow2-util-linux-830d6af09972a79ae7a6786afcb567d9d2cd5d24.tar.gz kernel-qcow2-util-linux-830d6af09972a79ae7a6786afcb567d9d2cd5d24.tar.xz kernel-qcow2-util-linux-830d6af09972a79ae7a6786afcb567d9d2cd5d24.zip |
losetup: clean up gcc warnings
Fix strict gcc warnings that come from using:
("-Wall -Wp,-D_FORTIFY_SOURCE=2")
lomount.c:98: warning: pointer targets in initialization differ in signedness
lomount.c:111: warning: format '%04x' expects type 'unsigned int', but argument 4 has type '__kernel_old_dev_t'
lomount.c:300: warning: pointer targets in passing argument 1 of 'xstrncpy' differ in signedness
lomount.c:307: warning: pointer targets in passing argument 1 of '__builtin___snprintf_chk' differ in signedness
lomount.c:339: warning: pointer targets in passing argument 1 of 'xstrncpy' differ in signedness
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Diffstat (limited to 'mount/lomount.c')
-rw-r--r-- | mount/lomount.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mount/lomount.c b/mount/lomount.c index ace474cb3..737194e91 100644 --- a/mount/lomount.c +++ b/mount/lomount.c @@ -95,7 +95,7 @@ show_loop(char *device) { if (loopinfo64.lo_encrypt_type || loopinfo64.lo_crypt_name[0]) { - char *e = loopinfo64.lo_crypt_name; + char *e = (char *)loopinfo64.lo_crypt_name; if (*e == 0 && loopinfo64.lo_encrypt_type == 1) e = "XOR"; @@ -109,7 +109,7 @@ show_loop(char *device) { if (ioctl(fd, LOOP_GET_STATUS, &loopinfo) == 0) { printf ("%s: [%04x]:%ld (%s)", - device, loopinfo.lo_device, loopinfo.lo_inode, + device, (unsigned int)loopinfo.lo_device, loopinfo.lo_inode, loopinfo.lo_name); if (loopinfo.lo_offset) @@ -297,14 +297,14 @@ set_loop(const char *device, const char *file, unsigned long long offset, memset(&loopinfo64, 0, sizeof(loopinfo64)); - xstrncpy(loopinfo64.lo_file_name, file, LO_NAME_SIZE); + xstrncpy((char *)loopinfo64.lo_file_name, file, LO_NAME_SIZE); if (encryption && *encryption) { if (digits_only(encryption)) { loopinfo64.lo_encrypt_type = atoi(encryption); } else { loopinfo64.lo_encrypt_type = LO_CRYPT_CRYPTOAPI; - snprintf(loopinfo64.lo_crypt_name, LO_NAME_SIZE, + snprintf((char *)loopinfo64.lo_crypt_name, LO_NAME_SIZE, "%s", encryption); } } @@ -336,7 +336,7 @@ set_loop(const char *device, const char *file, unsigned long long offset, pass = xgetpass(pfd, _("Password: ")); gotpass: memset(loopinfo64.lo_encrypt_key, 0, LO_KEY_SIZE); - xstrncpy(loopinfo64.lo_encrypt_key, pass, LO_KEY_SIZE); + xstrncpy((char *)loopinfo64.lo_encrypt_key, pass, LO_KEY_SIZE); memset(pass, 0, strlen(pass)); loopinfo64.lo_encrypt_key_size = LO_KEY_SIZE; } |