Merge lp:~colin-king/ecryptfs/ecryptfs-fix-32bit-warnings into lp:ecryptfs

Proposed by Colin Ian King
Status: Merged
Merged at revision: 775
Proposed branch: lp:~colin-king/ecryptfs/ecryptfs-fix-32bit-warnings
Merge into: lp:ecryptfs
Diff against target: 76 lines (+7/-6)
4 files modified
src/libecryptfs/ecryptfs-stat.c (+1/-1)
tests/kernel/extend-file-random/test.c (+2/-2)
tests/kernel/inode-race-stat/test.c (+3/-2)
tests/kernel/trunc-file/test.c (+1/-1)
To merge this branch: bzr merge lp:~colin-king/ecryptfs/ecryptfs-fix-32bit-warnings
Reviewer Review Type Date Requested Status
eCryptfs Pending
Review via email: mp+153163@code.launchpad.net

Description of the change

Fixed some 32 bit build warnings

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/libecryptfs/ecryptfs-stat.c'
2--- src/libecryptfs/ecryptfs-stat.c 2009-02-09 17:29:17 +0000
3+++ src/libecryptfs/ecryptfs-stat.c 2013-03-13 15:03:25 +0000
4@@ -146,7 +146,7 @@
5 if (buf_size < (ECRYPTFS_FILE_SIZE_BYTES
6 + MAGIC_ECRYPTFS_MARKER_SIZE_BYTES
7 + 4)) {
8- printf("%s: Invalid metadata size; must have at least [%lu] "
9+ printf("%s: Invalid metadata size; must have at least [%zu] "
10 "bytes; there are only [%zu] bytes\n", __FUNCTION__,
11 (ECRYPTFS_FILE_SIZE_BYTES
12 + MAGIC_ECRYPTFS_MARKER_SIZE_BYTES
13
14=== modified file 'tests/kernel/extend-file-random/test.c'
15--- tests/kernel/extend-file-random/test.c 2012-01-31 16:24:09 +0000
16+++ tests/kernel/extend-file-random/test.c 2013-03-13 15:03:25 +0000
17@@ -48,7 +48,7 @@
18 }
19
20 if (write(fd, buffer, len) != len) {
21- fprintf(stderr, "Failed to write %lu bytes, position %lu: %s\n",
22+ fprintf(stderr, "Failed to write %zu bytes, position %lu: %s\n",
23 len, offset, strerror(errno));
24 return TEST_FAILED;
25 }
26@@ -64,7 +64,7 @@
27 }
28
29 if (read(fd, buffer, len) != len) {
30- fprintf(stderr, "Failed to read %lu bytes, position %lu: %s\n",
31+ fprintf(stderr, "Failed to read %zu bytes, position %lu: %s\n",
32 len, offset, strerror(errno));
33 return TEST_FAILED;
34 }
35
36=== modified file 'tests/kernel/inode-race-stat/test.c'
37--- tests/kernel/inode-race-stat/test.c 2012-07-19 17:16:43 +0000
38+++ tests/kernel/inode-race-stat/test.c 2013-03-13 15:03:25 +0000
39@@ -34,6 +34,7 @@
40 #include <stdlib.h>
41 #include <stdbool.h>
42 #include <string.h>
43+#include <stdint.h>
44
45 #include <unistd.h>
46 #include <fcntl.h>
47@@ -122,7 +123,7 @@
48 if (cmd[0] == CMD_TEST) {
49 int ret;
50 off_t sz;
51- sscanf(cmd+1, "%zd", &sz);
52+ sscanf(cmd+1, "%jd", (intmax_t *)&sz);
53
54 ret = check_size(filename, sz);
55 switch (ret) {
56@@ -307,7 +308,7 @@
57 }
58
59 /* Now tell children to stat the file */
60- snprintf(cmd, sizeof(cmd), "%c%zd", CMD_TEST, sz);
61+ snprintf(cmd, sizeof(cmd), "%c%jd", CMD_TEST, (intmax_t)sz);
62 for (i = 0; i < threads; i++) {
63 if (write(pipe_to[i][1], cmd, strlen(cmd)+1) < 0) {
64 fprintf(stderr, "write to pipe failed: %s\n",
65
66=== modified file 'tests/kernel/trunc-file/test.c'
67--- tests/kernel/trunc-file/test.c 2012-01-31 17:10:46 +0000
68+++ tests/kernel/trunc-file/test.c 2013-03-13 15:03:25 +0000
69@@ -272,7 +272,7 @@
70
71 len *= 1024;
72 if (len > SSIZE_MAX) {
73- fprintf(stderr, "size should be < %zd\n", SSIZE_MAX / 1024);
74+ fprintf(stderr, "size should be < %zd\n", (ssize_t)SSIZE_MAX / 1024);
75 exit(TEST_ERROR);
76 }
77

Subscribers

People subscribed via source and target branches