summaryrefslogtreecommitdiff
path: root/src/tools/oping
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2016-10-21 15:28:24 +0200
committerdimitri staessens <[email protected]>2016-10-21 15:28:24 +0200
commitd5a52f3951fff7ee272bd0d4cd95cd122d07fa64 (patch)
treed32f6d89550a7b8606c78c241b73b23a39ae8bed /src/tools/oping
parent482c44232d4deda3f89a7d85fbad99c1c64e80ec (diff)
downloadouroboros-d5a52f3951fff7ee272bd0d4cd95cd122d07fa64.tar.gz
ouroboros-d5a52f3951fff7ee272bd0d4cd95cd122d07fa64.zip
build: Comply with -Wextra compiler flag
This reduces the risk for some bugs, for instance due to signed/unsigned mismatches and unused variables.
Diffstat (limited to 'src/tools/oping')
-rw-r--r--src/tools/oping/oping_client.c7
-rw-r--r--src/tools/oping/oping_server.c9
2 files changed, 15 insertions, 1 deletions
diff --git a/src/tools/oping/oping_client.c b/src/tools/oping/oping_client.c
index 40f75785..c2471b46 100644
--- a/src/tools/oping/oping_client.c
+++ b/src/tools/oping/oping_client.c
@@ -39,6 +39,9 @@
void shutdown_client(int signo, siginfo_t * info, void * c)
{
+ (void) info;
+ (void) c;
+
switch(signo) {
case SIGINT:
case SIGTERM:
@@ -65,6 +68,8 @@ void * reader(void * o)
if (fq == NULL)
return (void *) 1;
+ (void) o;
+
/* FIXME: use flow timeout option once we have it */
while (client.rcvd != client.count
&& flow_event_wait(client.flows, fq, &timeout) != -ETIMEDOUT) {
@@ -78,7 +83,7 @@ void * reader(void * o)
continue;
}
- if (ntohl(msg->id) >= client.count) {
+ if ((int) ntohl(msg->id) >= client.count) {
printf("Invalid id.\n");
continue;
}
diff --git a/src/tools/oping/oping_server.c b/src/tools/oping/oping_server.c
index 8a5a3512..8680b11b 100644
--- a/src/tools/oping/oping_server.c
+++ b/src/tools/oping/oping_server.c
@@ -31,6 +31,9 @@
void shutdown_server(int signo, siginfo_t * info, void * c)
{
+ (void) info;
+ (void) c;
+
switch(signo) {
case SIGINT:
case SIGTERM:
@@ -47,6 +50,8 @@ void * cleaner_thread(void * o)
struct timespec now = {0, 0};
int deadline_ms = 10000;
+ (void) o;
+
while (true) {
clock_gettime(CLOCK_REALTIME, &now);
pthread_mutex_lock(&server.lock);
@@ -74,6 +79,8 @@ void * server_thread(void *o)
if (fq == NULL)
return (void *) 1;
+ (void) o;
+
while (true) {
int ret = flow_event_wait(server.flows, fq, &timeout);
if (ret == -ETIMEDOUT)
@@ -117,6 +124,8 @@ void * accept_thread(void * o)
int fd = 0;
struct timespec now = {0, 0};
+ (void) o;
+
printf("Ouroboros ping server started.\n");
while (true) {