From 5953ac4736c0d2ac9eaf8ef4309df566c261705b Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sun, 9 Jan 2022 23:52:23 -0800 Subject: [PATCH] Backed out Reify() signature change. --- python/map.h | 1 + python/repeated.c | 3 +-- python/repeated.h | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/python/map.h b/python/map.h index 46ae75d721..9f6f969db6 100644 --- a/python/map.h +++ b/python/map.h @@ -47,6 +47,7 @@ PyObject* PyUpb_MapContainer_GetOrCreateWrapper(upb_map* map, PyObject* arena); // Reifies a map stub to point to the concrete data in `map`. +// If `map` is NULL, an appropriate empty map will be constructed. void PyUpb_MapContainer_Reify(PyObject* self, upb_map* map); // Reifies this map object if it is not already reified. diff --git a/python/repeated.c b/python/repeated.c index 0b25f4c3ef..4794fc17bd 100644 --- a/python/repeated.c +++ b/python/repeated.c @@ -106,7 +106,7 @@ static upb_array* PyUpb_RepeatedContainer_GetIfReified( return PyUpb_RepeatedContainer_IsStub(self) ? NULL : self->ptr.arr; } -upb_array* PyUpb_RepeatedContainer_Reify(PyObject* _self, upb_array* arr) { +void PyUpb_RepeatedContainer_Reify(PyObject* _self, upb_array* arr) { PyUpb_RepeatedContainer* self = (PyUpb_RepeatedContainer*)_self; assert(PyUpb_RepeatedContainer_IsStub(self)); if (!arr) { @@ -119,7 +119,6 @@ upb_array* PyUpb_RepeatedContainer_Reify(PyObject* _self, upb_array* arr) { self->ptr.arr = arr; // Overwrites self->ptr.parent. self->field &= ~(uintptr_t)1; assert(!PyUpb_RepeatedContainer_IsStub(self)); - return arr; } upb_array* PyUpb_RepeatedContainer_EnsureReified(PyObject* _self) { diff --git a/python/repeated.h b/python/repeated.h index ec2ac168c2..de81b2be23 100644 --- a/python/repeated.h +++ b/python/repeated.h @@ -48,7 +48,8 @@ PyObject* PyUpb_RepeatedContainer_GetOrCreateWrapper(upb_array* arr, PyObject* arena); // Reifies a repeated field stub to point to the concrete data in `arr`. -upb_array* PyUpb_RepeatedContainer_Reify(PyObject* self, upb_array* arr); +// If `arr` is NULL, an appropriate empty array will be constructed. +void PyUpb_RepeatedContainer_Reify(PyObject* self, upb_array* arr); // Reifies this repeated object if it is not already reified. upb_array* PyUpb_RepeatedContainer_EnsureReified(PyObject* self);