1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/libsystypes/include/systypes/format.h Sat Oct 29 01:19:48 2022 +0200
1.3 @@ -0,0 +1,42 @@
1.4 +/*
1.5 + * Format specifiers for output.
1.6 + *
1.7 + * Copyright (C) 2022 Paul Boddie <paul@boddie.org.uk>
1.8 + *
1.9 + * This program is free software; you can redistribute it and/or
1.10 + * modify it under the terms of the GNU General Public License as
1.11 + * published by the Free Software Foundation; either version 2 of
1.12 + * the License, or (at your option) any later version.
1.13 + *
1.14 + * This program is distributed in the hope that it will be useful,
1.15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.17 + * GNU General Public License for more details.
1.18 + *
1.19 + * You should have received a copy of the GNU General Public License
1.20 + * along with this program; if not, write to the Free Software
1.21 + * Foundation, Inc., 51 Franklin Street, Fifth Floor,
1.22 + * Boston, MA 02110-1301, USA
1.23 + */
1.24 +
1.25 +#pragma once
1.26 +
1.27 +#include <stdint.h>
1.28 +
1.29 +/* In principle, the PR macros in inttypes.h should be usable, but some strange
1.30 + conflict seems to arise when building programs using them, resulting in
1.31 + errors when the macros are used. */
1.32 +
1.33 +#define pFMT32 ""
1.34 +
1.35 +#if __WORDSIZE == 64
1.36 +#define pFMT64 "l"
1.37 +#else
1.38 +#define pFMT64 "ll"
1.39 +#endif
1.40 +
1.41 +/* See: systypes/base.h */
1.42 +
1.43 +#define pFMToffset pFMT64
1.44 +
1.45 +// vim: tabstop=2 expandtab shiftwidth=2
2.1 --- a/tests/dstest_align.cc Fri Oct 28 01:32:32 2022 +0200
2.2 +++ b/tests/dstest_align.cc Sat Oct 29 01:19:48 2022 +0200
2.3 @@ -1,6 +1,9 @@
2.4 #include <stdio.h>
2.5 #include <stdint.h>
2.6 +#include <systypes/format.h>
2.7
2.8 +#define FMT32x "%" pFMT32 "x"
2.9 +#define FMT64x "%" pFMT64 "x"
2.10 #define OFFSET(obj, mem) ((char *) &(obj)->mem - (char *) obj)
2.11
2.12 struct A
2.13 @@ -26,6 +29,8 @@
2.14
2.15 int main(int argc, char *argv[])
2.16 {
2.17 + (void) argc; (void) argv;
2.18 +
2.19 struct A a = {1, 2, 3};
2.20 struct B b = {1, 2, 3};
2.21 struct C c = {1, 2, 3};
2.22 @@ -33,21 +38,21 @@
2.23 struct A *ma = (struct A *) m;
2.24 struct A *ma1 = (struct A *) (m + 1);
2.25
2.26 - printf("a.a @ offset %d = %x\n", OFFSET(&a, a), a.a);
2.27 - printf("a.b @ offset %d = %llx\n", OFFSET(&a, b), a.b);
2.28 - printf("a.c @ offset %d = %llx\n\n", OFFSET(&a, c), a.c);
2.29 - printf("b.a @ offset %d = %x\n", OFFSET(&b, a), b.a);
2.30 - printf("b.b @ offset %d = %llx\n", OFFSET(&b, b), b.b);
2.31 - printf("b.c @ offset %d = %llx\n\n", OFFSET(&b, c), b.c);
2.32 - printf("c.a @ offset %d = %x\n", OFFSET(&c, a), c.a);
2.33 - printf("c.b @ offset %d = %x\n", OFFSET(&c, b), c.b);
2.34 - printf("c.c @ offset %d = %llx\n\n", OFFSET(&c, c), c.c);
2.35 - printf("ma.a @ offset %d = %x\n", OFFSET(ma, a), ma->a);
2.36 - printf("ma.b @ offset %d = %llx\n", OFFSET(ma, b), ma->b);
2.37 - printf("ma.c @ offset %d = %llx\n\n", OFFSET(ma, c), ma->c);
2.38 - printf("ma1.a @ offset %d = %x\n", OFFSET(ma1, a), ma1->a);
2.39 - printf("ma1.b @ offset %d = %llx\n", OFFSET(ma1, b), ma1->b);
2.40 - printf("ma1.c @ offset %d = %llx\n\n", OFFSET(ma1, c), ma1->c);
2.41 + printf("a.a @ offset %d = " FMT32x "\n", OFFSET(&a, a), a.a);
2.42 + printf("a.b @ offset %d = " FMT64x "\n", OFFSET(&a, b), a.b);
2.43 + printf("a.c @ offset %d = " FMT64x "\n\n", OFFSET(&a, c), a.c);
2.44 + printf("b.a @ offset %d = " FMT32x "\n", OFFSET(&b, a), b.a);
2.45 + printf("b.b @ offset %d = " FMT64x "\n", OFFSET(&b, b), b.b);
2.46 + printf("b.c @ offset %d = " FMT64x "\n\n", OFFSET(&b, c), b.c);
2.47 + printf("c.a @ offset %d = " FMT32x "\n", OFFSET(&c, a), c.a);
2.48 + printf("c.b @ offset %d = " FMT32x "\n", OFFSET(&c, b), c.b);
2.49 + printf("c.c @ offset %d = " FMT64x "\n\n", OFFSET(&c, c), c.c);
2.50 + printf("ma.a @ offset %d = " FMT32x "\n", OFFSET(ma, a), ma->a);
2.51 + printf("ma.b @ offset %d = " FMT64x "\n", OFFSET(ma, b), ma->b);
2.52 + printf("ma.c @ offset %d = " FMT64x "\n\n", OFFSET(ma, c), ma->c);
2.53 + printf("ma1.a @ offset %d = " FMT32x "\n", OFFSET(ma1, a), ma1->a);
2.54 + printf("ma1.b @ offset %d = " FMT64x "\n", OFFSET(ma1, b), ma1->b);
2.55 + printf("ma1.c @ offset %d = " FMT64x "\n\n", OFFSET(ma1, c), ma1->c);
2.56
2.57 return 0;
2.58 }
3.1 --- a/tests/dstest_block_client.cc Fri Oct 28 01:32:32 2022 +0200
3.2 +++ b/tests/dstest_block_client.cc Sat Oct 29 01:19:48 2022 +0200
3.3 @@ -23,6 +23,9 @@
3.4 #include <l4/sys/err.h>
3.5
3.6 #include <systypes/fcntl.h>
3.7 +#include <systypes/format.h>
3.8 +
3.9 +#define FMToffsetd "%" pFMToffset "d"
3.10
3.11 #include <stdio.h>
3.12 #include <string.h>
3.13 @@ -44,7 +47,7 @@
3.14 offset_t remaining = file_populated_span(file) - offset;
3.15 offset_t sample_remaining = remaining < sample ? remaining : sample;
3.16
3.17 - printf("%lld bytes from %p...\n", sample_remaining, (file->memory + offset));
3.18 + printf(FMToffsetd " bytes from %p...\n", sample_remaining, (file->memory + offset));
3.19 memcpy(buf, (file->memory + offset), sample_remaining);
3.20 buf[sample_remaining] = '\0';
3.21
3.22 @@ -70,10 +73,10 @@
3.23
3.24 printf("----\n%s\n----\n", outbuf);
3.25
3.26 - printf("[%lld zero bytes at start]\n", leading);
3.27 + printf("[" FMToffsetd " zero bytes at start]\n", leading);
3.28 printf("[%zd bytes shown]\n", strlen(outbuf));
3.29 - printf("[%lld bytes after string]\n", sample_remaining - leading - strlen(outbuf));
3.30 - printf("[%lld zero bytes at end]\n", trailing);
3.31 + printf("[" FMToffsetd " bytes after string]\n", sample_remaining - leading - strlen(outbuf));
3.32 + printf("[" FMToffsetd " zero bytes at end]\n", trailing);
3.33 }
3.34 }
3.35
3.36 @@ -120,7 +123,9 @@
3.37 return 1;
3.38 }
3.39
3.40 - printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
3.41 + printf("Region " FMToffsetd "..." FMToffsetd " populated size " FMToffsetd
3.42 + " size " FMToffsetd ".\n",
3.43 + file.start_pos, file.end_pos, file_populated_span(&file), file.size);
3.44 printf("File contents:\n");
3.45
3.46 show(&file, step, sample);
3.47 @@ -128,7 +133,7 @@
3.48 printf("File shown.\n");
3.49 printf("Expected...\n"
3.50 "[0 zero bytes at start]\n"
3.51 - "[%lld bytes shown]\n"
3.52 + "[" FMToffsetd " bytes shown]\n"
3.53 "[0 bytes after string]\n"
3.54 "[0 zero bytes at end]\n\n",
3.55 original_size);
3.56 @@ -144,7 +149,9 @@
3.57 return 1;
3.58 }
3.59
3.60 - printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
3.61 + printf("Region " FMToffsetd "..." FMToffsetd " populated size " FMToffsetd
3.62 + " size " FMToffsetd ".\n",
3.63 + file.start_pos, file.end_pos, file_populated_span(&file), file.size);
3.64 printf("File contents:\n");
3.65
3.66 show(&file, step, sample);
3.67 @@ -152,9 +159,9 @@
3.68 printf("File shown.\n");
3.69 printf("Expected...\n"
3.70 "[10 zero bytes at start]\n"
3.71 - "[%lld bytes shown]\n"
3.72 - "[%lld bytes after string]\n"
3.73 - "[%lld zero bytes at end]\n\n",
3.74 + "[" FMToffsetd " bytes shown]\n"
3.75 + "[" FMToffsetd " bytes after string]\n"
3.76 + "[" FMToffsetd " zero bytes at end]\n\n",
3.77 original_size - 20, 10ULL, 10ULL);
3.78
3.79 /* Resizing must occur before writing beyond the end of file. Otherwise, the
3.80 @@ -166,7 +173,7 @@
3.81 offset_t new_size = old_populated_size_rounded + old_populated_size;
3.82 offset_t new_region = round(new_size, page(1));
3.83
3.84 - printf("Resize to %lld...\n", new_size);
3.85 + printf("Resize to " FMToffsetd "...\n", new_size);
3.86
3.87 err = file_resize(&file, new_size);
3.88
3.89 @@ -177,8 +184,12 @@
3.90 }
3.91
3.92 printf("Resized file...\n");
3.93 - printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
3.94 - printf("Expected %lld...%lld populated size %lld size %lld.\n\n", 0ULL, old_populated_size_rounded, old_populated_size_rounded, new_size);
3.95 + printf("Region " FMToffsetd "..." FMToffsetd " populated size " FMToffsetd
3.96 + " size " FMToffsetd ".\n",
3.97 + file.start_pos, file.end_pos, file_populated_span(&file), file.size);
3.98 + printf("Expected " FMToffsetd "..." FMToffsetd " populated size " FMToffsetd
3.99 + " size " FMToffsetd ".\n\n",
3.100 + 0ULL, old_populated_size_rounded, old_populated_size_rounded, new_size);
3.101
3.102 /* Re-map to avoid masking the region. */
3.103
3.104 @@ -191,10 +202,14 @@
3.105 }
3.106
3.107 printf("Remapped file without masking...\n");
3.108 - printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
3.109 - printf("Expected %lld...%lld populated size %lld size %lld.\n\n", 0ULL, new_region, old_populated_size, old_size);
3.110 + printf("Region " FMToffsetd "..." FMToffsetd " populated size " FMToffsetd
3.111 + " size " FMToffsetd ".\n",
3.112 + file.start_pos, file.end_pos, file_populated_span(&file), file.size);
3.113 + printf("Expected " FMToffsetd "..." FMToffsetd " populated size " FMToffsetd
3.114 + " size " FMToffsetd ".\n\n",
3.115 + 0ULL, new_region, old_populated_size, old_size);
3.116
3.117 - printf("Resize to %lld...\n", new_size);
3.118 + printf("Resize to " FMToffsetd "...\n", new_size);
3.119
3.120 err = file_resize(&file, new_size);
3.121
3.122 @@ -205,16 +220,22 @@
3.123 }
3.124
3.125 printf("Resized file...\n");
3.126 - printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
3.127 - printf("Expected %lld...%lld populated size %lld size %lld.\n\n", 0ULL, round(new_size, page(1)), new_size, new_size);
3.128 + printf("Region " FMToffsetd "..." FMToffsetd " populated size " FMToffsetd
3.129 + " size " FMToffsetd ".\n",
3.130 + file.start_pos, file.end_pos, file_populated_span(&file), file.size);
3.131 + printf("Expected " FMToffsetd "..." FMToffsetd " populated size " FMToffsetd
3.132 + " size " FMToffsetd ".\n\n",
3.133 + 0ULL, round(new_size, page(1)), new_size, new_size);
3.134
3.135 /* Copy the file data to another file region. */
3.136
3.137 - printf("Copy data to %lld...\n", old_populated_size_rounded);
3.138 + printf("Copy data to " FMToffsetd "...\n", old_populated_size_rounded);
3.139
3.140 memcpy(file.memory + old_populated_size_rounded, file.memory, old_size);
3.141
3.142 - printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
3.143 + printf("Region " FMToffsetd "..." FMToffsetd " populated size " FMToffsetd
3.144 + " size " FMToffsetd ".\n",
3.145 + file.start_pos, file.end_pos, file_populated_span(&file), file.size);
3.146 printf("File contents:\n");
3.147
3.148 show(&file, step, sample);
3.149 @@ -222,12 +243,12 @@
3.150 printf("File shown.\n");
3.151 printf("Expected...\n"
3.152 "[0 zero bytes at start]\n"
3.153 - "[%lld bytes shown]\n"
3.154 - "[%lld bytes after string]\n"
3.155 - "[%lld zero bytes at end]\n"
3.156 + "[" FMToffsetd " bytes shown]\n"
3.157 + "[" FMToffsetd " bytes after string]\n"
3.158 + "[" FMToffsetd " zero bytes at end]\n"
3.159 "...\n"
3.160 "[0 zero bytes at start]\n"
3.161 - "[%lld bytes shown]\n"
3.162 + "[" FMToffsetd " bytes shown]\n"
3.163 "[0 bytes after string]\n"
3.164 "[0 zero bytes at end]\n\n",
3.165 original_size, sample - original_size, sample - original_size,
3.166 @@ -243,7 +264,9 @@
3.167 return 1;
3.168 }
3.169
3.170 - printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
3.171 + printf("Region " FMToffsetd "..." FMToffsetd " populated size " FMToffsetd
3.172 + " size " FMToffsetd ".\n",
3.173 + file.start_pos, file.end_pos, file_populated_span(&file), file.size);
3.174 printf("File contents:\n");
3.175
3.176 show(&file, step, sample);
3.177 @@ -251,12 +274,12 @@
3.178 printf("File shown.\n");
3.179 printf("Expected...\n"
3.180 "[10 zero bytes at start]\n"
3.181 - "[%lld bytes shown]\n"
3.182 - "[%lld bytes after string]\n"
3.183 - "[%lld zero bytes at end]\n"
3.184 + "[" FMToffsetd " bytes shown]\n"
3.185 + "[" FMToffsetd " bytes after string]\n"
3.186 + "[" FMToffsetd " zero bytes at end]\n"
3.187 "...\n"
3.188 "[0 zero bytes at start]\n"
3.189 - "[%lld bytes shown]\n"
3.190 + "[" FMToffsetd " bytes shown]\n"
3.191 "[10 bytes after string]\n"
3.192 "[10 zero bytes at end]\n",
3.193 original_size - 10, sample - original_size, sample - original_size,
4.1 --- a/tests/dstest_block_client_simple.cc Fri Oct 28 01:32:32 2022 +0200
4.2 +++ b/tests/dstest_block_client_simple.cc Sat Oct 29 01:19:48 2022 +0200
4.3 @@ -20,6 +20,9 @@
4.4 */
4.5
4.6 #include <systypes/fcntl.h>
4.7 +#include <systypes/format.h>
4.8 +
4.9 +#define FMToffsetd "%" pFMToffset "d"
4.10
4.11 #include <stdio.h>
4.12 #include <stdlib.h>
4.13 @@ -62,7 +65,7 @@
4.14
4.15 if (nread != size)
4.16 {
4.17 - printf("Could not read entire file: %ld out of %ld bytes.\n", nread, size);
4.18 + printf("Could not read entire file: " FMToffsetd " out of " FMToffsetd " bytes.\n", nread, size);
4.19 return 1;
4.20 }
4.21
4.22 @@ -70,7 +73,7 @@
4.23
4.24 fwrite(buffer, sizeof(char), nread, stdout);
4.25
4.26 - printf("Copy %ld bytes to end...\n", nread);
4.27 + printf("Copy " FMToffsetd " bytes to end...\n", nread);
4.28
4.29 for (int times = 0; times < repetition; times++)
4.30 {
4.31 @@ -80,20 +83,20 @@
4.32
4.33 if (nwritten != nread)
4.34 {
4.35 - printf("Could not write file section: %ld instead of %ld bytes.\n",
4.36 + printf("Could not write file section: " FMToffsetd " instead of " FMToffsetd " bytes.\n",
4.37 nwritten, nread);
4.38 return 1;
4.39 }
4.40 }
4.41
4.42 - printf("File now has size %ld.\n", file->size);
4.43 - printf("File has expected size %ld: %s\n", new_size, new_size == file->size ? "True" : "False");
4.44 + printf("File now has size " FMToffsetd ".\n", file->size);
4.45 + printf("File has expected size " FMToffsetd ": %s\n", new_size, new_size == file->size ? "True" : "False");
4.46
4.47 printf("Seek to start...\n");
4.48
4.49 client_seek(file, 0, SEEK_SET);
4.50
4.51 - printf("At mapped region from %ld to %ld with data at %ld to %ld.\n",
4.52 + printf("At mapped region from " FMToffsetd " to " FMToffsetd " with data at " FMToffsetd " to " FMToffsetd ".\n",
4.53 file->start_pos, file->end_pos, file->data_current, file->data_end);
4.54
4.55 printf("File contents...\n");
4.56 @@ -104,7 +107,7 @@
4.57 {
4.58 if ((nread != size) && (nread != file->size - position))
4.59 {
4.60 - printf("Could not read file section: %ld instead of %ld or remaining %ld bytes.\n",
4.61 + printf("Could not read file section: " FMToffsetd " instead of " FMToffsetd " or remaining " FMToffsetd " bytes.\n",
4.62 nread, size, file->size - position);
4.63 return 1;
4.64 }
5.1 --- a/tests/dstest_file_client.cc Fri Oct 28 01:32:32 2022 +0200
5.2 +++ b/tests/dstest_file_client.cc Sat Oct 29 01:19:48 2022 +0200
5.3 @@ -30,6 +30,9 @@
5.4
5.5 #include <fsclient/client.h>
5.6 #include <systypes/fcntl.h>
5.7 +#include <systypes/format.h>
5.8 +
5.9 +#define FMToffsetd "%" pFMToffset "d"
5.10
5.11
5.12
5.13 @@ -44,7 +47,7 @@
5.14
5.15 offset_t nwritten = client_write(file, buffer, size);
5.16
5.17 - printf("Written %lld/%lld in #%d to file with first %c, last %c...\n", nwritten, size, region, *buffer, *(buffer + nwritten - 1));
5.18 + printf("Written " FMToffsetd "/" FMToffsetd " in #%d to file with first %c, last %c...\n", nwritten, size, region, *buffer, *(buffer + nwritten - 1));
5.19
5.20 /* Flush to make the output available. */
5.21
5.22 @@ -71,7 +74,7 @@
5.23
5.24 client_seek(file, 0, SEEK_END);
5.25
5.26 - printf("File %s at position %lld...\n", creator ? "creator" : "follower", client_tell(file));
5.27 + printf("File %s at position " FMToffsetd "...\n", creator ? "creator" : "follower", client_tell(file));
5.28
5.29 /* Write initial data as the file's creator. */
5.30
5.31 @@ -105,7 +108,7 @@
5.32 {
5.33 total += nread;
5.34
5.35 - printf("Read as %s %lld/%lld, total %lld, first %c, last %c, from file...\n", creator ? "creator" : "follower",
5.36 + printf("Read as %s " FMToffsetd "/" FMToffsetd ", total " FMToffsetd ", first %c, last %c, from file...\n", creator ? "creator" : "follower",
5.37 nread, size, total, *buffer, *(buffer + nread - 1));
5.38
5.39 if (!(*(buffer + nread - 1)))
6.1 --- a/tests/dstest_file_remove.cc Fri Oct 28 01:32:32 2022 +0200
6.2 +++ b/tests/dstest_file_remove.cc Sat Oct 29 01:19:48 2022 +0200
6.3 @@ -28,6 +28,9 @@
6.4
6.5 #include <fsclient/client.h>
6.6 #include <systypes/fcntl.h>
6.7 +#include <systypes/format.h>
6.8 +
6.9 +#define FMToffsetd "%" pFMToffset "d"
6.10
6.11
6.12
6.13 @@ -42,7 +45,7 @@
6.14
6.15 nread = client_read(file, buf, 20);
6.16
6.17 - printf("Read %lld bytes...\n", nread);
6.18 + printf("Read " FMToffsetd " bytes...\n", nread);
6.19 fwrite(buf, sizeof(char), nread, stdout);
6.20 fputs("\n", stdout);
6.21 }
6.22 @@ -57,7 +60,7 @@
6.23
6.24 nwritten = client_write(file, buf, strlen(buf));
6.25
6.26 - printf("Wrote %lld bytes: ", nwritten);
6.27 + printf("Wrote " FMToffsetd " bytes: ", nwritten);
6.28 fwrite(buf, sizeof(char), nwritten, stdout);
6.29 fputs("\n", stdout);
6.30 }
7.1 --- a/tests/dstest_pipe_client.cc Fri Oct 28 01:32:32 2022 +0200
7.2 +++ b/tests/dstest_pipe_client.cc Sat Oct 29 01:19:48 2022 +0200
7.3 @@ -31,6 +31,9 @@
7.4
7.5 #include <fsclient/client.h>
7.6 #include <systypes/fcntl.h>
7.7 +#include <systypes/format.h>
7.8 +
7.9 +#define FMToffsetd "%" pFMToffset "d"
7.10
7.11
7.12
7.13 @@ -64,7 +67,7 @@
7.14
7.15 offset_t nwritten = client_write(writer, buffer, TO_TRANSFER);
7.16
7.17 - printf("Written %lld/%lld in #%d of %d/%d to pipe #%d...\n", nwritten, TO_TRANSFER, region, loop, 2, number);
7.18 + printf("Written " FMToffsetd "/" FMToffsetd " in #%d of %d/%d to pipe #%d...\n", nwritten, TO_TRANSFER, region, loop, 2, number);
7.19 }
7.20
7.21 sleep(1);
7.22 @@ -130,7 +133,7 @@
7.23 {
7.24 totals[p] += nread;
7.25
7.26 - printf("Read %lld/%lld, total %lld, first %c, last %c, from pipe #%d...\n", nread, TO_TRANSFER, totals[p], *buffer, *(buffer + nread - 1), p + 1);
7.27 + printf("Read " FMToffsetd "/" FMToffsetd ", total " FMToffsetd ", first %c, last %c, from pipe #%d...\n", nread, TO_TRANSFER, totals[p], *buffer, *(buffer + nread - 1), p + 1);
7.28 nread = client_read(reader, buffer, TO_TRANSFER);
7.29 }
7.30
7.31 @@ -151,7 +154,7 @@
7.32
7.33 for (int p = 0; p < 2; p++)
7.34 {
7.35 - printf("Data received for pipe #%d: %lld\n", p, totals[p]);
7.36 + printf("Data received for pipe #%d: " FMToffsetd "\n", p, totals[p]);
7.37 printf("Data shown for pipe #%d: %s\n", p, totals[p] == TO_TRANSFER * 26 * NUMBER_OF_ITERATIONS ? "True" : "False");
7.38 }
7.39 }
8.1 --- a/tests/dstest_test_client.cc Fri Oct 28 01:32:32 2022 +0200
8.2 +++ b/tests/dstest_test_client.cc Sat Oct 29 01:19:48 2022 +0200
8.3 @@ -23,6 +23,9 @@
8.4 #include <l4/sys/err.h>
8.5
8.6 #include <systypes/fcntl.h>
8.7 +#include <systypes/format.h>
8.8 +
8.9 +#define FMToffsetd "%" pFMToffset "d"
8.10
8.11 #include <stdio.h>
8.12 #include <string.h>
8.13 @@ -112,7 +115,7 @@
8.14 }
8.15
8.16 if ((fileid != _fileid) || (filepos != _filepos))
8.17 - printf("! %ld:%lld is not %ld:%lld\n", _fileid, _filepos, fileid, filepos);
8.18 + printf("! %ld:" FMToffsetd " is not %ld:" FMToffsetd "\n", _fileid, _filepos, fileid, filepos);
8.19 }
8.20 }
8.21