Fix uses of "int" where "int64" should be used instead

Some structures use int for sizes and UNIX timestamps. On some
platforms, int is 32 bits, so this can lead to the year 2038 issues and
overflows when dealing with large containers or layers.

Consistently use int64 to store sizes and UNIX timestamps in
api/types/types.go. Update related to code accordingly (i.e.
strconv.FormatInt instead of strconv.Itoa).

Use int64 in progressreader package to avoid integer overflow when
dealing with large quantities. Update related code accordingly.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
This commit is contained in:
Aaron Lehmann
2015-07-31 16:31:40 -07:00
parent 8f2dca5386
commit 1f61084d83
22 changed files with 56 additions and 56 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ func TestOutputOnPrematureClose(t *testing.T) {
In: reader,
Out: writer,
Formatter: streamformatter.NewStreamFormatter(),
Size: len(content),
Size: int64(len(content)),
NewLines: true,
ID: "Test",
Action: "Read",
@@ -60,7 +60,7 @@ func TestCompleteSilently(t *testing.T) {
In: reader,
Out: writer,
Formatter: streamformatter.NewStreamFormatter(),
Size: len(content),
Size: int64(len(content)),
NewLines: true,
ID: "Test",
Action: "Read",