fix in encoder
This commit is contained in:
parent
5558151c91
commit
e929c8d3d4
|
@ -52,7 +52,7 @@ public:
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
size |= 0b10000000;
|
size |= 0b10000000;
|
||||||
writer->write((const char*)(&size), 1);
|
writer->write((byte*)(&size), 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,9 +71,9 @@ public:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
writer->write("\xd9", 1);
|
writer->write((uint8_t*)"\xd9", 1);
|
||||||
writer->write((const char*)&castedLen, 1);
|
writer->write((uint8_t*)&castedLen, 1);
|
||||||
writer->write(s, len);
|
writer->write((uint8_t*)s, len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,8 +90,8 @@ public:
|
||||||
value = htonl(value);
|
value = htonl(value);
|
||||||
else if( sizeof(T) == 2)
|
else if( sizeof(T) == 2)
|
||||||
value = htons(value);
|
value = htons(value);
|
||||||
writer->write(&TypeToMsgPackCode<T>::CODE, 1);
|
writer->write((uint8_t*)(&TypeToMsgPackCode<T>::CODE), 1);
|
||||||
writer->write((const char*)&value, sizeof(T));
|
writer->write((uint8_t*)&value, sizeof(T));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,9 +112,9 @@ public:
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
uint32_t nlength = htonl(length * sizeof(T));
|
uint32_t nlength = htonl(length * sizeof(T));
|
||||||
writer->write("\xc9", 1); // ext dtype since typed arrays are not supported by msgpack
|
writer->write((uint8_t*)("\xc9"), 1); // ext dtype since typed arrays are not supported by msgpack
|
||||||
writer->write((char*)(&nlength), sizeof(uint32_t) );
|
writer->write((uint8_t*)(&nlength), sizeof(uint32_t) );
|
||||||
writer->write(&TypeToMsgPackCode<T>::CODE, 1); // put code for type here, this is not part of msgpack but custom
|
writer->write((uint8_t*)(&TypeToMsgPackCode<T>::CODE), 1); // put code for type here, this is not part of msgpack but custom
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ public:
|
||||||
void sendArrayPartialContents(T * data, uint32_t length)
|
void sendArrayPartialContents(T * data, uint32_t length)
|
||||||
{
|
{
|
||||||
if( !sizeCountMode ) {
|
if( !sizeCountMode ) {
|
||||||
writer->write((char*)(data), length * sizeof(T));
|
writer->write((uint8_t*)(data), length * sizeof(T));
|
||||||
} else {
|
} else {
|
||||||
contentLength += sizeof(T) * length;
|
contentLength += sizeof(T) * length;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue