From 09f93b94ae891b68bf3b0f7b0bb59e6ed7928241 Mon Sep 17 00:00:00 2001 From: oscar Date: Mon, 3 Apr 2023 19:32:33 -0400 Subject: [PATCH] fix clang15 compiler error --- dsmbr/dsmbr.cc | 7 ++++--- ppd/ppd.cc | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dsmbr/dsmbr.cc b/dsmbr/dsmbr.cc index 8f2b31b..3aa7f69 100755 --- a/dsmbr/dsmbr.cc +++ b/dsmbr/dsmbr.cc @@ -51,6 +51,7 @@ static constexpr int CTRL_BACKLOG = 4096; static constexpr int BSOCK_BUF_SZ = 4096; static constexpr int THRD_INIT_PARALLEL = 2; static constexpr int TIMER_MAGIC = 0x123456; +static constexpr int DEFAULT_SERVER_PORT = 9898; static constexpr int STATE_WAITING = 0; static constexpr int STATE_RUN = 1; @@ -127,6 +128,7 @@ struct dsmbr_options { static struct dsmbr_options options = { .verbose = 0, .server_ip = "127.0.0.1", + .server_port = DEFAULT_SERVER_PORT, .conn_per_thread = 1, .target_qps = 0, .depth = 1, @@ -593,7 +595,7 @@ dsmbr_slave_accept_master(int slave_ctrl_sock) static void dsmbr_getopt(int argc, char *argv[]) { - char ch; + int ch; while ((ch = getopt(argc, argv, "q:s:p:o:a:c:m:M:Svt:T:i:O:h")) != -1) { switch (ch) { case 'q': { @@ -887,8 +889,7 @@ main(int argc, char *argv[]) } } - V("Reqs: %lu Time: %lu us Send: %lu bytes Recv: %lu bytes\n", total_req, end_ts - start_ts, - total_send, total_recv); + V("Reqs: %lu Time: %lu us Send: %lu bytes Recv: %lu bytes\n", total_req, end_ts - start_ts, total_send, total_recv); if (options.master_mode) { V("M: waiting for slaves STAT...\n"); diff --git a/ppd/ppd.cc b/ppd/ppd.cc index b4dde2f..4042d08 100755 --- a/ppd/ppd.cc +++ b/ppd/ppd.cc @@ -699,7 +699,7 @@ main(int argc, char *argv[]) #ifdef FKQMULTI char dbuf[1024 * 1024 + 1]; #endif - char ch; + int ch; while ((ch = getopt(argc, argv, "d:p:c:m:vhr:R:F:M:O:skS:C:")) != -1) { switch (ch) { case 'd':