Skip to content

Commit

Permalink
Fix MSVC warnings related to data type macros
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 562991858
Change-Id: I53cefe9cae4913d66035286262f0b9380aa1deb9
  • Loading branch information
jbms authored and Copybara-Service committed Sep 6, 2023
1 parent 2fc1698 commit c01efdc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tensorstore/data_type.cc
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ struct NumericUstringConvertDataType {

} // namespace internal_data_type

#define TENSORSTORE_INTERNAL_CONVERT_INT(T) \
#define TENSORSTORE_INTERNAL_CONVERT_INT(T, ...) \
template <> \
struct ConvertDataType<::tensorstore::dtypes::T, \
::tensorstore::dtypes::string_t> \
Expand All @@ -305,7 +305,7 @@ struct NumericUstringConvertDataType {
: public internal_data_type::JsonIntegerConvertDataType {}; \
/**/

#define TENSORSTORE_INTERNAL_CONVERT_FLOAT(T) \
#define TENSORSTORE_INTERNAL_CONVERT_FLOAT(T, ...) \
template <> \
struct ConvertDataType<::tensorstore::dtypes::T, \
::tensorstore::dtypes::string_t> \
Expand Down
2 changes: 1 addition & 1 deletion tensorstore/data_type_conversion_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ using ::tensorstore::internal::GetElementCopyErrorStatus;
using ::tensorstore::internal::IterationBufferKind;
using ::tensorstore::internal::IterationBufferPointer;

#define X(T) \
#define X(T, ...) \
using ::tensorstore::dtypes::T; \
/**/
TENSORSTORE_FOR_EACH_DATA_TYPE(X)
Expand Down
4 changes: 2 additions & 2 deletions tensorstore/data_type_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ using ::tensorstore::internal::IterationBufferPointer;
using ::tensorstore::serialization::SerializationRoundTrip;
using ::tensorstore::serialization::TestSerializationRoundTrip;

#define X(T) \
#define X(T, ...) \
using ::tensorstore::dtypes::T; \
static_assert(static_cast<int>(DataTypeId::T) >= 0 && \
static_cast<int>(DataTypeId::T) < \
Expand Down Expand Up @@ -90,7 +90,7 @@ static_assert(IsElementType<int (ClassT::*)(int)>);

TEST(ElementOperationsTest, DataTypeIdOrder) {
int i = 0;
#define X(T) EXPECT_EQ(i++, static_cast<int>(DataTypeId::T));
#define X(T, ...) EXPECT_EQ(i++, static_cast<int>(DataTypeId::T));
TENSORSTORE_FOR_EACH_DATA_TYPE(X)
#undef X
}
Expand Down

0 comments on commit c01efdc

Please sign in to comment.