Skip to content

Commit

Permalink
codeql fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
marlenecota committed Apr 24, 2024
1 parent 42205ed commit 21000f3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions folly/ConstexprMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ constexpr auto& constexpr_iterated_squares_desc_2_v =
template <typename T, typename... Ts>
constexpr T constexpr_max(T a, Ts... ts) {
T list[] = {ts..., a}; // 0-length arrays are illegal
for (auto i = 0u; i < sizeof...(Ts); ++i) {
for (size_t i = 0; i < sizeof...(Ts); ++i) {
a = list[i] < a ? a : list[i];
}
return a;
Expand All @@ -260,7 +260,7 @@ constexpr T constexpr_max(T a, Ts... ts) {
template <typename T, typename... Ts>
constexpr T constexpr_min(T a, Ts... ts) {
T list[] = {ts..., a}; // 0-length arrays are illegal
for (auto i = 0u; i < sizeof...(Ts); ++i) {
for (size_t i = 0; i < sizeof...(Ts); ++i) {
a = list[i] < a ? list[i] : a;
}
return a;
Expand Down
2 changes: 1 addition & 1 deletion folly/json/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ struct Input {
}

void skipWhitespace() {
unsigned index = 0;
std::size_t index = 0;
while (true) {
while (index < range_.size() && range_[index] == ' ') {
index++;
Expand Down
4 changes: 2 additions & 2 deletions folly/lang/ToAscii.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct to_ascii_array {
static constexpr data_type_ data_() {
data_type_ result{};
Alphabet alpha;
for (size_t i = 0; i < Base; ++i) {
for (uint64_t i = 0; i < Base; ++i) {
result.data[i] = alpha(static_cast<uint8_t>(i));
}
return result;
Expand Down Expand Up @@ -95,7 +95,7 @@ struct to_ascii_table {
static constexpr data_type_ data_() {
data_type_ result{};
Alphabet alpha;
for (size_t i = 0; i < Base * Base; ++i) {
for (uint64_t i = 0; i < Base * Base; ++i) {
result.data[i] = //
(alpha(uint8_t(i / Base)) << (kIsLittleEndian ? 0 : 8)) |
(alpha(uint8_t(i % Base)) << (kIsLittleEndian ? 8 : 0));
Expand Down

0 comments on commit 21000f3

Please sign in to comment.