@@ -489,9 +489,7 @@ class interval_t final {
489
489
case 16 : return truncate_to<int16_t >();
490
490
case 32 : return truncate_to<int32_t >();
491
491
case 64 : return truncate_to<int64_t >();
492
- default : {
493
- CRAB_ERROR (" invalid width" );
494
- }
492
+ default : CRAB_ERROR (" Invalid width " , width);
495
493
}
496
494
}
497
495
@@ -503,9 +501,7 @@ class interval_t final {
503
501
case 16 : return truncate_to<uint16_t >();
504
502
case 32 : return truncate_to<uint32_t >();
505
503
case 64 : return truncate_to<uint64_t >();
506
- default : {
507
- CRAB_ERROR (" invalid width" );
508
- }
504
+ default : CRAB_ERROR (" Invalid width " , width);
509
505
}
510
506
}
511
507
@@ -535,7 +531,7 @@ class interval_t final {
535
531
case 16 : return full<int16_t >();
536
532
case 32 : return full<int32_t >();
537
533
case 64 : return full<int64_t >();
538
- default : throw std::exception ( );
534
+ default : CRAB_ERROR ( " Invalid width " , width );
539
535
}
540
536
}
541
537
@@ -545,10 +541,10 @@ class interval_t final {
545
541
static interval_t unsigned_int (const int width) {
546
542
switch (width) {
547
543
case 8 : return full<uint8_t >();
548
- case 32 : return full<uint32_t >();
549
544
case 16 : return full<uint16_t >();
545
+ case 32 : return full<uint32_t >();
550
546
case 64 : return full<uint64_t >();
551
- default : throw std::exception ( );
547
+ default : CRAB_ERROR ( " Invalid width " , width );
552
548
}
553
549
}
554
550
@@ -561,7 +557,7 @@ class interval_t final {
561
557
case 16 : return nonnegative<int16_t >();
562
558
case 32 : return nonnegative<int32_t >();
563
559
case 64 : return nonnegative<int64_t >();
564
- default : throw std::exception ( );
560
+ default : CRAB_ERROR ( " Invalid width " , width );
565
561
}
566
562
}
567
563
@@ -574,7 +570,7 @@ class interval_t final {
574
570
case 16 : return negative<int16_t >();
575
571
case 32 : return negative<int32_t >();
576
572
case 64 : return negative<int64_t >();
577
- default : throw std::exception ( );
573
+ default : CRAB_ERROR ( " Invalid width " , width );
578
574
}
579
575
}
580
576
@@ -601,15 +597,15 @@ class interval_t final {
601
597
602
598
interval_t unsigned_high (bool is64) const = delete;
603
599
// Return an interval in the range [INT_MAX+1, UINT_MAX], which can only
604
- // be represented as a uvalue. The svalue equivalent using the same
605
- // width would be negative_int().
600
+ // be represented as a uvalue.
601
+ // The svalue equivalent using the same width would be negative_int().
606
602
static interval_t unsigned_high (const int width) {
607
603
switch (width) {
608
- case 8 : return high<uint8_t >(); ;
604
+ case 8 : return high<uint8_t >();
609
605
case 16 : return high<uint16_t >();
610
606
case 32 : return high<uint32_t >();
611
607
case 64 : return high<uint64_t >();
612
- default : throw std::exception ( );
608
+ default : CRAB_ERROR ( " Invalid width " , width );
613
609
}
614
610
}
615
611
0 commit comments