1From 3d091efa09478d0330be686184ae4793764504e7 Mon Sep 17 00:00:00 2001 2From: Khem Raj <raj.khem@gmail.com> 3Date: Tue, 11 Apr 2017 14:22:23 -0700 4Subject: [PATCH 2/2] replace non-standard uint with unsigned int 5 6make it portable on musl 7 8Signed-off-by: Khem Raj <raj.khem@gmail.com> 9--- 10 demos/benchmark/client_tipc.c | 34 +++++++++++++++++----------------- 11 demos/benchmark/common_tipc.h | 2 +- 12 demos/benchmark/server_tipc.c | 10 +++++----- 13 demos/inventory_sim/inventory_sim.c | 12 ++++++------ 14 4 files changed, 29 insertions(+), 29 deletions(-) 15 16diff --git a/demos/benchmark/client_tipc.c b/demos/benchmark/client_tipc.c 17index 5d889ee..d913e42 100644 18--- a/demos/benchmark/client_tipc.c 19+++ b/demos/benchmark/client_tipc.c 20@@ -65,7 +65,7 @@ static const struct sockaddr_tipc master_clnt_addr = { 21 22 static int master_clnt_sd; 23 static int master_srv_sd; 24-static uint client_id; 25+static unsigned int client_id; 26 static unsigned char *buf = NULL; 27 static int non_blk = 0; 28 static int select_ip(struct srv_info *sinfo, char *name); 29@@ -79,7 +79,7 @@ struct master_client_cmd { 30 __u32 bounce; 31 }; 32 33-static void master_to_client(uint cmd, uint msglen, uint msgcnt, uint bounce) 34+static void master_to_client(unsigned int cmd, unsigned int msglen, unsigned int msgcnt, unsigned int bounce) 35 { 36 struct master_client_cmd c; 37 38@@ -93,7 +93,7 @@ static void master_to_client(uint cmd, uint msglen, uint msgcnt, uint bounce) 39 die("Unable to send cmd %u to clients\n", cmd); 40 } 41 42-static void client_from_master(uint *cmd, uint *msglen, uint *msgcnt, uint *bounce) 43+static void client_from_master(unsigned int *cmd, unsigned int *msglen, unsigned int *msgcnt, unsigned int *bounce) 44 { 45 struct master_client_cmd c; 46 47@@ -114,7 +114,7 @@ struct client_master_cmd { 48 __u32 cmd; 49 }; 50 51-static void client_to_master(uint cmd) 52+static void client_to_master(unsigned int cmd) 53 { 54 struct client_master_cmd c; 55 56@@ -125,7 +125,7 @@ static void client_to_master(uint cmd) 57 die("Client: Unable to send msg to master\n"); 58 } 59 60-static void master_from_client(uint *cmd) 61+static void master_from_client(unsigned int *cmd) 62 { 63 struct client_master_cmd c; 64 65@@ -137,7 +137,7 @@ static void master_from_client(uint *cmd) 66 *cmd = ntohl(c.cmd); 67 } 68 69-static void master_to_srv(uint cmd, uint msglen, uint msgcnt, uint echo) 70+static void master_to_srv(unsigned int cmd, unsigned int msglen, unsigned int msgcnt, unsigned int echo) 71 { 72 struct master_srv_cmd c; 73 74@@ -151,7 +151,7 @@ static void master_to_srv(uint cmd, uint msglen, uint msgcnt, uint echo) 75 die("Unable to send cmd %u to servers\n", cmd); 76 } 77 78-static void master_from_srv(uint *cmd, struct srv_info *sinfo, __u32 *tipc_addr) 79+static void master_from_srv(unsigned int *cmd, struct srv_info *sinfo, __u32 *tipc_addr) 80 { 81 struct srv_to_master_cmd c; 82 83@@ -290,7 +290,7 @@ static void client_main(unsigned int clnt_id, ushort tcp_port, int tcp_addr) 84 { 85 int peer_sd, efd = 0; 86 int imp = clnt_id % 4; 87- uint cmd, msglen, msgcnt, echo; 88+ unsigned int cmd, msglen, msgcnt, echo; 89 struct epoll_event event, revents; 90 struct sockaddr_in tcp_dest; 91 int rc; 92@@ -400,22 +400,22 @@ static void client_main(unsigned int clnt_id, ushort tcp_port, int tcp_addr) 93 int main(int argc, char *argv[], char *dummy[]) 94 { 95 int c; 96- uint cmd; 97- uint latency_transf = DEFAULT_LAT_MSGS; 98- uint thruput_transf = DEFAULT_THRU_MSGS; 99- uint req_clients = DEFAULT_CLIENTS; 100- uint first_msglen = DEFAULT_MSGLEN; 101- uint last_msglen = TIPC_MAX_USER_MSG_SIZE; 102+ unsigned int cmd; 103+ unsigned int latency_transf = DEFAULT_LAT_MSGS; 104+ unsigned int thruput_transf = DEFAULT_THRU_MSGS; 105+ unsigned int req_clients = DEFAULT_CLIENTS; 106+ unsigned int first_msglen = DEFAULT_MSGLEN; 107+ unsigned int last_msglen = TIPC_MAX_USER_MSG_SIZE; 108 unsigned long long msglen; 109 unsigned long long num_clients; 110 struct timeval start_time; 111 unsigned long long elapsed; 112 unsigned long long msgcnt; 113 unsigned long long iter; 114- uint clnt_id; 115- uint conn_typ = TIPC_CONN; 116+ unsigned int clnt_id; 117+ unsigned int conn_typ = TIPC_CONN; 118 ushort tcp_port = 0; 119- uint tcp_addr = 0; 120+ unsigned int tcp_addr = 0; 121 struct srv_info sinfo; 122 __u32 peer_tipc_addr; 123 char ifname[16] = {0,}; 124diff --git a/demos/benchmark/common_tipc.h b/demos/benchmark/common_tipc.h 125index 1765ba1..47947e0 100644 126--- a/demos/benchmark/common_tipc.h 127+++ b/demos/benchmark/common_tipc.h 128@@ -256,7 +256,7 @@ static void get_ip_list(struct srv_info *sinfo, char *ifname) 129 } 130 } 131 132-static uint own_node(void) 133+static unsigned int own_node(void) 134 { 135 struct sockaddr_tipc addr; 136 socklen_t sz = sizeof(addr); 137diff --git a/demos/benchmark/server_tipc.c b/demos/benchmark/server_tipc.c 138index 9d0e2be..3cd82b7 100644 139--- a/demos/benchmark/server_tipc.c 140+++ b/demos/benchmark/server_tipc.c 141@@ -45,7 +45,7 @@ static int wait_for_connection(int listener_sd); 142 static void echo_messages(int peer_sd, int master_sd, int srv_id); 143 static __u32 own_node_addr; 144 145-static void srv_to_master(uint cmd, struct srv_info *sinfo) 146+static void srv_to_master(unsigned int cmd, struct srv_info *sinfo) 147 { 148 struct srv_to_master_cmd c; 149 150@@ -62,7 +62,7 @@ static void srv_to_master(uint cmd, struct srv_info *sinfo) 151 die("Server: unable to send info to master\n"); 152 } 153 154-static void srv_from_master(uint *cmd, uint* msglen, uint *msgcnt, uint *echo) 155+static void srv_from_master(unsigned int *cmd, unsigned int* msglen, unsigned int *msgcnt, unsigned int *echo) 156 { 157 struct master_srv_cmd c; 158 159@@ -84,8 +84,8 @@ int main(int argc, char *argv[], char *dummy[]) 160 { 161 ushort tcp_port = 4711; 162 struct srv_info sinfo; 163- uint cmd; 164- uint max_msglen; 165+ unsigned int cmd; 166+ unsigned int max_msglen; 167 struct sockaddr_in srv_addr; 168 int lstn_sd, peer_sd; 169 int srv_id = 0, srv_cnt = 0;; 170@@ -221,7 +221,7 @@ static int wait_for_connection(int lstn_sd) 171 172 static void echo_messages(int peer_sd, int master_sd, int srv_id) 173 { 174- uint cmd, msglen, msgcnt, echo, rcvd = 0; 175+ unsigned int cmd, msglen, msgcnt, echo, rcvd = 0; 176 177 do { 178 /* Get msg length and number to expect, and ack: */ 179diff --git a/demos/inventory_sim/inventory_sim.c b/demos/inventory_sim/inventory_sim.c 180index 22c33d1..9bf5443 100644 181--- a/demos/inventory_sim/inventory_sim.c 182+++ b/demos/inventory_sim/inventory_sim.c 183@@ -940,9 +940,9 @@ int simItem(int itemID, int lagTime, int speed) 184 char outMsg[MSG_SIZE_MAX]; 185 char *marker; 186 int msgSize; 187- uint zone; 188- uint cluster; 189- uint node; 190+ unsigned int zone; 191+ unsigned int cluster; 192+ unsigned int node; 193 char itemName[NAME_SIZE]; 194 int haveItem; 195 int res; 196@@ -1134,9 +1134,9 @@ int simCust(int itemID, int lagTime, int waitTime, int speed, int taskID) 197 char msg[MSG_SIZE_MAX]; 198 char *marker; 199 int msgSize; 200- uint zone; 201- uint cluster; 202- uint node; 203+ unsigned int zone; 204+ unsigned int cluster; 205+ unsigned int node; 206 char custName[NAME_SIZE]; 207 int transactionID; 208 int needItem; 209-- 2102.12.2 211 212