diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-12-27 10:56:12 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-12-27 11:15:04 +0100 |
| commit | fd3e9f2b9720b9ba730938686b98cff3aa248984 (patch) | |
| tree | 1bb89f1bc27e4dc16552a7dfff255788a1dd88db /executor/test_executor_linux.cc | |
| parent | 34c18f5f43b3b7804b5650b5af67100262557297 (diff) | |
executor: introduce uint64/32/16/8 types
The "define uint64_t unsigned long long" were too good to work.
With a different toolchain I am getting:
cstdint:69:11: error: expected unqualified-id
using ::uint64_t;
^
executor/common.h:34:18: note: expanded from macro 'uint64_t'
Do it the proper way: introduce uint64/32/16/8 types and use them.
pkg/csource then does s/uint64/uint64_t/ to not clutter code with
additional typedefs.
Diffstat (limited to 'executor/test_executor_linux.cc')
| -rw-r--r-- | executor/test_executor_linux.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/executor/test_executor_linux.cc b/executor/test_executor_linux.cc index 5ba8d91ca..01180624b 100644 --- a/executor/test_executor_linux.cc +++ b/executor/test_executor_linux.cc @@ -15,12 +15,12 @@ void loop() extern "C" int test_copyin() { unsigned char x[4] = {}; - STORE_BY_BITMASK(uint16_t, &x[1], 0x1234, 0, 0); + STORE_BY_BITMASK(uint16, &x[1], 0x1234, 0, 0); if (x[0] != 0 || x[1] != 0x34 || x[2] != 0x12 || x[3] != 0) { printf("bad result of STORE_BY_BITMASK(0, 0): %x %x %x %x\n", x[0], x[1], x[2], x[3]); return 1; } - STORE_BY_BITMASK(uint16_t, &x[1], 0x555a, 5, 4); + STORE_BY_BITMASK(uint16, &x[1], 0x555a, 5, 4); if (x[0] != 0 || x[1] != 0x54 || x[2] != 0x13 || x[3] != 0) { printf("bad result of STORE_BY_BITMASK(7, 3): %x %x %x %x\n", x[0], x[1], x[2], x[3]); return 1; @@ -33,7 +33,7 @@ extern "C" int test_copyin() struct csum_inet_test { const char* data; size_t length; - uint16_t csum; + uint16 csum; }; extern "C" int test_csum_inet() @@ -149,7 +149,7 @@ extern "C" int test_csum_inet() for (unsigned i = 0; i < ARRAY_SIZE(tests); i++) { struct csum_inet csum; csum_inet_init(&csum); - csum_inet_update(&csum, (const uint8_t*)tests[i].data, tests[i].length); + csum_inet_update(&csum, (const uint8*)tests[i].data, tests[i].length); if (csum_inet_digest(&csum) != tests[i].csum) { fprintf(stderr, "bad checksum in test #%u, want: %hx, got: %hx\n", i, tests[i].csum, csum_inet_digest(&csum)); return 1; @@ -166,7 +166,7 @@ int randInt(int start, int end) extern "C" int test_csum_inet_acc() { - uint8_t buffer[128]; + uint8 buffer[128]; int test; for (test = 0; test < 256; test++) { |
