@@ -160,15 +160,15 @@ static control_t test_printf_u(const size_t call_count)
160
160
result_baseline = printf (" u: %u\r\n " , UINT_MAX);
161
161
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
162
162
163
- result_minimal = mbed_printf (" lu: %lu\r\n " , 0 );
163
+ result_minimal = mbed_printf (" lu: %lu\r\n " , 0UL );
164
164
result_baseline = printf (" lu: %lu\r\n " , 0UL );
165
165
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
166
166
167
167
result_minimal = mbed_printf (" lu: %lu\r\n " , ULONG_MAX);
168
168
result_baseline = printf (" lu: %lu\r\n " , ULONG_MAX);
169
169
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
170
170
171
- result_minimal = mbed_printf (" llu: %llu\r\n " , 0 );
171
+ result_minimal = mbed_printf (" llu: %llu\r\n " , 0ULL );
172
172
result_baseline = printf (" llu: %llu\r\n " , 0ULL );
173
173
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
174
174
@@ -179,8 +179,8 @@ static control_t test_printf_u(const size_t call_count)
179
179
#ifdef TARGET_LIKE_MBED
180
180
printf (" %%ju not supported by mbed\r\n " );
181
181
#else
182
- result_minimal = mbed_printf (" ju: %ju\r\n " , 0 );
183
- result_baseline = printf (" ju: %ju\r\n " ,(uintmax_t ) 0 );
182
+ result_minimal = mbed_printf (" ju: %ju\r\n " , ( uintmax_t ) 0 );
183
+ result_baseline = printf (" ju: %ju\r\n " , (uintmax_t ) 0 );
184
184
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
185
185
186
186
result_minimal = mbed_printf (" ju: %ju\r\n " , UINTMAX_MAX);
@@ -246,15 +246,15 @@ static control_t test_printf_x(const size_t call_count)
246
246
result_baseline = printf (" X: %X\r\n " , UINT_MAX);
247
247
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
248
248
249
- result_minimal = mbed_printf (" lX: %lX\r\n " , 0 );
249
+ result_minimal = mbed_printf (" lX: %lX\r\n " , 0UL );
250
250
result_baseline = printf (" lX: %lX\r\n " , 0UL );
251
251
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
252
252
253
253
result_minimal = mbed_printf (" lX: %lX\r\n " , ULONG_MAX);
254
254
result_baseline = printf (" lX: %lX\r\n " , ULONG_MAX);
255
255
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
256
256
257
- result_minimal = mbed_printf (" llX: %llX\r\n " , 0 );
257
+ result_minimal = mbed_printf (" llX: %llX\r\n " , 0ULL );
258
258
result_baseline = printf (" llX: %llX\r\n " , 0ULL );
259
259
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
260
260
@@ -265,7 +265,7 @@ static control_t test_printf_x(const size_t call_count)
265
265
#ifdef TARGET_LIKE_MBED
266
266
printf (" %%jX not supported by mbed\r\n " );
267
267
#else
268
- result_minimal = mbed_printf (" jX: %jX\r\n " , 0 );
268
+ result_minimal = mbed_printf (" jX: %jX\r\n " , ( uintmax_t ) 0 );
269
269
result_baseline = printf (" jX: %jX\r\n " , (uintmax_t ) 0 );
270
270
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
271
271
@@ -369,12 +369,12 @@ static control_t test_snprintf_d(const size_t call_count)
369
369
#ifdef TARGET_LIKE_MBED
370
370
printf (" %%jd not supported by mbed\r\n " );
371
371
#else
372
- result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " jd: %jd\r\n " , INT32_MIN);
372
+ result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " jd: %jd\r\n " , ( intmax_t ) INT32_MIN);
373
373
result_baseline = snprintf (buffer_baseline, sizeof (buffer_baseline), " jd: %jd\r\n " , (intmax_t ) INT32_MIN);
374
374
TEST_ASSERT_EQUAL_STRING (" jd: -2147483648\r\n " , buffer_minimal);
375
375
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
376
376
377
- result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " jd: %jd\r\n " , INT32_MAX);
377
+ result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " jd: %jd\r\n " , ( intmax_t ) INT32_MAX);
378
378
result_baseline = snprintf (buffer_baseline, sizeof (buffer_baseline), " jd: %jd\r\n " , (intmax_t ) INT32_MAX);
379
379
TEST_ASSERT_EQUAL_STRING (" jd: 2147483647\r\n " , buffer_minimal);
380
380
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
@@ -383,12 +383,12 @@ static control_t test_snprintf_d(const size_t call_count)
383
383
#ifdef TARGET_LIKE_MBED
384
384
printf (" %%zd not supported by mbed\r\n " );
385
385
#else
386
- result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " zd: %zd\r\n " , INT32_MIN);
386
+ result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " zd: %zd\r\n " , ( ssize_t ) INT32_MIN);
387
387
result_baseline = snprintf (buffer_baseline, sizeof (buffer_baseline), " zd: %zd\r\n " , (ssize_t ) INT32_MIN);
388
388
TEST_ASSERT_EQUAL_STRING (" zd: -2147483648\r\n " , buffer_minimal);
389
389
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
390
390
391
- result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " zd: %zd\r\n " , INT32_MAX);
391
+ result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " zd: %zd\r\n " , ( ssize_t ) INT32_MAX);
392
392
result_baseline = snprintf (buffer_baseline, sizeof (buffer_baseline), " zd: %zd\r\n " , (ssize_t ) INT32_MAX);
393
393
TEST_ASSERT_EQUAL_STRING (" zd: 2147483647\r\n " , buffer_minimal);
394
394
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
@@ -450,7 +450,7 @@ static control_t test_snprintf_u(const size_t call_count)
450
450
TEST_ASSERT_EQUAL_STRING (buffer_baseline, buffer_minimal);
451
451
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
452
452
453
- result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " lu: %lu\r\n " , 0 );
453
+ result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " lu: %lu\r\n " , 0UL );
454
454
result_baseline = snprintf (buffer_baseline, sizeof (buffer_baseline), " lu: %lu\r\n " , 0UL );
455
455
TEST_ASSERT_EQUAL_STRING (buffer_baseline, buffer_minimal);
456
456
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
@@ -460,7 +460,7 @@ static control_t test_snprintf_u(const size_t call_count)
460
460
TEST_ASSERT_EQUAL_STRING (buffer_baseline, buffer_minimal);
461
461
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
462
462
463
- result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " llu: %llu\r\n " , 0 );
463
+ result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " llu: %llu\r\n " , 0ULL );
464
464
result_baseline = snprintf (buffer_baseline, sizeof (buffer_baseline), " llu: %llu\r\n " , 0ULL );
465
465
TEST_ASSERT_EQUAL_STRING (buffer_baseline, buffer_minimal);
466
466
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
@@ -473,7 +473,7 @@ static control_t test_snprintf_u(const size_t call_count)
473
473
#ifdef TARGET_LIKE_MBED
474
474
printf (" %%ju not supported by mbed\r\n " );
475
475
#else
476
- result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " ju: %ju\r\n " , 0 );
476
+ result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " ju: %ju\r\n " , ( uintmax_t ) 0 );
477
477
result_baseline = snprintf (buffer_baseline, sizeof (buffer_baseline), " ju: %ju\r\n " , (uintmax_t ) 0 );
478
478
TEST_ASSERT_EQUAL_STRING (buffer_baseline, buffer_minimal);
479
479
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
@@ -553,7 +553,7 @@ static control_t test_snprintf_x(const size_t call_count)
553
553
TEST_ASSERT_EQUAL_STRING (buffer_baseline, buffer_minimal);
554
554
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
555
555
556
- result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " lX: %lX\r\n " , 0 );
556
+ result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " lX: %lX\r\n " , 0UL );
557
557
result_baseline = snprintf (buffer_baseline, sizeof (buffer_baseline), " lX: %lX\r\n " , 0UL );
558
558
TEST_ASSERT_EQUAL_STRING (buffer_baseline, buffer_minimal);
559
559
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
@@ -563,7 +563,7 @@ static control_t test_snprintf_x(const size_t call_count)
563
563
TEST_ASSERT_EQUAL_STRING (buffer_baseline, buffer_minimal);
564
564
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
565
565
566
- result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " llX: %llX\r\n " , 0 );
566
+ result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " llX: %llX\r\n " , 0ULL );
567
567
result_baseline = snprintf (buffer_baseline, sizeof (buffer_baseline), " llX: %llX\r\n " , 0ULL );
568
568
TEST_ASSERT_EQUAL_STRING (buffer_baseline, buffer_minimal);
569
569
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
@@ -576,7 +576,7 @@ static control_t test_snprintf_x(const size_t call_count)
576
576
#ifdef TARGET_LIKE_MBED
577
577
printf (" %%jX not supported by mbed\r\n " );
578
578
#else
579
- result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " jX: %jX\r\n " , 0 );
579
+ result_minimal = mbed_snprintf (buffer_minimal, sizeof (buffer_minimal), " jX: %jX\r\n " , ( uintmax_t ) 0 );
580
580
result_baseline = snprintf (buffer_baseline, sizeof (buffer_baseline), " jX: %jX\r\n " , (uintmax_t ) 0 );
581
581
TEST_ASSERT_EQUAL_STRING (buffer_baseline, buffer_minimal);
582
582
TEST_ASSERT_EQUAL_INT (result_baseline, result_minimal);
0 commit comments