Unverified Commit 659e799f authored by Paul Yang's avatar Paul Yang Committed by GitHub

Sync upb (#6577)

* Sync upb

* https://github.com/protocolbuffers/upb/pull/208

* Fix php c extension compiling

Don't use macros defined by upb

* Update ruby conformance failure list
parent b273cba1
...@@ -102,8 +102,6 @@ Required.Proto3.JsonInput.OptionalInt64Wrapper.JsonOutput ...@@ -102,8 +102,6 @@ Required.Proto3.JsonInput.OptionalInt64Wrapper.JsonOutput
Required.Proto3.JsonInput.OptionalStringWrapper.JsonOutput Required.Proto3.JsonInput.OptionalStringWrapper.JsonOutput
Required.Proto3.JsonInput.OptionalUint32Wrapper.JsonOutput Required.Proto3.JsonInput.OptionalUint32Wrapper.JsonOutput
Required.Proto3.JsonInput.OptionalUint64Wrapper.JsonOutput Required.Proto3.JsonInput.OptionalUint64Wrapper.JsonOutput
Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.JsonOutput
Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.ProtobufOutput
Required.Proto3.JsonInput.RejectTopLevelNull Required.Proto3.JsonInput.RejectTopLevelNull
Required.Proto3.JsonInput.RepeatedBoolWrapper.JsonOutput Required.Proto3.JsonInput.RepeatedBoolWrapper.JsonOutput
Required.Proto3.JsonInput.RepeatedBytesWrapper.JsonOutput Required.Proto3.JsonInput.RepeatedBytesWrapper.JsonOutput
......
...@@ -47,8 +47,8 @@ size_t stringsink_string(void *_sink, const void *hd, const char *ptr, ...@@ -47,8 +47,8 @@ size_t stringsink_string(void *_sink, const void *hd, const char *ptr,
stringsink *sink = _sink; stringsink *sink = _sink;
size_t new_size = sink->size; size_t new_size = sink->size;
UPB_UNUSED(hd); PHP_PROTO_UNUSED(hd);
UPB_UNUSED(handle); PHP_PROTO_UNUSED(handle);
while (sink->len + len > new_size) { while (sink->len + len > new_size) {
new_size *= 2; new_size *= 2;
...@@ -243,7 +243,7 @@ DEFINE_APPEND_HANDLER(double, double) ...@@ -243,7 +243,7 @@ DEFINE_APPEND_HANDLER(double, double)
static void* appendstr_handler(void *closure, static void* appendstr_handler(void *closure,
const void *hd, const void *hd,
size_t size_hint) { size_t size_hint) {
UPB_UNUSED(hd); PHP_PROTO_UNUSED(hd);
stringfields_parseframe_t* frame = stringfields_parseframe_t* frame =
(stringfields_parseframe_t*)malloc(sizeof(stringfields_parseframe_t)); (stringfields_parseframe_t*)malloc(sizeof(stringfields_parseframe_t));
...@@ -354,7 +354,7 @@ static void new_php_string(zval* value_ptr, const char* str, size_t len) { ...@@ -354,7 +354,7 @@ static void new_php_string(zval* value_ptr, const char* str, size_t len) {
static void* str_handler(void *closure, static void* str_handler(void *closure,
const void *hd, const void *hd,
size_t size_hint) { size_t size_hint) {
UPB_UNUSED(hd); PHP_PROTO_UNUSED(hd);
stringfields_parseframe_t* frame = stringfields_parseframe_t* frame =
(stringfields_parseframe_t*)malloc(sizeof(stringfields_parseframe_t)); (stringfields_parseframe_t*)malloc(sizeof(stringfields_parseframe_t));
...@@ -763,7 +763,7 @@ static bool oneofstr_end_handler(void *closure, const void *hd) { ...@@ -763,7 +763,7 @@ static bool oneofstr_end_handler(void *closure, const void *hd) {
static void *oneofstr_handler(void *closure, static void *oneofstr_handler(void *closure,
const void *hd, const void *hd,
size_t size_hint) { size_t size_hint) {
UPB_UNUSED(hd); PHP_PROTO_UNUSED(hd);
stringfields_parseframe_t* frame = stringfields_parseframe_t* frame =
(stringfields_parseframe_t*)malloc(sizeof(stringfields_parseframe_t)); (stringfields_parseframe_t*)malloc(sizeof(stringfields_parseframe_t));
...@@ -1093,7 +1093,7 @@ static void putmap(zval* map, const upb_fielddef* f, upb_sink sink, ...@@ -1093,7 +1093,7 @@ static void putmap(zval* map, const upb_fielddef* f, upb_sink sink,
static upb_selector_t getsel(const upb_fielddef* f, upb_handlertype_t type) { static upb_selector_t getsel(const upb_fielddef* f, upb_handlertype_t type) {
upb_selector_t ret; upb_selector_t ret;
bool ok = upb_handlers_getselector(f, type, &ret); bool ok = upb_handlers_getselector(f, type, &ret);
UPB_ASSERT(ok); PHP_PROTO_ASSERT(ok);
return ret; return ret;
} }
......
...@@ -46,6 +46,15 @@ ...@@ -46,6 +46,15 @@
#define ARRAY_SIZE(x) \ #define ARRAY_SIZE(x) \
((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x]))))) ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x])))))
#define PHP_PROTO_UNUSED(var) (void)var
/* PHP_PROTO_ASSERT(): in release mode, we use the expression without letting
* it be evaluated. This prevents "unused variable" warnings. */
#ifdef NDEBUG
#define PHP_PROTO_ASSERT(expr) do {} while (false && (expr))
#else
#define PHP_PROTO_ASSERT(expr) assert(expr)
#endif
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// PHP7 Wrappers // PHP7 Wrappers
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment