Skip to content

Commit

Permalink
Make const uint8_t to remove cast
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsaka committed Aug 27, 2024
1 parent 79c0ab4 commit 8bdb6de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion velox/functions/prestosql/types/IPAddressType.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
static constexpr int kIPAddressBytes = 16;
static constexpr int kIPPrefixBytes = 17;
static constexpr int kIPV4Bits = 32;
static constexpr int kIPV6Bits = 128;
static constexpr uint8_t kIPV6Bits = 128;

namespace facebook::velox {

Expand Down
2 changes: 1 addition & 1 deletion velox/functions/prestosql/types/IPPrefixType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ class IPPrefixCastOperator : public exec::CastOperator {
if (v6Addr.isIPv4Mapped()) {
result.data()[kIPAddressBytes] = kIPV4Bits;
} else {
result.data()[kIPAddressBytes] = (unsigned char)kIPV6Bits;
result.data()[kIPAddressBytes] = kIPV6Bits;
}

result.finalize();
Expand Down

0 comments on commit 8bdb6de

Please sign in to comment.