@@ -398,36 +398,48 @@ do { \
398
398
test_array_8(fn, expect, test_buffer, fmt_buffer, result); \
399
399
} while (0)
400
400
401
- static void __init numbers_list (const char * delim )
401
+ static void __init numbers_list_ll (const char * delim )
402
402
{
403
403
numbers_list_8 (unsigned long long, "%llu" , delim , "llu" , check_ull );
404
404
numbers_list_8 (long long, "%lld" , delim , "lld" , check_ll );
405
405
numbers_list_8 (long long, "%lld" , delim , "lli" , check_ll );
406
406
numbers_list_8 (unsigned long long, "%llx" , delim , "llx" , check_ull );
407
407
numbers_list_8 (unsigned long long, "0x%llx" , delim , "llx" , check_ull );
408
408
numbers_list_8 (long long, "0x%llx" , delim , "lli" , check_ll );
409
+ }
409
410
411
+ static void __init numbers_list_l (const char * delim )
412
+ {
410
413
numbers_list_8 (unsigned long, "%lu" , delim , "lu" , check_ulong );
411
414
numbers_list_8 (long , "%ld" , delim , "ld" , check_long );
412
415
numbers_list_8 (long , "%ld" , delim , "li" , check_long );
413
416
numbers_list_8 (unsigned long, "%lx" , delim , "lx" , check_ulong );
414
417
numbers_list_8 (unsigned long, "0x%lx" , delim , "lx" , check_ulong );
415
418
numbers_list_8 (long , "0x%lx" , delim , "li" , check_long );
419
+ }
416
420
421
+ static void __init numbers_list_d (const char * delim )
422
+ {
417
423
numbers_list_8 (unsigned int , "%u" , delim , "u" , check_uint );
418
424
numbers_list_8 (int , "%d" , delim , "d" , check_int );
419
425
numbers_list_8 (int , "%d" , delim , "i" , check_int );
420
426
numbers_list_8 (unsigned int , "%x" , delim , "x" , check_uint );
421
427
numbers_list_8 (unsigned int , "0x%x" , delim , "x" , check_uint );
422
428
numbers_list_8 (int , "0x%x" , delim , "i" , check_int );
429
+ }
423
430
431
+ static void __init numbers_list_h (const char * delim )
432
+ {
424
433
numbers_list_8 (unsigned short, "%hu" , delim , "hu" , check_ushort );
425
434
numbers_list_8 (short , "%hd" , delim , "hd" , check_short );
426
435
numbers_list_8 (short , "%hd" , delim , "hi" , check_short );
427
436
numbers_list_8 (unsigned short, "%hx" , delim , "hx" , check_ushort );
428
437
numbers_list_8 (unsigned short, "0x%hx" , delim , "hx" , check_ushort );
429
438
numbers_list_8 (short , "0x%hx" , delim , "hi" , check_short );
439
+ }
430
440
441
+ static void __init numbers_list_hh (const char * delim )
442
+ {
431
443
numbers_list_8 (unsigned char , "%hhu" , delim , "hhu" , check_uchar );
432
444
numbers_list_8 (signed char , "%hhd" , delim , "hhd" , check_char );
433
445
numbers_list_8 (signed char , "%hhd" , delim , "hhi" , check_char );
@@ -436,19 +448,27 @@ static void __init numbers_list(const char *delim)
436
448
numbers_list_8 (signed char , "0x%hhx" , delim , "hhi" , check_char );
437
449
}
438
450
439
- /*
440
- * List of numbers separated by delim. Each field width specifier is the
441
- * maximum possible digits for the given type and base.
442
- */
443
- static void __init numbers_list_field_width_typemax (const char * delim )
451
+ static void __init numbers_list (const char * delim )
452
+ {
453
+ numbers_list_ll (delim );
454
+ numbers_list_l (delim );
455
+ numbers_list_d (delim );
456
+ numbers_list_h (delim );
457
+ numbers_list_hh (delim );
458
+ }
459
+
460
+ static void __init numbers_list_field_width_ll (const char * delim )
444
461
{
445
462
numbers_list_fix_width (unsigned long long, "%llu" , delim , 20 , "llu" , check_ull );
446
463
numbers_list_fix_width (long long, "%lld" , delim , 20 , "lld" , check_ll );
447
464
numbers_list_fix_width (long long, "%lld" , delim , 20 , "lli" , check_ll );
448
465
numbers_list_fix_width (unsigned long long, "%llx" , delim , 16 , "llx" , check_ull );
449
466
numbers_list_fix_width (unsigned long long, "0x%llx" , delim , 18 , "llx" , check_ull );
450
467
numbers_list_fix_width (long long, "0x%llx" , delim , 18 , "lli" , check_ll );
468
+ }
451
469
470
+ static void __init numbers_list_field_width_l (const char * delim )
471
+ {
452
472
#if BITS_PER_LONG == 64
453
473
numbers_list_fix_width (unsigned long, "%lu" , delim , 20 , "lu" , check_ulong );
454
474
numbers_list_fix_width (long , "%ld" , delim , 20 , "ld" , check_long );
@@ -464,21 +484,30 @@ static void __init numbers_list_field_width_typemax(const char *delim)
464
484
numbers_list_fix_width (unsigned long, "0x%lx" , delim , 10 , "lx" , check_ulong );
465
485
numbers_list_fix_width (long , "0x%lx" , delim , 10 , "li" , check_long );
466
486
#endif
487
+ }
467
488
489
+ static void __init numbers_list_field_width_d (const char * delim )
490
+ {
468
491
numbers_list_fix_width (unsigned int , "%u" , delim , 10 , "u" , check_uint );
469
492
numbers_list_fix_width (int , "%d" , delim , 11 , "d" , check_int );
470
493
numbers_list_fix_width (int , "%d" , delim , 11 , "i" , check_int );
471
494
numbers_list_fix_width (unsigned int , "%x" , delim , 8 , "x" , check_uint );
472
495
numbers_list_fix_width (unsigned int , "0x%x" , delim , 10 , "x" , check_uint );
473
496
numbers_list_fix_width (int , "0x%x" , delim , 10 , "i" , check_int );
497
+ }
474
498
499
+ static void __init numbers_list_field_width_h (const char * delim )
500
+ {
475
501
numbers_list_fix_width (unsigned short, "%hu" , delim , 5 , "hu" , check_ushort );
476
502
numbers_list_fix_width (short , "%hd" , delim , 6 , "hd" , check_short );
477
503
numbers_list_fix_width (short , "%hd" , delim , 6 , "hi" , check_short );
478
504
numbers_list_fix_width (unsigned short, "%hx" , delim , 4 , "hx" , check_ushort );
479
505
numbers_list_fix_width (unsigned short, "0x%hx" , delim , 6 , "hx" , check_ushort );
480
506
numbers_list_fix_width (short , "0x%hx" , delim , 6 , "hi" , check_short );
507
+ }
481
508
509
+ static void __init numbers_list_field_width_hh (const char * delim )
510
+ {
482
511
numbers_list_fix_width (unsigned char , "%hhu" , delim , 3 , "hhu" , check_uchar );
483
512
numbers_list_fix_width (signed char , "%hhd" , delim , 4 , "hhd" , check_char );
484
513
numbers_list_fix_width (signed char , "%hhd" , delim , 4 , "hhi" , check_char );
@@ -489,38 +518,59 @@ static void __init numbers_list_field_width_typemax(const char *delim)
489
518
490
519
/*
491
520
* List of numbers separated by delim. Each field width specifier is the
492
- * exact length of the corresponding value digits in the string being scanned .
521
+ * maximum possible digits for the given type and base .
493
522
*/
494
- static void __init numbers_list_field_width_val_width (const char * delim )
523
+ static void __init numbers_list_field_width_typemax (const char * delim )
524
+ {
525
+ numbers_list_field_width_ll (delim );
526
+ numbers_list_field_width_l (delim );
527
+ numbers_list_field_width_d (delim );
528
+ numbers_list_field_width_h (delim );
529
+ numbers_list_field_width_hh (delim );
530
+ }
531
+
532
+ static void __init numbers_list_field_width_val_ll (const char * delim )
495
533
{
496
534
numbers_list_val_width (unsigned long long, "%llu" , delim , "llu" , check_ull );
497
535
numbers_list_val_width (long long, "%lld" , delim , "lld" , check_ll );
498
536
numbers_list_val_width (long long, "%lld" , delim , "lli" , check_ll );
499
537
numbers_list_val_width (unsigned long long, "%llx" , delim , "llx" , check_ull );
500
538
numbers_list_val_width (unsigned long long, "0x%llx" , delim , "llx" , check_ull );
501
539
numbers_list_val_width (long long, "0x%llx" , delim , "lli" , check_ll );
540
+ }
502
541
542
+ static void __init numbers_list_field_width_val_l (const char * delim )
543
+ {
503
544
numbers_list_val_width (unsigned long, "%lu" , delim , "lu" , check_ulong );
504
545
numbers_list_val_width (long , "%ld" , delim , "ld" , check_long );
505
546
numbers_list_val_width (long , "%ld" , delim , "li" , check_long );
506
547
numbers_list_val_width (unsigned long, "%lx" , delim , "lx" , check_ulong );
507
548
numbers_list_val_width (unsigned long, "0x%lx" , delim , "lx" , check_ulong );
508
549
numbers_list_val_width (long , "0x%lx" , delim , "li" , check_long );
550
+ }
509
551
552
+ static void __init numbers_list_field_width_val_d (const char * delim )
553
+ {
510
554
numbers_list_val_width (unsigned int , "%u" , delim , "u" , check_uint );
511
555
numbers_list_val_width (int , "%d" , delim , "d" , check_int );
512
556
numbers_list_val_width (int , "%d" , delim , "i" , check_int );
513
557
numbers_list_val_width (unsigned int , "%x" , delim , "x" , check_uint );
514
558
numbers_list_val_width (unsigned int , "0x%x" , delim , "x" , check_uint );
515
559
numbers_list_val_width (int , "0x%x" , delim , "i" , check_int );
560
+ }
516
561
562
+ static void __init numbers_list_field_width_val_h (const char * delim )
563
+ {
517
564
numbers_list_val_width (unsigned short, "%hu" , delim , "hu" , check_ushort );
518
565
numbers_list_val_width (short , "%hd" , delim , "hd" , check_short );
519
566
numbers_list_val_width (short , "%hd" , delim , "hi" , check_short );
520
567
numbers_list_val_width (unsigned short, "%hx" , delim , "hx" , check_ushort );
521
568
numbers_list_val_width (unsigned short, "0x%hx" , delim , "hx" , check_ushort );
522
569
numbers_list_val_width (short , "0x%hx" , delim , "hi" , check_short );
570
+ }
523
571
572
+ static void __init numbers_list_field_width_val_hh (const char * delim )
573
+ {
524
574
numbers_list_val_width (unsigned char , "%hhu" , delim , "hhu" , check_uchar );
525
575
numbers_list_val_width (signed char , "%hhd" , delim , "hhd" , check_char );
526
576
numbers_list_val_width (signed char , "%hhd" , delim , "hhi" , check_char );
@@ -529,6 +579,19 @@ static void __init numbers_list_field_width_val_width(const char *delim)
529
579
numbers_list_val_width (signed char , "0x%hhx" , delim , "hhi" , check_char );
530
580
}
531
581
582
+ /*
583
+ * List of numbers separated by delim. Each field width specifier is the
584
+ * exact length of the corresponding value digits in the string being scanned.
585
+ */
586
+ static void __init numbers_list_field_width_val_width (const char * delim )
587
+ {
588
+ numbers_list_field_width_val_ll (delim );
589
+ numbers_list_field_width_val_l (delim );
590
+ numbers_list_field_width_val_d (delim );
591
+ numbers_list_field_width_val_h (delim );
592
+ numbers_list_field_width_val_hh (delim );
593
+ }
594
+
532
595
/*
533
596
* Slice a continuous string of digits without field delimiters, containing
534
597
* numbers of varying length, using the field width to extract each group
0 commit comments