Skip to content

Fix 32-bit arch build warnings #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion confluent_kafka/src/Consumer.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static PyObject *Consumer_subscribe (Handle *self, PyObject *args,
return NULL;
}

topics = rd_kafka_topic_partition_list_new(PyList_Size(tlist));
topics = rd_kafka_topic_partition_list_new((int)PyList_Size(tlist));
for (pos = 0 ; pos < PyList_Size(tlist) ; pos++) {
PyObject *o = PyList_GetItem(tlist, pos);
PyObject *uo;
Expand Down
3 changes: 1 addition & 2 deletions confluent_kafka/src/Producer.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ int32_t Producer_partitioner_cb (const rd_kafka_topic_t *rkt,
if (!args) {
cfl_PyErr_Format(RD_KAFKA_RESP_ERR__FAIL,
"Unable to build callback args");
printf("Failed to build args\n");
goto done;
}

Expand All @@ -228,7 +227,7 @@ int32_t Producer_partitioner_cb (const rd_kafka_topic_t *rkt,
Py_DECREF(args);

if (result) {
r = PyLong_AsLong(result);
r = (int32_t)PyLong_AsLong(result);
if (PyErr_Occurred())
printf("FIXME: partition_cb returned wrong type "
"(expected long), how to propagate?\n");
Expand Down
6 changes: 3 additions & 3 deletions confluent_kafka/src/confluent_kafka.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static PyObject* KafkaError_richcompare (KafkaError *self, PyObject *o2,
if (Py_TYPE(o2) == &KafkaErrorType)
code2 = ((KafkaError *)o2)->code;
else
code2 = PyLong_AsLong(o2);
code2 = (int)PyLong_AsLong(o2);

switch (op)
{
Expand Down Expand Up @@ -320,7 +320,7 @@ static PyObject *Message_partition (Message *self, PyObject *ignore) {

static PyObject *Message_offset (Message *self, PyObject *ignore) {
if (self->offset >= 0)
return PyLong_FromLong(self->offset);
return PyLong_FromLongLong(self->offset);
else
Py_RETURN_NONE;
}
Expand Down Expand Up @@ -776,7 +776,7 @@ rd_kafka_topic_partition_list_t *py_to_c_parts (PyObject *plist) {
return NULL;
}

c_parts = rd_kafka_topic_partition_list_new(PyList_Size(plist));
c_parts = rd_kafka_topic_partition_list_new((int)PyList_Size(plist));

for (i = 0 ; i < PyList_Size(plist) ; i++) {
TopicPartition *tp = (TopicPartition *)
Expand Down