@@ -35,7 +35,7 @@ inline int64_t getFieldOffset(int64_t nullBitsetWidthInBytes, int32_t index) {
35
35
inline bool isNull (uint8_t * buffer_address, int32_t index) {
36
36
int64_t mask = 1L << (index & 0x3f ); // mod 64 and shift
37
37
int64_t wordOffset = (index >> 6 ) * 8 ;
38
- int64_t value = *(( int64_t *) (buffer_address + wordOffset) );
38
+ int64_t value = *reinterpret_cast < int64_t *> (buffer_address + wordOffset);
39
39
return (value & mask) != 0 ;
40
40
}
41
41
@@ -51,7 +51,7 @@ int32_t getTotalStringSize(
51
51
continue ;
52
52
}
53
53
54
- int64_t offsetAndSize = *(int64_t *) (memoryAddress + offsets[pos] + fieldOffset);
54
+ int64_t offsetAndSize = *(reinterpret_cast < int64_t *> (memoryAddress + offsets[pos] + fieldOffset) );
55
55
int32_t length = static_cast <int32_t >(offsetAndSize);
56
56
if (!StringView::isInline (length)) {
57
57
size += length;
@@ -98,11 +98,11 @@ VectorPtr createFlatVector<TypeKind::HUGEINT>(
98
98
auto column = BaseVector::create<FlatVector<int128_t >>(type, numRows, pool);
99
99
auto rawValues = column->mutableRawValues <uint8_t >();
100
100
auto typeWidth = sizeof (int128_t );
101
- auto shift = __builtin_ctz (( uint32_t ) typeWidth);
101
+ auto shift = __builtin_ctz (static_cast < uint32_t >( typeWidth) );
102
102
for (auto pos = 0 ; pos < numRows; pos++) {
103
103
if (!isNull (memoryAddress + offsets[pos], columnIdx)) {
104
104
uint8_t * destptr = rawValues + (pos << shift);
105
- int64_t offsetAndSize = *( int64_t *) (memoryAddress + offsets[pos] + fieldOffset);
105
+ int64_t offsetAndSize = *reinterpret_cast < int64_t *> (memoryAddress + offsets[pos] + fieldOffset);
106
106
int32_t length = static_cast <int32_t >(offsetAndSize);
107
107
int32_t wordoffset = static_cast <int32_t >(offsetAndSize >> 32 );
108
108
uint8_t bytesValue[length];
@@ -111,7 +111,7 @@ VectorPtr createFlatVector<TypeKind::HUGEINT>(
111
111
for (int k = length - 1 ; k >= 0 ; k--) {
112
112
bytesValue2[length - 1 - k] = bytesValue[k];
113
113
}
114
- if (int8_t (bytesValue[0 ]) < 0 ) {
114
+ if (static_cast < int8_t > (bytesValue[0 ]) < 0 ) {
115
115
memset (bytesValue2 + length, 255 , 16 - length);
116
116
}
117
117
memcpy (destptr, bytesValue2, typeWidth);
@@ -135,7 +135,7 @@ VectorPtr createFlatVector<TypeKind::BOOLEAN>(
135
135
auto rawValues = column->mutableRawValues <uint64_t >();
136
136
for (auto pos = 0 ; pos < numRows; pos++) {
137
137
if (!isNull (memoryAddress + offsets[pos], columnIdx)) {
138
- bool value = *(bool *) (memoryAddress + offsets[pos] + fieldOffset);
138
+ bool value = *(reinterpret_cast < bool *> (memoryAddress + offsets[pos] + fieldOffset) );
139
139
bits::setBit (rawValues, pos, value);
140
140
} else {
141
141
column->setNull (pos, true );
@@ -156,7 +156,7 @@ VectorPtr createFlatVector<TypeKind::TIMESTAMP>(
156
156
auto column = BaseVector::create<FlatVector<Timestamp>>(type, numRows, pool);
157
157
for (auto pos = 0 ; pos < numRows; pos++) {
158
158
if (!isNull (memoryAddress + offsets[pos], columnIdx)) {
159
- int64_t value = *( int64_t *) (memoryAddress + offsets[pos] + fieldOffset);
159
+ int64_t value = *reinterpret_cast < int64_t *> (memoryAddress + offsets[pos] + fieldOffset);
160
160
column->set (pos, Timestamp::fromMicros (value));
161
161
} else {
162
162
column->setNull (pos, true );
@@ -178,7 +178,7 @@ VectorPtr createFlatVectorStringView(
178
178
char * rawBuffer = column->getRawStringBufferWithSpace (size, true );
179
179
for (auto pos = 0 ; pos < numRows; pos++) {
180
180
if (!isNull (memoryAddress + offsets[pos], columnIdx)) {
181
- int64_t offsetAndSize = *(int64_t *) (memoryAddress + offsets[pos] + fieldOffset);
181
+ int64_t offsetAndSize = *(reinterpret_cast < int64_t *> (memoryAddress + offsets[pos] + fieldOffset) );
182
182
int32_t length = static_cast <int32_t >(offsetAndSize);
183
183
int32_t wordoffset = static_cast <int32_t >(offsetAndSize >> 32 );
184
184
auto valueSrcPtr = memoryAddress + offsets[pos] + wordoffset;
0 commit comments