Skip to content

Commit

Permalink
Fix some compiler warnings in public headers
Browse files Browse the repository at this point in the history
  • Loading branch information
erobot committed Dec 25, 2024
1 parent 4ba83e8 commit 8502aed
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 2 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# under the License.
#

add_compile_options(-Wextra -Wno-unused-parameter)

if (NOT MSVC)
set(CMAKE_C_FLAGS " -std=c99 ${CMAKE_C_FLAGS}")
endif()
Expand Down
2 changes: 1 addition & 1 deletion include/pulsar/BrokerConsumerStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class PULSAR_PUBLIC BrokerConsumerStats {
virtual const std::string getConnectedSince() const;

/** Returns Whether this subscription is Exclusive or Shared or Failover */
virtual const ConsumerType getType() const;
virtual ConsumerType getType() const;

/** Returns the rate of messages expired on this subscription. msg/s */
virtual double getMsgRateExpired() const;
Expand Down
2 changes: 1 addition & 1 deletion include/pulsar/Message.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class PULSAR_PUBLIC Message {
/**
* Get the redelivery count for this message
*/
const int getRedeliveryCount() const;
int getRedeliveryCount() const;

/**
* Check if schema version exists
Expand Down
4 changes: 2 additions & 2 deletions include/pulsar/c/client_configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@ PULSAR_PUBLIC const char *pulsar_client_configuration_get_listener_name(pulsar_c
PULSAR_PUBLIC void pulsar_client_configuration_set_partitions_update_interval(
pulsar_client_configuration_t *conf, const unsigned int intervalInSeconds);

PULSAR_PUBLIC const unsigned int pulsar_client_configuration_get_partitions_update_interval(
PULSAR_PUBLIC unsigned int pulsar_client_configuration_get_partitions_update_interval(
pulsar_client_configuration_t *conf);

/*
* Get the stats interval set in the client.
*/
PULSAR_PUBLIC const unsigned int pulsar_client_configuration_get_stats_interval_in_seconds(
PULSAR_PUBLIC unsigned int pulsar_client_configuration_get_stats_interval_in_seconds(
pulsar_client_configuration_t *conf);

PULSAR_PUBLIC void pulsar_client_configuration_set_keep_alive_interval_in_seconds(
Expand Down
2 changes: 1 addition & 1 deletion lib/BrokerConsumerStats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const std::string BrokerConsumerStats::getAddress() const { return impl_->getAdd

const std::string BrokerConsumerStats::getConnectedSince() const { return impl_->getConnectedSince(); }

const ConsumerType BrokerConsumerStats::getType() const { return impl_->getType(); }
ConsumerType BrokerConsumerStats::getType() const { return impl_->getType(); }

double BrokerConsumerStats::getMsgRateExpired() const { return impl_->getMsgRateExpired(); }

Expand Down
2 changes: 1 addition & 1 deletion lib/Message.cc
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ const std::string& Message::getTopicName() const {
return impl_->getTopicName();
}

const int Message::getRedeliveryCount() const {
int Message::getRedeliveryCount() const {
if (!impl_) {
return 0;
}
Expand Down
6 changes: 2 additions & 4 deletions lib/c/c_ClientConfiguration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ void pulsar_client_configuration_set_stats_interval_in_seconds(pulsar_client_con
conf->conf.setStatsIntervalInSeconds(interval);
}

const unsigned int pulsar_client_configuration_get_stats_interval_in_seconds(
pulsar_client_configuration_t *conf) {
unsigned int pulsar_client_configuration_get_stats_interval_in_seconds(pulsar_client_configuration_t *conf) {
return conf->conf.getStatsIntervalInSeconds();
}

Expand Down Expand Up @@ -204,8 +203,7 @@ void pulsar_client_configuration_set_partitions_update_interval(pulsar_client_co
conf->conf.setPartititionsUpdateInterval(intervalInSeconds);
}

const unsigned int pulsar_client_configuration_get_partitions_update_interval(
pulsar_client_configuration_t *conf) {
unsigned int pulsar_client_configuration_get_partitions_update_interval(pulsar_client_configuration_t *conf) {
return conf->conf.getPartitionsUpdateInterval();
}

Expand Down

0 comments on commit 8502aed

Please sign in to comment.