Fix failures on R hub and Win builder. (#7763)
* Update date. * Workaround amalgamation build with clang. (SimpleDMatrix instantiation) * Workaround compiler error with driver push. * Revert autoconf requirement. * Fix model IO on 32-bit environment. (i386) * Clarify the function name.
This commit is contained in:
@@ -864,7 +864,7 @@ Json UBJReader::Parse() {
|
||||
namespace {
|
||||
template <typename T>
|
||||
void WritePrimitive(T v, std::vector<char>* stream) {
|
||||
v = ByteSwap(v);
|
||||
v = ToBigEndian(v);
|
||||
auto s = stream->size();
|
||||
stream->resize(s + sizeof(v));
|
||||
auto ptr = stream->data() + s;
|
||||
@@ -918,13 +918,13 @@ void WriteTypedArray(JsonTypedArray<T, kind> const* arr, std::vector<char>* stre
|
||||
stream->push_back('#');
|
||||
stream->push_back('L');
|
||||
|
||||
auto n = arr->Size();
|
||||
int64_t n = arr->Size();
|
||||
WritePrimitive(n, stream);
|
||||
auto s = stream->size();
|
||||
stream->resize(s + arr->Size() * sizeof(T));
|
||||
auto const& vec = arr->GetArray();
|
||||
for (size_t i = 0; i < n; ++i) {
|
||||
auto v = ByteSwap(vec[i]);
|
||||
auto v = ToBigEndian(vec[i]);
|
||||
std::memcpy(stream->data() + s, &v, sizeof(v));
|
||||
s += sizeof(v);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user