@@ -83,7 +83,7 @@ class Support
8383{
8484 public:
8585
86- enum class UnknownReason : unsigned {
86+ enum class UnknownReason : uint8_t {
8787 UNDETERMINED = 0 , // Not yet processed
8888 TOO_MANY_COMBINATIONS , // Branching out exploded beyond a threshold
8989 OVER_MAX_TESTS , // Planned tests was above the threshold
@@ -102,13 +102,15 @@ class Support
102102 Support (int calculatedTests, UnknownReason unknownReason)
103103 : found(-1 )
104104 , tests(-1 )
105- , calculatedTests(calculatedTests)
106105 , unknownReason(unknownReason)
107106 {
108107 assert (calculatedTests >= 0 );
108+ if (calculatedTests > std::numeric_limits<decltype (this ->calculatedTests )>::max ()) { this ->calculatedTests = std::numeric_limits<decltype (this ->calculatedTests )>::max (); } else {
109+ this ->calculatedTests = calculatedTests;
110+ }
109111 }
110112
111- Support (int found, int tests)
113+ Support (int8_t found, int8_t tests)
112114 : found(found)
113115 , tests(tests)
114116 {
@@ -117,14 +119,16 @@ class Support
117119 assert (calculatedTests == -1 );
118120 }
119121
120- Support (int found, int tests, int calculatedTests)
122+ Support (int8_t found, int8_t tests, int calculatedTests)
121123 : found(found)
122124 , tests(tests)
123- , calculatedTests(calculatedTests)
124125 {
125126 assert (found >= 0 );
126127 assert (tests > 0 );
127128 assert (calculatedTests >= 0 );
129+ if (calculatedTests > std::numeric_limits<decltype (this ->calculatedTests )>::max ()) { this ->calculatedTests = std::numeric_limits<decltype (this ->calculatedTests )>::max (); } else {
130+ this ->calculatedTests = calculatedTests;
131+ }
128132 }
129133
130134 bool unknown () const { return tests == -1 ; }
@@ -141,9 +145,9 @@ class Support
141145
142146 bool operator <(const Support& s) { return found < s.found ; }
143147
144- int found = -1 ;
145- int tests = -1 ;
146- int calculatedTests = -1 ;
148+ int8_t found = -1 ;
149+ int8_t tests = -1 ;
150+ int8_t calculatedTests = -1 ;
147151 UnknownReason unknownReason = UnknownReason::UNDETERMINED ;
148152};
149153
0 commit comments