From e977c0af03fa2aa366ca7ecffcf007f186357c60 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Tue, 29 Nov 2016 19:54:12 +0000 Subject: Fixed more bugs surfaced by Travis. --- upb/bindings/googlepb/proto2.cc | 8 ++++---- upb/msg.h | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) (limited to 'upb') diff --git a/upb/bindings/googlepb/proto2.cc b/upb/bindings/googlepb/proto2.cc index bfd5ba2..ebfedca 100644 --- a/upb/bindings/googlepb/proto2.cc +++ b/upb/bindings/googlepb/proto2.cc @@ -12,10 +12,10 @@ #include -#include "upb/def.h" #include "upb/bindings/googlepb/proto1.int.h" +#include "upb/def.h" #include "upb/handlers.h" -#include "upb/shim/shim.h" +#include "upb/msg.h" #include "upb/sink.h" namespace { @@ -593,8 +593,8 @@ case goog::FieldDescriptor::cpptype: \ SetStartRepeatedField(proto2_f, r, f, h); CHKRET(h->SetValueHandler(f, UpbMakeHandlerT(AppendPrimitive))); } else { - CHKRET(upb::Shim::Set(h, f, GetOffset(proto2_f, r), - GetHasbit(proto2_f, r))); + CHKRET(upb_msg_setscalarhandler(h, f, GetOffset(proto2_f, r), + GetHasbit(proto2_f, r))); } } } diff --git a/upb/msg.h b/upb/msg.h index 912d6ac..2d1a261 100644 --- a/upb/msg.h +++ b/upb/msg.h @@ -32,8 +32,13 @@ #ifdef __cplusplus namespace upb { -class MessageLayout; +class Array; +class Map; +class MapIterator; class MessageFactory; +class MessageLayout; +class Visitor; +class VisitorPlan; } #endif @@ -110,6 +115,9 @@ typedef union { int64_t i64; uint32_t u32; uint64_t u64; + const upb_map* map; + const upb_msg* msg; + const upb_array* arr; const void* ptr; struct { const char *ptr; @@ -137,10 +145,10 @@ ACCESSORS(int32, i32, int32_t) ACCESSORS(int64, i64, int64_t) ACCESSORS(uint32, u32, uint32_t) ACCESSORS(uint64, u64, uint64_t) -ACCESSORS(map, ptr, const upb_map*) -ACCESSORS(msg, ptr, const upb_msg*) +ACCESSORS(map, map, const upb_map*) +ACCESSORS(msg, msg, const upb_msg*) ACCESSORS(ptr, ptr, const void*) -ACCESSORS(arr, ptr, const upb_array*) +ACCESSORS(arr, arr, const upb_array*) #undef ACCESSORS -- cgit v1.2.3