Skip to content

Commit e6956a2

Browse files
authored
Merge pull request #44 from confluentinc/fix_i386_warnings
Fix 32-bit arch build warnings
2 parents 63fcfec + 9e353b7 commit e6956a2

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

confluent_kafka/src/Consumer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static PyObject *Consumer_subscribe (Handle *self, PyObject *args,
108108
return NULL;
109109
}
110110

111-
topics = rd_kafka_topic_partition_list_new(PyList_Size(tlist));
111+
topics = rd_kafka_topic_partition_list_new((int)PyList_Size(tlist));
112112
for (pos = 0 ; pos < PyList_Size(tlist) ; pos++) {
113113
PyObject *o = PyList_GetItem(tlist, pos);
114114
PyObject *uo;

confluent_kafka/src/Producer.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ int32_t Producer_partitioner_cb (const rd_kafka_topic_t *rkt,
219219
if (!args) {
220220
cfl_PyErr_Format(RD_KAFKA_RESP_ERR__FAIL,
221221
"Unable to build callback args");
222-
printf("Failed to build args\n");
223222
goto done;
224223
}
225224

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

230229
if (result) {
231-
r = PyLong_AsLong(result);
230+
r = (int32_t)PyLong_AsLong(result);
232231
if (PyErr_Occurred())
233232
printf("FIXME: partition_cb returned wrong type "
234233
"(expected long), how to propagate?\n");

confluent_kafka/src/confluent_kafka.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static PyObject* KafkaError_richcompare (KafkaError *self, PyObject *o2,
133133
if (Py_TYPE(o2) == &KafkaErrorType)
134134
code2 = ((KafkaError *)o2)->code;
135135
else
136-
code2 = PyLong_AsLong(o2);
136+
code2 = (int)PyLong_AsLong(o2);
137137

138138
switch (op)
139139
{
@@ -320,7 +320,7 @@ static PyObject *Message_partition (Message *self, PyObject *ignore) {
320320

321321
static PyObject *Message_offset (Message *self, PyObject *ignore) {
322322
if (self->offset >= 0)
323-
return PyLong_FromLong(self->offset);
323+
return PyLong_FromLongLong(self->offset);
324324
else
325325
Py_RETURN_NONE;
326326
}
@@ -776,7 +776,7 @@ rd_kafka_topic_partition_list_t *py_to_c_parts (PyObject *plist) {
776776
return NULL;
777777
}
778778

779-
c_parts = rd_kafka_topic_partition_list_new(PyList_Size(plist));
779+
c_parts = rd_kafka_topic_partition_list_new((int)PyList_Size(plist));
780780

781781
for (i = 0 ; i < PyList_Size(plist) ; i++) {
782782
TopicPartition *tp = (TopicPartition *)

0 commit comments

Comments
 (0)