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)
|
||||
|
||||
var resSize = 0
|
||||
while(curValue != 0L) {
|
||||
do {
|
||||
// encode current 7 bits
|
||||
var curByte = (curValue and WireFormat.VARINT_INFO_BITS_MASK.toLong())
|
||||
|
||||
@@ -159,7 +159,7 @@ class CodedOutputStream(val buffer: ByteArray) {
|
||||
|
||||
res[resSize] = curByte.toByte()
|
||||
resSize++
|
||||
}
|
||||
} while(curValue != 0L)
|
||||
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);
|
||||
|
||||
// increment iterator
|
||||
printer->Print("i += 1");
|
||||
printer->Print("i += 1\n");
|
||||
|
||||
printer->Outdent(); // while-loop
|
||||
printer->Print("}\n");
|
||||
|
||||
@@ -145,7 +145,7 @@ class CodedOutputStream(val buffer: ByteArray) {
|
||||
val res = ByteArray(10)
|
||||
|
||||
var resSize = 0
|
||||
while(curValue != 0L) {
|
||||
do {
|
||||
// encode current 7 bits
|
||||
var curByte = (curValue and WireFormat.VARINT_INFO_BITS_MASK.toLong())
|
||||
|
||||
@@ -159,7 +159,7 @@ class CodedOutputStream(val buffer: ByteArray) {
|
||||
|
||||
res[resSize] = curByte.toByte()
|
||||
resSize++
|
||||
}
|
||||
} while(curValue != 0L)
|
||||
output.write(res, 0, resSize)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user