Commit b2cf62f
ARROW-8486: [C++] Fix BitArray failures on big-endian platforms
This PR supports big-endian platforms of bit operations such as Bitmap, BitRead, BitWriter, and others. Ths PR can fix `BitArray.TestBool` and `BitArray.TestValue` in arrow-utility-test's [failures](https://travis-ci.org/github/apache/arrow/builds/684931696).
This PR consists of two parts.
1. Convert data layout to native-endian to process data. This PR basically inserts this conversion before and after `memcpy`. This is because because `memcpy` transfers data from/to variable using a memory layout in the buffer. This PR still assumes that data layout in buffer is in little-endian.
2. Add ``BitUtil::ByteSwap` for uint8.
Closes apache#7136 from kiszk/ARROW-8486
Authored-by: Kazuaki Ishizaki <ishizaki@jp.ibm.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>1 parent e215e89 commit b2cf62f
2 files changed
+37
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| 111 | + | |
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
| |||
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
| 128 | + | |
126 | 129 | | |
127 | 130 | | |
128 | 131 | | |
| |||
139 | 142 | | |
140 | 143 | | |
141 | 144 | | |
| 145 | + | |
142 | 146 | | |
143 | 147 | | |
144 | 148 | | |
| |||
185 | 189 | | |
186 | 190 | | |
187 | 191 | | |
| 192 | + | |
188 | 193 | | |
189 | 194 | | |
190 | 195 | | |
| |||
198 | 203 | | |
199 | 204 | | |
200 | 205 | | |
201 | | - | |
| 206 | + | |
| 207 | + | |
202 | 208 | | |
203 | 209 | | |
204 | 210 | | |
| |||
220 | 226 | | |
221 | 227 | | |
222 | 228 | | |
| 229 | + | |
223 | 230 | | |
224 | 231 | | |
225 | 232 | | |
| |||
249 | 256 | | |
250 | 257 | | |
251 | 258 | | |
| 259 | + | |
252 | 260 | | |
253 | 261 | | |
254 | 262 | | |
| |||
335 | 343 | | |
336 | 344 | | |
337 | 345 | | |
| 346 | + | |
338 | 347 | | |
339 | 348 | | |
340 | 349 | | |
| |||
362 | 371 | | |
363 | 372 | | |
364 | 373 | | |
| 374 | + | |
365 | 375 | | |
366 | 376 | | |
367 | 377 | | |
| |||
372 | 382 | | |
373 | 383 | | |
374 | 384 | | |
| 385 | + | |
375 | 386 | | |
376 | 387 | | |
377 | 388 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
332 | 333 | | |
333 | 334 | | |
334 | 335 | | |
| |||
358 | 359 | | |
359 | 360 | | |
360 | 361 | | |
361 | | - | |
362 | | - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
363 | 365 | | |
364 | 366 | | |
365 | 367 | | |
366 | 368 | | |
367 | | - | |
368 | | - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
369 | 372 | | |
370 | 373 | | |
371 | 374 | | |
372 | 375 | | |
373 | | - | |
374 | | - | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
375 | 379 | | |
376 | 380 | | |
377 | 381 | | |
378 | 382 | | |
379 | | - | |
380 | | - | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
381 | 386 | | |
382 | 387 | | |
383 | 388 | | |
384 | 389 | | |
385 | 390 | | |
386 | 391 | | |
387 | 392 | | |
388 | | - | |
389 | | - | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
390 | 396 | | |
391 | 397 | | |
392 | 398 | | |
393 | 399 | | |
394 | | - | |
395 | | - | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
396 | 403 | | |
397 | 404 | | |
398 | 405 | | |
399 | 406 | | |
400 | | - | |
401 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
402 | 410 | | |
403 | 411 | | |
404 | 412 | | |
405 | 413 | | |
406 | | - | |
407 | | - | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
408 | 417 | | |
409 | 418 | | |
410 | 419 | | |
| |||
0 commit comments