diff options
author | Evan Green <evgreen@chromium.org> | 2019-10-01 14:07:03 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-05 00:47:58 +0000 |
commit | e77ccb89c1b74a9ba3be47072d35e3e148d2a469 (patch) | |
tree | d229a873d4e2cb6916c55d955b1e9a971052aa2b /test | |
parent | 1519095feaa933996ee413c87fd67de39d16213b (diff) | |
download | chrome-ec-e77ccb89c1b74a9ba3be47072d35e3e148d2a469.tar.gz |
Remove uses of %l
This change removes uses of %l from the EC side of the EC codebase.
This is done because the semantics of %l within printf have changed,
and there are concerns that new calls to printf will be cherry-picked
into old firmware branches without the printf changes. So, in
preparation for disallowing %l in master, remove occurrences of %l.
This change was done by manually fixing up anything found under the EC
directory with the following regex: %[0-9*.-]*l[^l]
Remember that anything on the host machine is fine as-is, since the host
printf never changed.
BUG=chromium:984041
TEST=make -j buildall
BRANCH=None
Change-Id: I2a97433ddab5bfb8a6031ca4ff1d3905289444e2
Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1834603
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/aes.c | 4 | ||||
-rw-r--r-- | test/printf.c | 5 | ||||
-rw-r--r-- | test/x25519.c | 2 |
3 files changed, 4 insertions, 7 deletions
diff --git a/test/aes.c b/test/aes.c index 58a4ff71ca..ca11d9ef61 100644 --- a/test/aes.c +++ b/test/aes.c @@ -382,7 +382,7 @@ static void test_aes_gcm_speed(void) CRYPTO_gcm128_tag(&ctx, tag, tag_size); } t1 = get_time(); - ccprintf("AES-GCM duration %ld us\n", t1.val - t0.val); + ccprintf("AES-GCM duration %lld us\n", (long long)(t1.val - t0.val)); } static int test_aes_raw(const uint8_t *key, int key_size, @@ -494,7 +494,7 @@ static void test_aes_speed(void) for (i = 0; i < 1000; i++) AES_encrypt(block, block, &aes_key); t1 = get_time(); - ccprintf("AES duration %ld us\n", t1.val - t0.val); + ccprintf("AES duration %lld us\n", (long long)(t1.val - t0.val)); } void run_test(void) diff --git a/test/printf.c b/test/printf.c index 400f9a4064..c521590440 100644 --- a/test/printf.c +++ b/test/printf.c @@ -174,12 +174,9 @@ test_static int test_vsnprintf_int(void) T(expect_success(" 0.00123", "%9.5d", 123)); T(expect_success(" +0.00123", "%+9.5d", 123)); - T(expect_success("-1", "%ld", (int64_t)-1)); - T(expect_success("4294967295", "%ld", (uint32_t)-1)); - T(expect_success("123", "%u", 123)); T(expect_success("4294967295", "%u", -1)); - T(expect_success("18446744073709551615", "%lu", (uint64_t)-1)); + T(expect_success("18446744073709551615", "%llu", (uint64_t)-1)); T(expect_success("0", "%x", 0)); T(expect_success("0", "%X", 0)); diff --git a/test/x25519.c b/test/x25519.c index 96f0de0287..0b450bf357 100644 --- a/test/x25519.c +++ b/test/x25519.c @@ -177,7 +177,7 @@ static void test_x25519_speed(void) t0 = get_time(); X25519(out, scalar1, point1); t1 = get_time(); - ccprintf("X25519 duration %ld us\n", t1.val - t0.val); + ccprintf("X25519 duration %lld us\n", (long long)(t1.val - t0.val)); } void run_test(void) |