diff options
-rw-r--r-- | src/google/protobuf/compiler/cpp/cpp_message.cc | 18 | ||||
-rw-r--r-- | src/google/protobuf/message.cc | 4 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/google/protobuf/compiler/cpp/cpp_message.cc b/src/google/protobuf/compiler/cpp/cpp_message.cc index 60467598..34a70b12 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message.cc +++ b/src/google/protobuf/compiler/cpp/cpp_message.cc @@ -113,16 +113,16 @@ struct ExtensionRangeSorter { bool IsPOD(const FieldDescriptor* field) { if (field->is_repeated() || field->is_extension()) return false; switch (field->cpp_type()) { - case internal::WireFormatLite::CPPTYPE_ENUM: - case internal::WireFormatLite::CPPTYPE_INT32: - case internal::WireFormatLite::CPPTYPE_INT64: - case internal::WireFormatLite::CPPTYPE_UINT32: - case internal::WireFormatLite::CPPTYPE_UINT64: - case internal::WireFormatLite::CPPTYPE_FLOAT: - case internal::WireFormatLite::CPPTYPE_DOUBLE: - case internal::WireFormatLite::CPPTYPE_BOOL: + case FieldDescriptor::CPPTYPE_ENUM: + case FieldDescriptor::CPPTYPE_INT32: + case FieldDescriptor::CPPTYPE_INT64: + case FieldDescriptor::CPPTYPE_UINT32: + case FieldDescriptor::CPPTYPE_UINT64: + case FieldDescriptor::CPPTYPE_FLOAT: + case FieldDescriptor::CPPTYPE_DOUBLE: + case FieldDescriptor::CPPTYPE_BOOL: return true; - case internal::WireFormatLite::CPPTYPE_STRING: + case FieldDescriptor::CPPTYPE_STRING: return false; default: return false; diff --git a/src/google/protobuf/message.cc b/src/google/protobuf/message.cc index a0d3feba..42ec0337 100644 --- a/src/google/protobuf/message.cc +++ b/src/google/protobuf/message.cc @@ -170,12 +170,12 @@ size_t Message::SpaceUsedLong() const { bool Message::SerializeToFileDescriptor(int file_descriptor) const { io::FileOutputStream output(file_descriptor); - return SerializeToZeroCopyStream(&output); + return SerializeToZeroCopyStream(&output) && output.Flush(); } bool Message::SerializePartialToFileDescriptor(int file_descriptor) const { io::FileOutputStream output(file_descriptor); - return SerializePartialToZeroCopyStream(&output); + return SerializePartialToZeroCopyStream(&output) && output.Flush(); } bool Message::SerializeToOstream(std::ostream* output) const { |