Skip to content

Commit

Permalink
Safer number casting
Browse files Browse the repository at this point in the history
  • Loading branch information
timacpp committed Oct 14, 2021
1 parent 93350b6 commit 2b1db18
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmake-build-debug/Testing/Temporary/LastTest.log
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Start testing: Oct 14 22:48 CEST
Start testing: Oct 14 22:58 CEST
----------------------------------------------------------
End testing: Oct 14 22:48 CEST
End testing: Oct 14 22:58 CEST
Binary file modified cmake-build-debug/untitled
Binary file not shown.
3 changes: 2 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,11 @@ namespace {
std::sort(begin(order), end(order), [&](sig_t sigl, sig_t sigr) {
return !circuit.contains(sigl) && circuit.contains(sigr);
});

std::sort(begin(order), input_end, std::greater<>());

sigmap<bool> values;
for (size_t input{0}; input < combinations; input++) {
for (size_t input{0}; input < static_cast<size_t>(combinations); input++) {
size_t input_ordinal = input;
for (size_t bit{0}; bit < input_count; bit++) {
auto sig_val{static_cast<bool>(input_ordinal % 2)};
Expand Down

0 comments on commit 2b1db18

Please sign in to comment.