Protobuf: fixed a bug in ProtoKot runtime (Longs serialization)
This commit is contained in:
@@ -145,7 +145,7 @@ class CodedOutputStream(val buffer: ByteArray) {
|
|||||||
val res = ByteArray(10)
|
val res = ByteArray(10)
|
||||||
|
|
||||||
var resSize = 0
|
var resSize = 0
|
||||||
while(curValue != 0L) {
|
do {
|
||||||
// encode current 7 bits
|
// encode current 7 bits
|
||||||
var curByte = (curValue and WireFormat.VARINT_INFO_BITS_MASK.toLong())
|
var curByte = (curValue and WireFormat.VARINT_INFO_BITS_MASK.toLong())
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ class CodedOutputStream(val buffer: ByteArray) {
|
|||||||
|
|
||||||
res[resSize] = curByte.toByte()
|
res[resSize] = curByte.toByte()
|
||||||
resSize++
|
resSize++
|
||||||
}
|
} while(curValue != 0L)
|
||||||
output.write(res, 0, resSize)
|
output.write(res, 0, resSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -165,7 +165,7 @@ void FieldGenerator::generateSerializationForPacked(io::Printer *printer, bool i
|
|||||||
singleFieldGen.generateSerializationCode(printer, isRead, /* noTag = */ true, /* isField = */ false);
|
singleFieldGen.generateSerializationCode(printer, isRead, /* noTag = */ true, /* isField = */ false);
|
||||||
|
|
||||||
// increment iterator
|
// increment iterator
|
||||||
printer->Print("i += 1");
|
printer->Print("i += 1\n");
|
||||||
|
|
||||||
printer->Outdent(); // while-loop
|
printer->Outdent(); // while-loop
|
||||||
printer->Print("}\n");
|
printer->Print("}\n");
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ class CodedOutputStream(val buffer: ByteArray) {
|
|||||||
val res = ByteArray(10)
|
val res = ByteArray(10)
|
||||||
|
|
||||||
var resSize = 0
|
var resSize = 0
|
||||||
while(curValue != 0L) {
|
do {
|
||||||
// encode current 7 bits
|
// encode current 7 bits
|
||||||
var curByte = (curValue and WireFormat.VARINT_INFO_BITS_MASK.toLong())
|
var curByte = (curValue and WireFormat.VARINT_INFO_BITS_MASK.toLong())
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ class CodedOutputStream(val buffer: ByteArray) {
|
|||||||
|
|
||||||
res[resSize] = curByte.toByte()
|
res[resSize] = curByte.toByte()
|
||||||
resSize++
|
resSize++
|
||||||
}
|
} while(curValue != 0L)
|
||||||
output.write(res, 0, resSize)
|
output.write(res, 0, resSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user