1.1 --- a/tests/dstest_block_client.cc Fri Sep 16 22:08:44 2022 +0200
1.2 +++ b/tests/dstest_block_client.cc Fri Sep 16 22:49:39 2022 +0200
1.3 @@ -44,7 +44,7 @@
1.4 offset_t remaining = file_populated_span(file) - offset;
1.5 offset_t sample_remaining = remaining < sample ? remaining : sample;
1.6
1.7 - printf("%ld bytes from %p...\n", sample_remaining, (file->memory + offset));
1.8 + printf("%lld bytes from %p...\n", sample_remaining, (file->memory + offset));
1.9 memcpy(buf, (file->memory + offset), sample_remaining);
1.10 buf[sample_remaining] = '\0';
1.11
1.12 @@ -70,10 +70,10 @@
1.13
1.14 printf("----\n%s\n----\n", outbuf);
1.15
1.16 - printf("[%ld zero bytes at start]\n", leading);
1.17 - printf("[%ld bytes shown]\n", strlen(outbuf));
1.18 - printf("[%ld bytes after string]\n", sample_remaining - leading - strlen(outbuf));
1.19 - printf("[%ld zero bytes at end]\n", trailing);
1.20 + printf("[%lld zero bytes at start]\n", leading);
1.21 + printf("[%d bytes shown]\n", strlen(outbuf));
1.22 + printf("[%lld bytes after string]\n", sample_remaining - leading - strlen(outbuf));
1.23 + printf("[%lld zero bytes at end]\n", trailing);
1.24 }
1.25 }
1.26
1.27 @@ -120,7 +120,7 @@
1.28 return 1;
1.29 }
1.30
1.31 - printf("Region %ld...%ld populated size %ld size %ld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.32 + printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.33 printf("File contents:\n");
1.34
1.35 show(&file, step, sample);
1.36 @@ -128,7 +128,7 @@
1.37 printf("File shown.\n");
1.38 printf("Expected...\n"
1.39 "[0 zero bytes at start]\n"
1.40 - "[%ld bytes shown]\n"
1.41 + "[%lld bytes shown]\n"
1.42 "[0 bytes after string]\n"
1.43 "[0 zero bytes at end]\n\n",
1.44 original_size);
1.45 @@ -144,7 +144,7 @@
1.46 return 1;
1.47 }
1.48
1.49 - printf("Region %ld...%ld populated size %ld size %ld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.50 + printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.51 printf("File contents:\n");
1.52
1.53 show(&file, step, sample);
1.54 @@ -152,10 +152,10 @@
1.55 printf("File shown.\n");
1.56 printf("Expected...\n"
1.57 "[10 zero bytes at start]\n"
1.58 - "[%ld bytes shown]\n"
1.59 - "[%ld bytes after string]\n"
1.60 - "[%ld zero bytes at end]\n\n",
1.61 - original_size - 20, 10UL, 10UL);
1.62 + "[%lld bytes shown]\n"
1.63 + "[%lld bytes after string]\n"
1.64 + "[%lld zero bytes at end]\n\n",
1.65 + original_size - 20, 10ULL, 10ULL);
1.66
1.67 /* Resizing must occur before writing beyond the end of file. Otherwise, the
1.68 data may get discarded if the supporting flexpage needs to be flushed. */
1.69 @@ -166,7 +166,7 @@
1.70 offset_t new_size = old_populated_size_rounded + old_populated_size;
1.71 offset_t new_region = round(new_size, page(1));
1.72
1.73 - printf("Resize to %ld...\n", new_size);
1.74 + printf("Resize to %lld...\n", new_size);
1.75
1.76 err = file_resize(&file, new_size);
1.77
1.78 @@ -177,8 +177,8 @@
1.79 }
1.80
1.81 printf("Resized file...\n");
1.82 - printf("Region %ld...%ld populated size %ld size %ld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.83 - printf("Expected %ld...%ld populated size %ld size %ld.\n\n", 0UL, old_populated_size_rounded, old_populated_size_rounded, new_size);
1.84 + printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.85 + printf("Expected %lld...%lld populated size %lld size %lld.\n\n", 0ULL, old_populated_size_rounded, old_populated_size_rounded, new_size);
1.86
1.87 /* Re-map to avoid masking the region. */
1.88
1.89 @@ -191,10 +191,10 @@
1.90 }
1.91
1.92 printf("Remapped file without masking...\n");
1.93 - printf("Region %ld...%ld populated size %ld size %ld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.94 - printf("Expected %ld...%ld populated size %ld size %ld.\n\n", 0UL, new_region, old_populated_size, old_size);
1.95 + printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.96 + printf("Expected %lld...%lld populated size %lld size %lld.\n\n", 0ULL, new_region, old_populated_size, old_size);
1.97
1.98 - printf("Resize to %ld...\n", new_size);
1.99 + printf("Resize to %lld...\n", new_size);
1.100
1.101 err = file_resize(&file, new_size);
1.102
1.103 @@ -205,16 +205,16 @@
1.104 }
1.105
1.106 printf("Resized file...\n");
1.107 - printf("Region %ld...%ld populated size %ld size %ld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.108 - printf("Expected %ld...%ld populated size %ld size %ld.\n\n", 0UL, round(new_size, page(1)), new_size, new_size);
1.109 + printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.110 + printf("Expected %lld...%lld populated size %lld size %lld.\n\n", 0ULL, round(new_size, page(1)), new_size, new_size);
1.111
1.112 /* Copy the file data to another file region. */
1.113
1.114 - printf("Copy data to %ld...\n", old_populated_size_rounded);
1.115 + printf("Copy data to %lld...\n", old_populated_size_rounded);
1.116
1.117 memcpy(file.memory + old_populated_size_rounded, file.memory, old_size);
1.118
1.119 - printf("Region %ld...%ld populated size %ld size %ld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.120 + printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.121 printf("File contents:\n");
1.122
1.123 show(&file, step, sample);
1.124 @@ -222,12 +222,12 @@
1.125 printf("File shown.\n");
1.126 printf("Expected...\n"
1.127 "[0 zero bytes at start]\n"
1.128 - "[%ld bytes shown]\n"
1.129 - "[%ld bytes after string]\n"
1.130 - "[%ld zero bytes at end]\n"
1.131 + "[%lld bytes shown]\n"
1.132 + "[%lld bytes after string]\n"
1.133 + "[%lld zero bytes at end]\n"
1.134 "...\n"
1.135 "[0 zero bytes at start]\n"
1.136 - "[%ld bytes shown]\n"
1.137 + "[%lld bytes shown]\n"
1.138 "[0 bytes after string]\n"
1.139 "[0 zero bytes at end]\n\n",
1.140 original_size, sample - original_size, sample - original_size,
1.141 @@ -243,7 +243,7 @@
1.142 return 1;
1.143 }
1.144
1.145 - printf("Region %ld...%ld populated size %ld size %ld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.146 + printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.147 printf("File contents:\n");
1.148
1.149 show(&file, step, sample);
1.150 @@ -251,12 +251,12 @@
1.151 printf("File shown.\n");
1.152 printf("Expected...\n"
1.153 "[10 zero bytes at start]\n"
1.154 - "[%ld bytes shown]\n"
1.155 - "[%ld bytes after string]\n"
1.156 - "[%ld zero bytes at end]\n"
1.157 + "[%lld bytes shown]\n"
1.158 + "[%lld bytes after string]\n"
1.159 + "[%lld zero bytes at end]\n"
1.160 "...\n"
1.161 "[0 zero bytes at start]\n"
1.162 - "[%ld bytes shown]\n"
1.163 + "[%lld bytes shown]\n"
1.164 "[10 bytes after string]\n"
1.165 "[10 zero bytes at end]\n",
1.166 original_size - 10, sample - original_size, sample - original_size,