diff --git a/src/python/src/grpc/_adapter/_call.c b/src/python/src/grpc/_adapter/_call.c index f837267e9a5a2d513db4419993ce78140bd95ba1..bf96c1a3fa5d43168459116b11a99ab25ff4a9c6 100644 --- a/src/python/src/grpc/_adapter/_call.c +++ b/src/python/src/grpc/_adapter/_call.c @@ -164,10 +164,10 @@ static const PyObject *pygrpc_call_add_metadata(Call *self, PyObject *args) { const char* key = NULL; const char* value = NULL; int value_length = 0; + grpc_metadata metadata; if (!PyArg_ParseTuple(args, "ss#", &key, &value, &value_length)) { return NULL; } - grpc_metadata metadata; metadata.key = key; metadata.value = value; metadata.value_length = value_length; diff --git a/src/python/src/grpc/_adapter/_call.h b/src/python/src/grpc/_adapter/_call.h index fabc6f399d4d410244d6e89b8a8c9fb181730c10..c04a2285f70366a6ad0dc94bdaa1c727af30a707 100644 --- a/src/python/src/grpc/_adapter/_call.h +++ b/src/python/src/grpc/_adapter/_call.h @@ -38,7 +38,7 @@ #include <grpc/grpc.h> typedef struct { - PyObject_HEAD; + PyObject_HEAD grpc_call *c_call; } Call; diff --git a/src/python/src/grpc/_adapter/_channel.h b/src/python/src/grpc/_adapter/_channel.h index 303b675192654755fb8ef0aa0b67276da846259c..afc0f80359d3fb6003f6de62541e5866f1fbad8e 100644 --- a/src/python/src/grpc/_adapter/_channel.h +++ b/src/python/src/grpc/_adapter/_channel.h @@ -38,7 +38,7 @@ #include <grpc/grpc.h> typedef struct { - PyObject_HEAD; + PyObject_HEAD grpc_channel *c_channel; } Channel; diff --git a/src/python/src/grpc/_adapter/_client_credentials.h b/src/python/src/grpc/_adapter/_client_credentials.h index 47476ce15fec0480354e4c152430a76058d048fd..bb9f7f0c3a17a02fa4a5ecdf26353cd8fb652b2f 100644 --- a/src/python/src/grpc/_adapter/_client_credentials.h +++ b/src/python/src/grpc/_adapter/_client_credentials.h @@ -38,7 +38,7 @@ #include <grpc/grpc_security.h> typedef struct { - PyObject_HEAD; + PyObject_HEAD grpc_credentials *c_client_credentials; } ClientCredentials; diff --git a/src/python/src/grpc/_adapter/_completion_queue.c b/src/python/src/grpc/_adapter/_completion_queue.c index 76d6b6cb44923f3844a31f56f9643170686232a2..a639eff53e9395fdc9c6d0cb75c4af525f4599a5 100644 --- a/src/python/src/grpc/_adapter/_completion_queue.c +++ b/src/python/src/grpc/_adapter/_completion_queue.c @@ -124,7 +124,7 @@ static PyObject *pygrpc_metadata_collection_get( PyObject *key = PyString_FromString(elem.key); PyObject *value = PyString_FromStringAndSize(elem.value, elem.value_length); PyObject* kvp = PyTuple_Pack(2, key, value); - // n.b. PyList_SetItem *steals* a reference to the set element. + /* n.b. PyList_SetItem *steals* a reference to the set element. */ PyList_SetItem(metadata, i, kvp); Py_DECREF(key); Py_DECREF(value); @@ -266,6 +266,7 @@ static PyObject *pygrpc_finished_event_args(grpc_event *c_event) { PyObject *details; PyObject *status; PyObject *event_args; + PyObject *metadata; code = pygrpc_status_code(c_event->data.finished.status); if (code == NULL) { @@ -285,7 +286,7 @@ static PyObject *pygrpc_finished_event_args(grpc_event *c_event) { if (status == NULL) { return NULL; } - PyObject* metadata = pygrpc_metadata_collection_get( + metadata = pygrpc_metadata_collection_get( c_event->data.finished.metadata_elements, c_event->data.finished.metadata_count); event_args = PyTuple_Pack(8, finish_event_kind, (PyObject *)c_event->tag, diff --git a/src/python/src/grpc/_adapter/_completion_queue.h b/src/python/src/grpc/_adapter/_completion_queue.h index 3a39476a2e1ad193a012c31c90bc36416185749c..9b377d15d9c5831d1eb5ea127981a9237c396dd9 100644 --- a/src/python/src/grpc/_adapter/_completion_queue.h +++ b/src/python/src/grpc/_adapter/_completion_queue.h @@ -38,7 +38,7 @@ #include <grpc/grpc.h> typedef struct { - PyObject_HEAD; + PyObject_HEAD grpc_completion_queue *c_completion_queue; } CompletionQueue; diff --git a/src/python/src/grpc/_adapter/_server.h b/src/python/src/grpc/_adapter/_server.h index 4248712c1c113d1516b66edc1fb18b1e5ff78316..4836bb638c54866a3c9da7be4d87553279cebd62 100644 --- a/src/python/src/grpc/_adapter/_server.h +++ b/src/python/src/grpc/_adapter/_server.h @@ -38,7 +38,7 @@ #include <grpc/grpc.h> typedef struct { - PyObject_HEAD; + PyObject_HEAD grpc_server *c_server; } Server; diff --git a/src/python/src/grpc/_adapter/_server_credentials.h b/src/python/src/grpc/_adapter/_server_credentials.h index bb6ff2c5bb86a5adb4b1d8cb1624e282f968053f..6090404bd9561602b5af7f4cf7ce3fa2208693d0 100644 --- a/src/python/src/grpc/_adapter/_server_credentials.h +++ b/src/python/src/grpc/_adapter/_server_credentials.h @@ -38,7 +38,7 @@ #include <grpc/grpc_security.h> typedef struct { - PyObject_HEAD; + PyObject_HEAD grpc_server_credentials *c_server_credentials; } ServerCredentials;