diff options
-rw-r--r-- | php/src/Google/Protobuf/Internal/Message.php | 2 | ||||
-rwxr-xr-x | python/setup.py | 1 | ||||
-rw-r--r-- | src/google/protobuf/compiler/cpp/cpp_message.cc | 18 | ||||
-rw-r--r-- | src/google/protobuf/message.cc | 4 |
4 files changed, 12 insertions, 13 deletions
diff --git a/php/src/Google/Protobuf/Internal/Message.php b/php/src/Google/Protobuf/Internal/Message.php index 93e81c01..b7f83c57 100644 --- a/php/src/Google/Protobuf/Internal/Message.php +++ b/php/src/Google/Protobuf/Internal/Message.php @@ -1111,7 +1111,7 @@ class Message } try { $this->mergeFromJsonArray($array); - } catch (Exception $e) { + } catch (\Exception $e) { throw new GPBDecodeException($e->getMessage()); } } diff --git a/python/setup.py b/python/setup.py index efb74fe7..0f7e58b0 100755 --- a/python/setup.py +++ b/python/setup.py @@ -240,7 +240,6 @@ if __name__ == '__main__': classifiers=[ "Programming Language :: Python", "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", 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 { |