Skip to content

Commit

Permalink
Satisfy C90 pedantry in Python adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
soltanmm committed Apr 3, 2015
1 parent a4b0909 commit 660a33e
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/python/src/grpc/_adapter/_call.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/python/src/grpc/_adapter/_call.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <grpc/grpc.h>

typedef struct {
PyObject_HEAD;
PyObject_HEAD
grpc_call *c_call;
} Call;

Expand Down
2 changes: 1 addition & 1 deletion src/python/src/grpc/_adapter/_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <grpc/grpc.h>

typedef struct {
PyObject_HEAD;
PyObject_HEAD
grpc_channel *c_channel;
} Channel;

Expand Down
2 changes: 1 addition & 1 deletion src/python/src/grpc/_adapter/_client_credentials.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <grpc/grpc_security.h>

typedef struct {
PyObject_HEAD;
PyObject_HEAD
grpc_credentials *c_client_credentials;
} ClientCredentials;

Expand Down
5 changes: 3 additions & 2 deletions src/python/src/grpc/_adapter/_completion_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/python/src/grpc/_adapter/_completion_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <grpc/grpc.h>

typedef struct {
PyObject_HEAD;
PyObject_HEAD
grpc_completion_queue *c_completion_queue;
} CompletionQueue;

Expand Down
2 changes: 1 addition & 1 deletion src/python/src/grpc/_adapter/_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <grpc/grpc.h>

typedef struct {
PyObject_HEAD;
PyObject_HEAD
grpc_server *c_server;
} Server;

Expand Down
2 changes: 1 addition & 1 deletion src/python/src/grpc/_adapter/_server_credentials.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <grpc/grpc_security.h>

typedef struct {
PyObject_HEAD;
PyObject_HEAD
grpc_server_credentials *c_server_credentials;
} ServerCredentials;

Expand Down

0 comments on commit 660a33e

Please sign in to comment.