Unverified Commit 8f577de0 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

fix compiler warnings for CPP tests (#6124)

parent 3c7e38be
...@@ -30,7 +30,7 @@ TEST(ByteBuffer, JustWorks) { ...@@ -30,7 +30,7 @@ TEST(ByteBuffer, JustWorks) {
EXPECT_EQ(cumulativeSize, buffer->GetSize()); EXPECT_EQ(cumulativeSize, buffer->GetSize());
int16_t serializedInt16 = 0; int16_t serializedInt16 = 0;
char* int16Ptr = reinterpret_cast<char*>(&serializedInt16); char* int16Ptr = reinterpret_cast<char*>(&serializedInt16);
for (int i = 0; i < sizeof(int16_t); i++) { for (unsigned int i = 0; i < sizeof(int16_t); i++) {
int16Ptr[i] = buffer->GetAt(cumulativeSize - (sizeof(int16_t) - i)); int16Ptr[i] = buffer->GetAt(cumulativeSize - (sizeof(int16_t) - i));
} }
EXPECT_EQ(int16Val, serializedInt16); EXPECT_EQ(int16Val, serializedInt16);
...@@ -41,7 +41,7 @@ TEST(ByteBuffer, JustWorks) { ...@@ -41,7 +41,7 @@ TEST(ByteBuffer, JustWorks) {
EXPECT_EQ(cumulativeSize, buffer->GetSize()); EXPECT_EQ(cumulativeSize, buffer->GetSize());
int64_t serializedInt64 = 0; int64_t serializedInt64 = 0;
char* int64Ptr = reinterpret_cast<char*>(&serializedInt64); char* int64Ptr = reinterpret_cast<char*>(&serializedInt64);
for (int i = 0; i < sizeof(int64_t); i++) { for (unsigned int i = 0; i < sizeof(int64_t); i++) {
int64Ptr[i] = buffer->GetAt(cumulativeSize - (sizeof(int64_t) - i)); int64Ptr[i] = buffer->GetAt(cumulativeSize - (sizeof(int64_t) - i));
} }
EXPECT_EQ(int64Val, serializedInt64); EXPECT_EQ(int64Val, serializedInt64);
...@@ -52,7 +52,7 @@ TEST(ByteBuffer, JustWorks) { ...@@ -52,7 +52,7 @@ TEST(ByteBuffer, JustWorks) {
EXPECT_EQ(cumulativeSize, buffer->GetSize()); EXPECT_EQ(cumulativeSize, buffer->GetSize());
double serializedDouble = 0; double serializedDouble = 0;
char* doublePtr = reinterpret_cast<char*>(&serializedDouble); char* doublePtr = reinterpret_cast<char*>(&serializedDouble);
for (int i = 0; i < sizeof(double); i++) { for (unsigned int i = 0; i < sizeof(double); i++) {
doublePtr[i] = buffer->GetAt(cumulativeSize - (sizeof(double) - i)); doublePtr[i] = buffer->GetAt(cumulativeSize - (sizeof(double) - i));
} }
EXPECT_EQ(doubleVal, serializedDouble); EXPECT_EQ(doubleVal, serializedDouble);
......
...@@ -265,7 +265,7 @@ namespace LightGBM { ...@@ -265,7 +265,7 @@ namespace LightGBM {
groups_ptr, groups_ptr,
thread_count, thread_count,
t); t);
threads.push_back(move(th)); threads.push_back(std::move(th));
} }
for (auto& t : threads) t.join(); for (auto& t : threads) t.join();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment