Skip to content

Commit 104ed9f

Browse files
Fixed deprecated and casting build errors caught on recent compilers (#248)
* Specifying the C++ standard version to avoid deprecation/failures on build in case of new standard usage * Fixed deprecated and casting build errors * Removed spurious change * Update memtier_benchmark.cpp Co-authored-by: Yossi Gottlieb <[email protected]> --------- Co-authored-by: Yossi Gottlieb <[email protected]>
1 parent 20c013d commit 104ed9f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

memtier_benchmark.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1675,7 +1675,7 @@ int main(int argc, char *argv[])
16751675
run_stats average(&cfg);
16761676
average.aggregate_average(all_stats);
16771677
char average_header[50];
1678-
sprintf(average_header,"AGGREGATED AVERAGE RESULTS (%u runs)", cfg.run_count);
1678+
snprintf(average_header, sizeof(average_header) , "AGGREGATED AVERAGE RESULTS (%u runs)", cfg.run_count);
16791679
average.print(outfile, &cfg, average_header, jsonhandler);
16801680
} else {
16811681
all_stats.begin()->print(outfile, &cfg, "ALL STATS", jsonhandler);

shard_connection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ void shard_connection::handle_event(short events)
548548
if (!m_conns_manager->get_reqs_processed()) {
549549
/* Set timer for request rate */
550550
if (m_config->request_rate) {
551-
struct timeval interval = { 0, (long int)m_config->request_interval_microsecond };
551+
struct timeval interval = { 0, (int)m_config->request_interval_microsecond };
552552
m_request_per_cur_interval = m_config->request_per_interval;
553553
m_event_timer = event_new(m_event_base, -1, EV_PERSIST, cluster_client_timer_handler, (void *)this);
554554
event_add(m_event_timer, &interval);

0 commit comments

Comments
 (0)