Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ci/appveyor-cpp-build-mingw.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand Down
8 changes: 5 additions & 3 deletions cpp/src/arrow/util/cpu-info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -85,6 +86,7 @@ int64_t ParseCPUFlags(const std::string& values) {
}

} // namespace
#endif

#ifdef _WIN32
bool RetrieveCacheSize(int64_t* cache_sizes) {
Expand All @@ -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(
Expand Down Expand Up @@ -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<int>(0x80000004)) {
model_name->clear();
for (int i = 0x80000002; i <= 0x80000004; ++i) {
for (int i = 0x80000002; i <= static_cast<int>(0x80000004); ++i) {
__cpuidex(cpu_info.data(), i, 0);
*model_name +=
std::string(reinterpret_cast<char*>(cpu_info.data()), sizeof(cpu_info));
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/util/io-util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<int64_t>(ARROW_MAX_IO_CHUNKSIZE), nbytes - *bytes_read);
#if defined(_MSC_VER)
#if defined(_WIN32)
int64_t ret =
static_cast<int64_t>(_read(fd, buffer, static_cast<uint32_t>(chunksize)));
#else
Expand Down Expand Up @@ -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<int64_t>(ARROW_MAX_IO_CHUNKSIZE), nbytes - bytes_written);
#if defined(_MSC_VER)
#if defined(_WIN32)
ret = static_cast<int>(
_write(fd, buffer + bytes_written, static_cast<uint32_t>(chunksize)));
#else
Expand Down