Browse Source

clean code

pull/640/head
13291271729 3 years ago
parent
commit
4950b90320
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      parser/common/convert/message2operator.cc
  2. +1
    -1
      parser/common/convert/pb2json.cc

+ 1
- 0
parser/common/convert/message2operator.cc View File

@@ -119,6 +119,7 @@ Status Message2Operator::ParseRepeatedField(const google::protobuf::Reflection *
GELOGE(FAILED, "[Check][Size]Size of repeated field %s must bigger than 0", field->name().c_str());
return FAILED;
}

switch (field->cpp_type()) {
#define CASE_FIELD_TYPE_REPEATED(cpptype, method, valuetype) \
case google::protobuf::FieldDescriptor::CPPTYPE_##cpptype: { \


+ 1
- 1
parser/common/convert/pb2json.cc View File

@@ -122,7 +122,7 @@ void Pb2Json::OneField2Json(const ProtobufMsg &message, const ProtobufFieldDescr

case ProtobufFieldDescriptor::TYPE_FLOAT:
char str[kSignificantDigits];
if (sprintf_s(str, kSignificantDigits, "%g", reflection->GetFloat(message, field)) != -1){
if (sprintf_s(str, kSignificantDigits, "%g", reflection->GetFloat(message, field)) != -1) {
json[field->name()] = str;
} else {
json[field->name()] = reflection->GetFloat(message, field);


Loading…
Cancel
Save