Fixed a couple of compiler warnings.

PiperOrigin-RevId: 642339381
pull/17046/head
Joshua Haberman 9 months ago committed by Copybara-Service
parent e4970aac30
commit bffd01c649
  1. 10
      python/map.c
  2. 1
      python/message.c
  3. 4
      python/protobuf.c

@ -259,16 +259,6 @@ static Py_ssize_t PyUpb_MapContainer_Length(PyObject* _self) {
return map ? upb_Map_Size(map) : 0;
}
static PyUpb_MapContainer* PyUpb_MapContainer_Check(PyObject* _self) {
PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
if (!PyObject_TypeCheck(_self, state->message_map_container_type) &&
!PyObject_TypeCheck(_self, state->scalar_map_container_type)) {
PyErr_Format(PyExc_TypeError, "Expected protobuf map, but got %R", _self);
return NULL;
}
return (PyUpb_MapContainer*)_self;
}
int PyUpb_Message_InitMapAttributes(PyObject* map, PyObject* value,
const upb_FieldDef* f);

@ -1665,7 +1665,6 @@ static PyObject* PyUpb_Message_WhichOneof(PyObject* _self, PyObject* name) {
}
PyObject* DeepCopy(PyObject* _self, PyObject* arg) {
PyUpb_Message* self = (void*)_self;
const upb_MessageDef* def = PyUpb_Message_GetMsgdef(_self);
const upb_MiniTable* mini_table = upb_MessageDef_MiniTable(def);
upb_Message* msg = PyUpb_Message_GetIfReified(_self);

@ -216,7 +216,7 @@ typedef struct {
// memory to the OS. Without this call, we appear to leak memory, at least
// as measured in RSS.
//
// We opt not to use this instead of PyMalloc (which would also solve the
// We opt to use this instead of PyMalloc (which would also solve the
// problem) because the latter requires the GIL to be held. This would make
// our messages unsafe to share with other languages that could free at
// unpredictable
@ -240,7 +240,7 @@ static void* upb_trim_allocfunc(upb_alloc* alloc, void* ptr, size_t oldsize,
}
}
static upb_alloc trim_alloc = {&upb_trim_allocfunc};
static const upb_alloc* global_alloc = &trim_alloc;
static upb_alloc* global_alloc = &trim_alloc;
// end:github_only
static upb_Arena* PyUpb_NewArena(void) {

Loading…
Cancel
Save