From ce9bba3cb5409844f8f3d7dcc235a9ea30cad090 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Fri, 20 Dec 2013 17:40:40 -0800 Subject: Sync from Google-internal development. --- upb/google/proto2.cc | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'upb/google/proto2.cc') diff --git a/upb/google/proto2.cc b/upb/google/proto2.cc index e878a65..d138123 100644 --- a/upb/google/proto2.cc +++ b/upb/google/proto2.cc @@ -314,28 +314,23 @@ case goog::FieldDescriptor::cpptype: \ } template - static bool AppendPrimitive(goog::RepeatedField* r, T val) { - r->Add(val); - return true; - } + static void AppendPrimitive(goog::RepeatedField* r, T val) { r->Add(val); } template - static bool AppendPrimitiveExtension(goog::Message* m, + static void AppendPrimitiveExtension(goog::Message* m, const ExtensionFieldData* data, T val) { goog::internal::ExtensionSet* set = data->GetExtensionSet(m); // TODO(haberman): give an accurate value for "packed" goog::internal::RepeatedPrimitiveTypeTraits::Add( data->number(), data->type(), true, val, set); - return true; } template - static bool SetPrimitiveExtension(goog::Message* m, + static void SetPrimitiveExtension(goog::Message* m, const ExtensionFieldData* data, T val) { goog::internal::ExtensionSet* set = data->GetExtensionSet(m); goog::internal::PrimitiveTypeTraits::Set(data->number(), data->type(), val, set); - return true; } // Enum ////////////////////////////////////////////////////////////////////// @@ -379,7 +374,7 @@ case goog::FieldDescriptor::cpptype: \ } } - static bool SetEnum(goog::Message* m, const EnumHandlerData* data, + static void SetEnum(goog::Message* m, const EnumHandlerData* data, int32_t val) { if (data->IsValidValue(val)) { int32_t* message_val = data->GetFieldPointer(m); @@ -388,10 +383,9 @@ case goog::FieldDescriptor::cpptype: \ } else { data->mutable_unknown_fields(m)->AddVarint(data->field_number(), val); } - return true; } - static bool AppendEnum(goog::Message* m, const EnumHandlerData* data, + static void AppendEnum(goog::Message* m, const EnumHandlerData* data, int32_t val) { // Closure is the enclosing message. We can't use the RepeatedField<> as // the closure because we need to go back to the message for unrecognized @@ -403,7 +397,6 @@ case goog::FieldDescriptor::cpptype: \ } else { data->mutable_unknown_fields(m)->AddVarint(data->field_number(), val); } - return true; } // EnumExtension ///////////////////////////////////////////////////////////// @@ -421,19 +414,17 @@ case goog::FieldDescriptor::cpptype: \ } } - static bool SetEnumExtension(goog::Message* m, const ExtensionFieldData* data, + static void SetEnumExtension(goog::Message* m, const ExtensionFieldData* data, int32_t val) { goog::internal::ExtensionSet* set = data->GetExtensionSet(m); set->SetEnum(data->number(), data->type(), val, NULL); - return true; } - static bool AppendEnumExtension(goog::Message* m, + static void AppendEnumExtension(goog::Message* m, const ExtensionFieldData* data, int32_t val) { goog::internal::ExtensionSet* set = data->GetExtensionSet(m); // TODO(haberman): give an accurate value for "packed" set->AddEnum(data->number(), data->type(), true, val, NULL); - return true; } // String //////////////////////////////////////////////////////////////////// -- cgit v1.2.3