Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
aa152ef4
Commit
aa152ef4
authored
9 years ago
by
Masood Malekghassemi
Browse files
Options
Downloads
Plain Diff
Merge pull request #1895 from nicolasnoble/python-is-not-c89
Some compilers don't like C99.
parents
5dedc988
3f6d351b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/python/src/grpc/_adapter/_c/utility.c
+9
-6
9 additions, 6 deletions
src/python/src/grpc/_adapter/_c/utility.c
with
9 additions
and
6 deletions
src/python/src/grpc/_adapter/_c/utility.c
+
9
−
6
View file @
aa152ef4
...
@@ -145,6 +145,11 @@ int pygrpc_produce_op(PyObject *op, grpc_op *result) {
...
@@ -145,6 +145,11 @@ int pygrpc_produce_op(PyObject *op, grpc_op *result) {
static
const
int
STATUS_INDEX
=
4
;
static
const
int
STATUS_INDEX
=
4
;
static
const
int
STATUS_CODE_INDEX
=
0
;
static
const
int
STATUS_CODE_INDEX
=
0
;
static
const
int
STATUS_DETAILS_INDEX
=
1
;
static
const
int
STATUS_DETAILS_INDEX
=
1
;
int
type
;
Py_ssize_t
message_size
;
char
*
message
;
char
*
status_details
;
gpr_slice
message_slice
;
grpc_op
c_op
;
grpc_op
c_op
;
if
(
!
PyTuple_Check
(
op
))
{
if
(
!
PyTuple_Check
(
op
))
{
PyErr_SetString
(
PyExc_TypeError
,
"expected tuple op"
);
PyErr_SetString
(
PyExc_TypeError
,
"expected tuple op"
);
...
@@ -156,14 +161,10 @@ int pygrpc_produce_op(PyObject *op, grpc_op *result) {
...
@@ -156,14 +161,10 @@ int pygrpc_produce_op(PyObject *op, grpc_op *result) {
PyErr_SetString
(
PyExc_ValueError
,
buf
);
PyErr_SetString
(
PyExc_ValueError
,
buf
);
return
0
;
return
0
;
}
}
int
type
=
PyInt_AsLong
(
PyTuple_GET_ITEM
(
op
,
TYPE_INDEX
));
type
=
PyInt_AsLong
(
PyTuple_GET_ITEM
(
op
,
TYPE_INDEX
));
if
(
PyErr_Occurred
())
{
if
(
PyErr_Occurred
())
{
return
0
;
return
0
;
}
}
Py_ssize_t
message_size
;
char
*
message
;
char
*
status_details
;
gpr_slice
message_slice
;
c_op
.
op
=
type
;
c_op
.
op
=
type
;
switch
(
type
)
{
switch
(
type
)
{
case
GRPC_OP_SEND_INITIAL_METADATA
:
case
GRPC_OP_SEND_INITIAL_METADATA
:
...
@@ -366,7 +367,9 @@ gpr_timespec pygrpc_cast_double_to_gpr_timespec(double seconds) {
...
@@ -366,7 +367,9 @@ gpr_timespec pygrpc_cast_double_to_gpr_timespec(double seconds) {
int
pygrpc_produce_channel_args
(
PyObject
*
py_args
,
grpc_channel_args
*
c_args
)
{
int
pygrpc_produce_channel_args
(
PyObject
*
py_args
,
grpc_channel_args
*
c_args
)
{
size_t
num_args
=
PyList_Size
(
py_args
);
size_t
num_args
=
PyList_Size
(
py_args
);
size_t
i
;
size_t
i
;
grpc_channel_args
args
=
{
num_args
,
gpr_malloc
(
sizeof
(
grpc_arg
)
*
num_args
)};
grpc_channel_args
args
;
args
.
num_args
=
num_args
;
args
.
args
=
gpr_malloc
(
sizeof
(
grpc_arg
)
*
num_args
);
for
(
i
=
0
;
i
<
args
.
num_args
;
++
i
)
{
for
(
i
=
0
;
i
<
args
.
num_args
;
++
i
)
{
char
*
key
;
char
*
key
;
PyObject
*
value
;
PyObject
*
value
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment