diff --git a/ci/appveyor-cpp-build-mingw.bat b/ci/appveyor-cpp-build-mingw.bat index 4d399274549..06e8b7f7807 100644 --- a/ci/appveyor-cpp-build-mingw.bat +++ b/ci/appveyor-cpp-build-mingw.bat @@ -17,8 +17,8 @@ @echo on -set CMAKE_BUILD_TYPE=release -set MESON_BUILD_TYPE=release +set CMAKE_BUILD_TYPE=debug +set MESON_BUILD_TYPE=debug set INSTALL_DIR=%HOMEDRIVE%%HOMEPATH%\install set PATH=%INSTALL_DIR%\bin;%PATH% diff --git a/cpp/src/arrow/util/cpu-info.cc b/cpp/src/arrow/util/cpu-info.cc index 514b862c6d5..41f240b2591 100644 --- a/cpp/src/arrow/util/cpu-info.cc +++ b/cpp/src/arrow/util/cpu-info.cc @@ -68,6 +68,7 @@ static struct { }; static const int64_t num_flags = sizeof(flag_mappings) / sizeof(flag_mappings[0]); +#ifndef _WIN32 namespace { // Helper function to parse for hardware flags. @@ -85,6 +86,7 @@ int64_t ParseCPUFlags(const std::string& values) { } } // namespace +#endif #ifdef _WIN32 bool RetrieveCacheSize(int64_t* cache_sizes) { @@ -94,7 +96,7 @@ bool RetrieveCacheSize(int64_t* cache_sizes) { PSYSTEM_LOGICAL_PROCESSOR_INFORMATION buffer = nullptr; PSYSTEM_LOGICAL_PROCESSOR_INFORMATION buffer_position = nullptr; DWORD buffer_size = 0; - DWORD offset = 0; + size_t offset = 0; typedef BOOL(WINAPI * GetLogicalProcessorInformationFuncPointer)(void*, void*); GetLogicalProcessorInformationFuncPointer func_pointer = (GetLogicalProcessorInformationFuncPointer)GetProcAddress( @@ -156,9 +158,9 @@ bool RetrieveCPUInfo(int64_t* hardware_flags, std::string* model_name) { highest_extended_valid_id = cpu_info[0]; // Retrieve CPU model name - if (highest_extended_valid_id >= 0x80000004) { + if (highest_extended_valid_id >= static_cast(0x80000004)) { model_name->clear(); - for (int i = 0x80000002; i <= 0x80000004; ++i) { + for (int i = 0x80000002; i <= static_cast(0x80000004); ++i) { __cpuidex(cpu_info.data(), i, 0); *model_name += std::string(reinterpret_cast(cpu_info.data()), sizeof(cpu_info)); diff --git a/cpp/src/arrow/util/io-util.cc b/cpp/src/arrow/util/io-util.cc index 5d67fe87fa0..5f7e292725e 100644 --- a/cpp/src/arrow/util/io-util.cc +++ b/cpp/src/arrow/util/io-util.cc @@ -401,7 +401,7 @@ Status FileRead(int fd, uint8_t* buffer, int64_t nbytes, int64_t* bytes_read) { while (*bytes_read < nbytes) { int64_t chunksize = std::min(static_cast(ARROW_MAX_IO_CHUNKSIZE), nbytes - *bytes_read); -#if defined(_MSC_VER) +#if defined(_WIN32) int64_t ret = static_cast(_read(fd, buffer, static_cast(chunksize))); #else @@ -468,7 +468,7 @@ Status FileWrite(int fd, const uint8_t* buffer, const int64_t nbytes) { while (ret != -1 && bytes_written < nbytes) { int64_t chunksize = std::min(static_cast(ARROW_MAX_IO_CHUNKSIZE), nbytes - bytes_written); -#if defined(_MSC_VER) +#if defined(_WIN32) ret = static_cast( _write(fd, buffer + bytes_written, static_cast(chunksize))); #else