Skip to content

Commit

Permalink
Fixing some type conversion warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
gpdaniels committed Oct 3, 2023
1 parent 17bad6a commit 737487c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions source/crypto/chacha
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ namespace gtl {
const block_type block = chacha::transform_block(key, initialisation_vector);
result = chacha::xor_data(block, data);;
++counter;
for (int i = 0; i < 4; ++i) {
for (unsigned int i = 0; i < 4; ++i) {
initialisation_vector.data[i] = unpack_byte(counter, i);
}
}
Expand All @@ -240,7 +240,7 @@ namespace gtl {
const block_type block = chacha::transform_block(key, initialisation_vector);
result = chacha::xor_data(block, data);;
++counter;
for (int i = 0; i < 8; ++i) {
for (unsigned int i = 0; i < 8; ++i) {
initialisation_vector.data[i] = unpack_byte(counter, i);
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/game/mastermind
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ namespace gtl {
}
// Select the minimum of the maximums to get the best guess.
std::vector<unsigned int>::iterator min_element = std::min_element(scores.begin(), scores.end());
guess = unguessed_codes[std::distance(scores.begin(), min_element)];
guess = unguessed_codes[static_cast<unsigned int>(std::distance(scores.begin(), min_element))];
// Check to see if there is a possible code with the same score, if so, prefer that.
const unsigned int min_score = *min_element;
for (unsigned int i = 0; i < unguessed_codes.size(); ++i) {
Expand Down

0 comments on commit 737487c

Please sign in to comment.