Protobuf: fixed a bug in ProtoKot runtime (Longs serialization)

This commit is contained in:
dsavvinov
2016-08-18 18:01:48 +03:00
parent 33de250147
commit db519059b9
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -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)
}
@@ -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)
}