fix clang15 compiler error

This commit is contained in:
oscar 2023-04-03 19:32:33 -04:00
parent cccf603a43
commit 09f93b94ae
2 changed files with 5 additions and 4 deletions

View File

@ -51,6 +51,7 @@ static constexpr int CTRL_BACKLOG = 4096;
static constexpr int BSOCK_BUF_SZ = 4096; static constexpr int BSOCK_BUF_SZ = 4096;
static constexpr int THRD_INIT_PARALLEL = 2; static constexpr int THRD_INIT_PARALLEL = 2;
static constexpr int TIMER_MAGIC = 0x123456; static constexpr int TIMER_MAGIC = 0x123456;
static constexpr int DEFAULT_SERVER_PORT = 9898;
static constexpr int STATE_WAITING = 0; static constexpr int STATE_WAITING = 0;
static constexpr int STATE_RUN = 1; static constexpr int STATE_RUN = 1;
@ -127,6 +128,7 @@ struct dsmbr_options {
static struct dsmbr_options options = { .verbose = 0, static struct dsmbr_options options = { .verbose = 0,
.server_ip = "127.0.0.1", .server_ip = "127.0.0.1",
.server_port = DEFAULT_SERVER_PORT,
.conn_per_thread = 1, .conn_per_thread = 1,
.target_qps = 0, .target_qps = 0,
.depth = 1, .depth = 1,
@ -593,7 +595,7 @@ dsmbr_slave_accept_master(int slave_ctrl_sock)
static void static void
dsmbr_getopt(int argc, char *argv[]) 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) { while ((ch = getopt(argc, argv, "q:s:p:o:a:c:m:M:Svt:T:i:O:h")) != -1) {
switch (ch) { switch (ch) {
case 'q': { 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, V("Reqs: %lu Time: %lu us Send: %lu bytes Recv: %lu bytes\n", total_req, end_ts - start_ts, total_send, total_recv);
total_send, total_recv);
if (options.master_mode) { if (options.master_mode) {
V("M: waiting for slaves STAT...\n"); V("M: waiting for slaves STAT...\n");

View File

@ -699,7 +699,7 @@ main(int argc, char *argv[])
#ifdef FKQMULTI #ifdef FKQMULTI
char dbuf[1024 * 1024 + 1]; char dbuf[1024 * 1024 + 1];
#endif #endif
char ch; int ch;
while ((ch = getopt(argc, argv, "d:p:c:m:vhr:R:F:M:O:skS:C:")) != -1) { while ((ch = getopt(argc, argv, "d:p:c:m:vhr:R:F:M:O:skS:C:")) != -1) {
switch (ch) { switch (ch) {
case 'd': case 'd':