@@ -516,11 +516,11 @@ namespace te_builtins
516
516
{
517
517
throw std::runtime_error (" Bitwise RIGHT ROTATE operation must use integers." );
518
518
}
519
- else if (val1 < 0 )
519
+ if (val1 < 0 )
520
520
{
521
521
throw std::runtime_error (" Bitwise RIGHT ROTATE value must be positive." );
522
522
}
523
- else if (val2 > 8 )
523
+ if (val2 > 8 )
524
524
{
525
525
throw std::runtime_error (" Rotation operation must be between 0-8." );
526
526
}
@@ -536,11 +536,11 @@ namespace te_builtins
536
536
{
537
537
throw std::runtime_error (" Bitwise LEFT ROTATE operation must use integers." );
538
538
}
539
- else if (val1 < 0 )
539
+ if (val1 < 0 )
540
540
{
541
541
throw std::runtime_error (" Bitwise LEFT ROTATE value must be positive." );
542
542
}
543
- else if (val2 > 8 )
543
+ if (val2 > 8 )
544
544
{
545
545
throw std::runtime_error (" Rotation operation must be between 0-8." );
546
546
}
@@ -556,11 +556,11 @@ namespace te_builtins
556
556
{
557
557
throw std::runtime_error (" Bitwise RIGHT ROTATE operation must use integers." );
558
558
}
559
- else if (val1 < 0 )
559
+ if (val1 < 0 )
560
560
{
561
561
throw std::runtime_error (" Bitwise RIGHT ROTATE value must be positive." );
562
562
}
563
- else if (val2 > 16 )
563
+ if (val2 > 16 )
564
564
{
565
565
throw std::runtime_error (" Rotation operation must be between 0-16." );
566
566
}
@@ -576,11 +576,11 @@ namespace te_builtins
576
576
{
577
577
throw std::runtime_error (" Bitwise LEFT ROTATE operation must use integers." );
578
578
}
579
- else if (val1 < 0 )
579
+ if (val1 < 0 )
580
580
{
581
581
throw std::runtime_error (" Bitwise LEFT ROTATE value must be positive." );
582
582
}
583
- else if (val2 > 16 )
583
+ if (val2 > 16 )
584
584
{
585
585
throw std::runtime_error (" Rotation operation must be between 0-16." );
586
586
}
@@ -600,11 +600,11 @@ namespace te_builtins
600
600
{
601
601
throw std::runtime_error (" Bitwise RIGHT ROTATE operation must use integers." );
602
602
}
603
- else if (val1 < 0 )
603
+ if (val1 < 0 )
604
604
{
605
605
throw std::runtime_error (" Bitwise RIGHT ROTATE value must be positive." );
606
606
}
607
- else if (val2 > 32 )
607
+ if (val2 > 32 )
608
608
{
609
609
throw std::runtime_error (" Rotation operation must be between 0-32." );
610
610
}
@@ -624,11 +624,11 @@ namespace te_builtins
624
624
{
625
625
throw std::runtime_error (" Bitwise LEFT ROTATE operation must use integers." );
626
626
}
627
- else if (val1 < 0 )
627
+ if (val1 < 0 )
628
628
{
629
629
throw std::runtime_error (" Bitwise LEFT ROTATE value must be positive." );
630
630
}
631
- else if (val2 > 32 )
631
+ if (val2 > 32 )
632
632
{
633
633
throw std::runtime_error (" Rotation operation must be between 0-32." );
634
634
}
@@ -648,11 +648,11 @@ namespace te_builtins
648
648
{
649
649
throw std::runtime_error (" Bitwise RIGHT ROTATE operation must use integers." );
650
650
}
651
- else if (val1 < 0 )
651
+ if (val1 < 0 )
652
652
{
653
653
throw std::runtime_error (" Bitwise RIGHT ROTATE value must be positive." );
654
654
}
655
- else if (val2 > 63 )
655
+ if (val2 > 63 )
656
656
{
657
657
throw std::runtime_error (" Rotation operation must be between 0-63" );
658
658
}
@@ -672,11 +672,11 @@ namespace te_builtins
672
672
{
673
673
throw std::runtime_error (" Bitwise LEFT ROTATE operation must use integers." );
674
674
}
675
- else if (val1 < 0 )
675
+ if (val1 < 0 )
676
676
{
677
677
throw std::runtime_error (" Bitwise LEFT ROTATE value must be positive." );
678
678
}
679
- else if (val2 > 63 )
679
+ if (val2 > 63 )
680
680
{
681
681
throw std::runtime_error (" Rotation operation must be between 0-63" );
682
682
}
@@ -728,11 +728,11 @@ namespace te_builtins
728
728
{
729
729
throw std::runtime_error (" Bitwise NOT must use integers." );
730
730
}
731
- else if (val < 0 )
731
+ if (val < 0 )
732
732
{
733
733
throw std::runtime_error (" Bitwise NOT value must be positive." );
734
734
}
735
- else if (val > std::numeric_limits<uint8_t >::max ())
735
+ if (val > std::numeric_limits<uint8_t >::max ())
736
736
{
737
737
throw std::runtime_error (" Value is too large for bitwise NOT." );
738
738
}
@@ -751,11 +751,11 @@ namespace te_builtins
751
751
{
752
752
throw std::runtime_error (" Bitwise NOT must use integers." );
753
753
}
754
- else if (val < 0 )
754
+ if (val < 0 )
755
755
{
756
756
throw std::runtime_error (" Bitwise NOT value must be positive." );
757
757
}
758
- else if (val > std::numeric_limits<uint16_t >::max ())
758
+ if (val > std::numeric_limits<uint16_t >::max ())
759
759
{
760
760
throw std::runtime_error (" Value is too large for bitwise NOT." );
761
761
}
@@ -777,11 +777,11 @@ namespace te_builtins
777
777
{
778
778
throw std::runtime_error (" Bitwise NOT must use integers." );
779
779
}
780
- else if (val < 0 )
780
+ if (val < 0 )
781
781
{
782
782
throw std::runtime_error (" Bitwise NOT value must be positive." );
783
783
}
784
- else if (val > std::numeric_limits<uint32_t >::max ())
784
+ if (val > std::numeric_limits<uint32_t >::max ())
785
785
{
786
786
throw std::runtime_error (" Value is too large for bitwise NOT." );
787
787
}
@@ -803,11 +803,11 @@ namespace te_builtins
803
803
{
804
804
throw std::runtime_error (" Bitwise NOT must use integers." );
805
805
}
806
- else if (val < 0 )
806
+ if (val < 0 )
807
807
{
808
808
throw std::runtime_error (" Bitwise NOT value must be positive." );
809
809
}
810
- else if (val > std::numeric_limits<uint64_t >::max ())
810
+ if (val > std::numeric_limits<uint64_t >::max ())
811
811
{
812
812
throw std::runtime_error (" Value is too large for bitwise NOT." );
813
813
}
@@ -845,11 +845,11 @@ namespace te_builtins
845
845
}
846
846
// negative technically should be allowed, but spreadsheet programs do
847
847
// not allow them; hence, we won't either
848
- else if (val1 < 0 || val2 < 0 )
848
+ if (val1 < 0 || val2 < 0 )
849
849
{
850
850
throw std::runtime_error (" Bitwise OR operation must use positive integers." );
851
851
}
852
- else if (val1 > te_parser::MAX_BITOPS_VAL || val2 > te_parser::MAX_BITOPS_VAL)
852
+ if (val1 > te_parser::MAX_BITOPS_VAL || val2 > te_parser::MAX_BITOPS_VAL)
853
853
{
854
854
throw std::runtime_error (" Value is too large for bitwise operation." );
855
855
}
@@ -866,11 +866,11 @@ namespace te_builtins
866
866
}
867
867
// negative technically should be allowed, but spreadsheet programs do
868
868
// not allow them; hence, we won't either
869
- else if (val1 < 0 || val2 < 0 )
869
+ if (val1 < 0 || val2 < 0 )
870
870
{
871
871
throw std::runtime_error (" Bitwise XOR operation must use positive integers." );
872
872
}
873
- else if (val1 > te_parser::MAX_BITOPS_VAL || val2 > te_parser::MAX_BITOPS_VAL)
873
+ if (val1 > te_parser::MAX_BITOPS_VAL || val2 > te_parser::MAX_BITOPS_VAL)
874
874
{
875
875
throw std::runtime_error (" Value is too large for bitwise operation." );
876
876
}
@@ -887,11 +887,11 @@ namespace te_builtins
887
887
}
888
888
// negative technically should be allowed, but spreadsheet programs do
889
889
// not allow them; hence, we won't either
890
- else if (val1 < 0 || val2 < 0 )
890
+ if (val1 < 0 || val2 < 0 )
891
891
{
892
892
throw std::runtime_error (" Bitwise AND operation must use positive integers." );
893
893
}
894
- else if (val1 > te_parser::MAX_BITOPS_VAL || val2 > te_parser::MAX_BITOPS_VAL)
894
+ if (val1 > te_parser::MAX_BITOPS_VAL || val2 > te_parser::MAX_BITOPS_VAL)
895
895
{
896
896
throw std::runtime_error (" Value is too large for bitwise operation." );
897
897
}
@@ -912,22 +912,22 @@ namespace te_builtins
912
912
{
913
913
throw std::runtime_error (" Left side of left shift (<<) operation must be an integer." );
914
914
}
915
- else if (std::floor (val2) != val2)
915
+ if (std::floor (val2) != val2)
916
916
{
917
917
throw std::runtime_error (
918
918
" Additive expression of left shift (<<) operation must be an integer." );
919
919
}
920
- else if (val1 < 0 )
920
+ if (val1 < 0 )
921
921
{
922
922
throw std::runtime_error (" Left side of left shift (<<) operation cannot be negative." );
923
923
}
924
- else if (val1 > te_parser::MAX_BITOPS_VAL)
924
+ if (val1 > te_parser::MAX_BITOPS_VAL)
925
925
{
926
926
throw std::runtime_error (" Value is too large for bitwise operation." );
927
927
}
928
928
// bitness is limited to 53-bit or 64-bit, so ensure shift doesn't go beyond that
929
929
// and cause undefined behavior
930
- else if (val2 < 0 || val2 > MAX_BITNESS_PARAM)
930
+ if (val2 < 0 || val2 > MAX_BITNESS_PARAM)
931
931
{
932
932
throw std::runtime_error (
933
933
" Additive expression of left shift (<<) operation must be between 0-" +
@@ -956,20 +956,20 @@ namespace te_builtins
956
956
{
957
957
throw std::runtime_error (" Left side of right shift (>>) operation must be an integer." );
958
958
}
959
- else if (std::floor (val2) != val2)
959
+ if (std::floor (val2) != val2)
960
960
{
961
961
throw std::runtime_error (
962
962
" Additive expression of right shift (>>) operation must be an integer." );
963
963
}
964
- else if (val1 < 0 )
964
+ if (val1 < 0 )
965
965
{
966
966
throw std::runtime_error (" Left side of right shift (<<) operation cannot be negative." );
967
967
}
968
- else if (val1 > te_parser::MAX_BITOPS_VAL)
968
+ if (val1 > te_parser::MAX_BITOPS_VAL)
969
969
{
970
970
throw std::runtime_error (" Value is too large for bitwise operation." );
971
971
}
972
- else if (val2 < 0 || val2 > MAX_BITNESS_PARAM)
972
+ if (val2 < 0 || val2 > MAX_BITNESS_PARAM)
973
973
{
974
974
throw std::runtime_error (
975
975
" Additive expression of right shift (>>) operation must be between 0-" +
0 commit comments