1 --- vdo-6.2.3.91/utils/uds/fileIORegion.c.orig 2020-05-30 04:20:46.000000000 +0200
2 +++ vdo-6.2.3.91/utils/uds/fileIORegion.c 2020-06-01 06:23:23.271248367 +0200
5 if (offset + length > fior->size) {
6 return logErrorWithStringError(UDS_OUT_OF_RANGE,
7 - "range %zd-%zd not in range 0 to %zu",
8 + "range %"PRId64"-%"PRId64" not in range 0 to %zu",
9 offset, offset + length, fior->size);
12 --- vdo-6.2.3.91/utils/uds/indexLayout.c.orig 2020-05-30 04:20:46.000000000 +0200
13 +++ vdo-6.2.3.91/utils/uds/indexLayout.c 2020-06-01 06:25:49.170457963 +0200
16 if (iter.nextRegion != iter.lastRegion) {
17 return logErrorWithStringError(UDS_UNEXPECTED_RESULT,
18 - "expected %ld additional regions",
19 + "expected %td additional regions",
20 iter.lastRegion - iter.nextRegion);
22 if (iter.nextBlock != isl->indexSave.startBlock + isl->indexSave.numBlocks) {
23 --- vdo-6.2.3.91/utils/uds/threadsLinuxUser.c.orig 2020-05-30 04:20:46.000000000 +0200
24 +++ vdo-6.2.3.91/utils/uds/threadsLinuxUser.c 2020-06-01 06:28:58.816097231 +0200
26 int joinThreads(pthread_t th)
28 int result = pthread_join(th, NULL);
29 - return ASSERT_WITH_ERROR_CODE((result == 0), result, "th: %zu", th);
30 + return ASSERT_WITH_ERROR_CODE((result == 0), result, "th: %lu", th);
33 /**********************************************************************/
34 --- vdo-6.2.3.91/utils/uds/timeUtils.c.orig 2020-05-30 04:20:46.000000000 +0200
35 +++ vdo-6.2.3.91/utils/uds/timeUtils.c 2020-06-01 06:31:48.701843548 +0200
37 if (!isValidTime(time)) {
40 - if ((reltime >= 0) && (reltime < 10 * BILLION)) {
41 + if ((reltime >= 0) && (reltime < 10LL * BILLION)) {
42 reltime += time.tv_nsec;
43 while (reltime >= BILLION) {
47 // may not be accurate for times before the Epoch...
48 // (is the ns time positive or negative for negative time_t?)
49 - int64_t ns = time.tv_sec * BILLION + time.tv_nsec;
50 + int64_t ns = (int64_t)time.tv_sec * BILLION + time.tv_nsec;
51 if ((ns < INT64_MIN / 2) ||
52 (ns > INT64_MAX / 2) ||
53 (reltime < INT64_MIN / 2) ||
55 RelTime timeDifference(AbsTime a, AbsTime b)
57 if (isValidTime(a) && isValidTime(b)) {
58 - int64_t ans = a.tv_sec * BILLION + a.tv_nsec;
59 - int64_t bns = b.tv_sec * BILLION + b.tv_nsec;
60 + int64_t ans = (int64_t)a.tv_sec * BILLION + a.tv_nsec;
61 + int64_t bns = (int64_t)b.tv_sec * BILLION + b.tv_nsec;
63 } else if (isValidTime(a)) {
65 --- vdo-6.2.3.91/utils/vdo/user/fileLayer.c.orig 2020-05-30 04:20:46.000000000 +0200
66 +++ vdo-6.2.3.91/utils/vdo/user/fileLayer.c 2020-06-01 07:08:45.456501024 +0200
68 layer->blockCount = deviceBlocks;
69 } else if (layer->blockCount != deviceBlocks) {
70 result = logErrorWithStringError(VDO_PARAMETER_MISMATCH,
71 - "physical size %ld 4k blocks must match"
72 - " physical size %ld 4k blocks of %s",
73 + "physical size %"PRId64" 4k blocks must match"
74 + " physical size %"PRId64" 4k blocks of %s",
75 layer->blockCount, deviceBlocks,
77 tryCloseFile(layer->fd);
78 --- vdo-6.2.3.91/utils/vdo/user/vdodebugmetadata.c.orig 2020-05-30 04:20:46.000000000 +0200
79 +++ vdo-6.2.3.91/utils/vdo/user/vdodebugmetadata.c 2020-06-01 07:11:47.872179460 +0200
81 result = layer->allocateIOBuffer(layer, journalBytes,
82 "recovery journal", &rawJournalBytes);
83 if (result != VDO_SUCCESS) {
84 - errx(1, "Could not allocate %" PRIu64" bytes for the journal",
85 + errx(1, "Could not allocate %zu bytes for the journal",
91 int result = ALLOCATE(MAX_PBNS, PhysicalBlockNumber, __func__, &pbns);
92 if (result != VDO_SUCCESS) {
93 - errx(1, "Could not allocate %" PRIu64 " bytes",
94 + errx(1, "Could not allocate %zu bytes",
95 sizeof(PhysicalBlockNumber) * MAX_PBNS);
98 result = ALLOCATE(MAX_SEARCH_LBNS, LogicalBlockNumber, __func__,
100 if (result != VDO_SUCCESS) {
101 - errx(1, "Could not allocate %" PRIu64 " bytes",
102 + errx(1, "Could not allocate %zu bytes",
103 sizeof(LogicalBlockNumber) * MAX_SEARCH_LBNS);
106 --- vdo-6.2.3.91/utils/vdo/user/vdodumpmetadata.c.orig 2020-05-30 04:20:46.000000000 +0200
107 +++ vdo-6.2.3.91/utils/vdo/user/vdodumpmetadata.c 2020-06-01 07:12:18.685345864 +0200
110 int result = ALLOCATE(MAX_LBNS, PhysicalBlockNumber, __func__, &lbns);
111 if (result != VDO_SUCCESS) {
112 - errx(1, "Could not allocate %" PRIu64 " bytes",
113 + errx(1, "Could not allocate %zu bytes",
114 sizeof(PhysicalBlockNumber) * MAX_LBNS);
117 --- vdo-6.2.3.91/utils/vdo/user/vdolistmetadata.c.orig 2020-05-30 04:20:46.000000000 +0200
118 +++ vdo-6.2.3.91/utils/vdo/user/vdolistmetadata.c 2020-06-01 07:12:54.471818659 +0200
120 PhysicalBlockNumber startBlock,
123 - printf("%ld .. %ld: %s\n", startBlock, startBlock + count - 1, label);
124 + printf("%"PRId64" .. %"PRId64": %s\n", startBlock, startBlock + count - 1, label);
127 /**********************************************************************/
128 --- vdo-6.2.3.91/utils/vdo/user/vdoregenerategeometry.c.orig 2020-05-30 04:20:46.000000000 +0200
129 +++ vdo-6.2.3.91/utils/vdo/user/vdoregenerategeometry.c 2020-06-01 07:14:56.551157299 +0200
131 static int candidateCount = 0;
133 static char *fileName = NULL;
134 -static size_t offset = 0;
135 +static uint64_t offset = 0;
138 * Explain how this command-line tool is used.
139 --- vdo-6.2.6.14/utils/vdo/user/vdoprepareforlvm.c.orig 2022-02-11 01:31:42.000000000 +0100
140 +++ vdo-6.2.6.14/utils/vdo/user/vdoprepareforlvm.c 2022-05-09 21:50:35.553180915 +0200
145 +#include <inttypes.h>
149 @@ -200,7 +201,7 @@ static int convertUDS(IndexConfig *in
150 udsConfigurationSetNonce(udsConfig, geometry.nonce);
152 off_t startByte = geometry.regions[INDEX_REGION].startBlock * VDO_BLOCK_SIZE;
153 - result = asprintf(&indexName, "%s offset=%ld", fileName, startByte);
154 + result = asprintf(&indexName, "%s offset=%"PRId64, fileName, (uint64_t)startByte);
156 udsFreeConfiguration(udsConfig);
158 @@ -510,8 +511,8 @@ static int performDeviceConversion(void)
162 - printf("Conversion completed for '%s': VDO is now offset by %ld bytes\n",
163 - fileName, vdoByteOffset);
164 + printf("Conversion completed for '%s': VDO is now offset by %"PRId64" bytes\n",
165 + fileName, (uint64_t)vdoByteOffset);