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
3 changes: 1 addition & 2 deletions cpp/src/arrow/array-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,6 @@ TEST_F(TestFWBinaryArray, ZeroSize) {

ASSERT_OK(builder.Append(""));
ASSERT_OK(builder.Append(std::string()));
ASSERT_OK(builder.Append(static_cast<const uint8_t*>(nullptr)));
ASSERT_OK(builder.AppendNull());
ASSERT_OK(builder.AppendNull());
ASSERT_OK(builder.AppendNull());
Expand All @@ -1314,7 +1313,7 @@ TEST_F(TestFWBinaryArray, ZeroSize) {
ASSERT_EQ(fw_array.values()->size(), 0);
ASSERT_EQ(0, fw_array.byte_width());

ASSERT_EQ(6, array->length());
ASSERT_EQ(5, array->length());
ASSERT_EQ(3, array->null_count());
}

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/kernels/cast-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ std::vector<O> UnsafeVectorCast(const std::vector<I>& v) {

for (size_t i = 0; i < v.size(); i++) result[i] = static_cast<O>(v[i]);

return std::move(result);
return result;
}

TEST_F(TestCast, IntegerSignedToUnsigned) {
Expand Down
25 changes: 8 additions & 17 deletions cpp/src/arrow/io/mman.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <io.h>
#include <sys/types.h>

#include <cstdint>

#define PROT_NONE 0
#define PROT_READ 1
#define PROT_WRITE 2
Expand Down Expand Up @@ -75,28 +77,17 @@ static inline void* mmap(void* addr, size_t len, int prot, int flags, int fildes
HANDLE fm, h;

void* map = MAP_FAILED;
const uint64_t off64 = static_cast<uint64_t>(off);
const uint64_t maxSize = off64 + len;

#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4293)
#endif
const DWORD dwFileOffsetLow = static_cast<DWORD>(off64 & 0xFFFFFFFFUL);
const DWORD dwFileOffsetHigh = static_cast<DWORD>((off64 >> 32) & 0xFFFFFFFFUL);
const DWORD dwMaxSizeLow = static_cast<DWORD>(maxSize & 0xFFFFFFFFUL);
const DWORD dwMaxSizeHigh = static_cast<DWORD>((maxSize >> 32) & 0xFFFFFFFFUL);

const DWORD dwFileOffsetLow =
(sizeof(off_t) <= sizeof(DWORD)) ? (DWORD)off : (DWORD)(off & 0xFFFFFFFFL);
const DWORD dwFileOffsetHigh =
(sizeof(off_t) <= sizeof(DWORD)) ? (DWORD)0 : (DWORD)((off >> 32) & 0xFFFFFFFFL);
const DWORD protect = __map_mmap_prot_page(prot);
const DWORD desiredAccess = __map_mmap_prot_file(prot);

const size_t maxSize = off + len;

const DWORD dwMaxSizeLow = static_cast<DWORD>(maxSize & 0xFFFFFFFFL);
const DWORD dwMaxSizeHigh = static_cast<DWORD>((maxSize >> 32) & 0xFFFFFFFFL);

#ifdef _MSC_VER
#pragma warning(pop)
#endif

errno = 0;

if (len == 0
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/util/decimal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ namespace {
struct DecimalComponents {
util::string_view whole_digits;
util::string_view fractional_digits;
int32_t exponent;
int32_t exponent = 0;
char sign = 0;
bool has_exponent = false;
};
Expand Down
7 changes: 4 additions & 3 deletions cpp/src/arrow/util/io-util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,9 @@ Status MemoryMapRemap(void* addr, size_t old_size, size_t new_size, int fildes,
return StatusFromErrno("Cannot get file handle: ");
}

LONG new_size_low = static_cast<LONG>(new_size & 0xFFFFFFFFL);
LONG new_size_high = static_cast<LONG>((new_size >> 32) & 0xFFFFFFFFL);
uint64_t new_size64 = new_size;
LONG new_size_low = static_cast<LONG>(new_size64 & 0xFFFFFFFFUL);
LONG new_size_high = static_cast<LONG>((new_size64 >> 32) & 0xFFFFFFFFUL);

SetFilePointer(h, new_size_low, &new_size_high, FILE_BEGIN);
SetEndOfFile(h);
Expand Down Expand Up @@ -892,7 +893,7 @@ Status TemporaryDir::Make(const std::string& prefix, std::unique_ptr<TemporaryDi
BOOST_FILESYSTEM_CATCH

PlatformFilename fn(path.native());
bool created;
bool created = false;
RETURN_NOT_OK(CreateDir(fn, &created));
if (!created) {
// XXX Should we retry?
Expand Down