Skip to content

Commit

Permalink
Fix X32 build
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-lb committed Oct 25, 2024
1 parent dca3f43 commit fe5401f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions kafka_consumer.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ PHP_METHOD(RdKafka_KafkaConsumer, queryWatermarkOffsets)
object_intern *intern;
char *topic;
size_t topic_length;
long low, high;
int64_t low, high;
zend_long partition, timeout;
zval *lowResult, *highResult;
rd_kafka_resp_err_t err;
Expand All @@ -791,8 +791,8 @@ PHP_METHOD(RdKafka_KafkaConsumer, queryWatermarkOffsets)
return;
}

ZVAL_LONG(lowResult, low);
ZVAL_LONG(highResult, high);
ZVAL_LONG(lowResult, (zend_long) low);
ZVAL_LONG(highResult, (zend_long) high);
}
/* }}} */

Expand Down
6 changes: 3 additions & 3 deletions rdkafka.c
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ PHP_METHOD(RdKafka, queryWatermarkOffsets)
kafka_object *intern;
char *topic;
size_t topic_length;
long low, high;
int64_t low, high;
zend_long partition, timeout;
zval *lowResult, *highResult;
rd_kafka_resp_err_t err;
Expand All @@ -745,8 +745,8 @@ PHP_METHOD(RdKafka, queryWatermarkOffsets)
return;
}

ZVAL_LONG(lowResult, low);
ZVAL_LONG(highResult, high);
ZVAL_LONG(lowResult, (zend_long) low);
ZVAL_LONG(highResult, (zend_long) high);
}
/* }}} */

Expand Down
24 changes: 12 additions & 12 deletions topic.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ PHP_METHOD(RdKafka_ConsumerTopic, consumeCallback)
}

if (partition < 0 || partition > 0x7FFFFFFF) {
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '%ld' for $partition", partition);
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '" ZEND_LONG_FMT "' for $partition", partition);
return;
}

Expand Down Expand Up @@ -165,7 +165,7 @@ PHP_METHOD(RdKafka_ConsumerTopic, consumeQueueStart)
}

if (partition != RD_KAFKA_PARTITION_UA && (partition < 0 || partition > 0x7FFFFFFF)) {
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '%ld' for $partition", partition);
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '" ZEND_LONG_FMT "' for $partition", partition);
return;
}

Expand Down Expand Up @@ -223,7 +223,7 @@ PHP_METHOD(RdKafka_ConsumerTopic, consumeStart)
}

if (partition != RD_KAFKA_PARTITION_UA && (partition < 0 || partition > 0x7FFFFFFF)) {
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '%ld' for $partition", partition);
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '" ZEND_LONG_FMT "' for $partition", partition);
return;
}

Expand Down Expand Up @@ -275,7 +275,7 @@ PHP_METHOD(RdKafka_ConsumerTopic, consumeStop)
}

if (partition != RD_KAFKA_PARTITION_UA && (partition < 0 || partition > 0x7FFFFFFF)) {
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '%ld' for $partition", partition);
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '" ZEND_LONG_FMT "' for $partition", partition);
return;
}

Expand Down Expand Up @@ -316,7 +316,7 @@ PHP_METHOD(RdKafka_ConsumerTopic, consume)
}

if (partition != RD_KAFKA_PARTITION_UA && (partition < 0 || partition > 0x7FFFFFFF)) {
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '%ld' for $partition", partition);
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '" ZEND_LONG_FMT "' for $partition", partition);
return;
}

Expand Down Expand Up @@ -357,12 +357,12 @@ PHP_METHOD(RdKafka_ConsumerTopic, consumeBatch)
}

if (0 >= batch_size) {
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '%ld' for batch_size", batch_size);
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '" ZEND_LONG_FMT "' for batch_size", batch_size);
return;
}

if (partition != RD_KAFKA_PARTITION_UA && (partition < 0 || partition > 0x7FFFFFFF)) {
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '%ld' for $partition", partition);
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '" ZEND_LONG_FMT "' for $partition", partition);
return;
}

Expand Down Expand Up @@ -406,7 +406,7 @@ PHP_METHOD(RdKafka_ConsumerTopic, offsetStore)
}

if (partition < 0 || partition > 0x7FFFFFFF) {
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '%ld' for $partition", partition);
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '" ZEND_LONG_FMT "' for $partition", partition);
return;
}

Expand Down Expand Up @@ -455,12 +455,12 @@ PHP_METHOD(RdKafka_ProducerTopic, produce)
ZEND_PARSE_PARAMETERS_END();

if (partition != RD_KAFKA_PARTITION_UA && (partition < 0 || partition > 0x7FFFFFFF)) {
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '%ld' for $partition", partition);
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '" ZEND_LONG_FMT "' for $partition", partition);
return;
}

if (msgflags != 0 && msgflags != RD_KAFKA_MSG_F_BLOCK) {
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Invalid value '%ld' for $msgflags", msgflags);
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Invalid value '" ZEND_LONG_FMT "' for $msgflags", msgflags);
return;
}

Expand Down Expand Up @@ -524,12 +524,12 @@ PHP_METHOD(RdKafka_ProducerTopic, producev)
ZEND_PARSE_PARAMETERS_END();

if (partition != RD_KAFKA_PARTITION_UA && (partition < 0 || partition > 0x7FFFFFFF)) {
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '%ld' for $partition", partition);
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Out of range value '" ZEND_LONG_FMT "' for $partition", partition);
return;
}

if (msgflags != 0 && msgflags != RD_KAFKA_MSG_F_BLOCK) {
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Invalid value '%ld' for $msgflags", msgflags);
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Invalid value '" ZEND_LONG_FMT "' for $msgflags", msgflags);
return;
}

Expand Down

0 comments on commit fe5401f

Please sign in to comment.