From 5f2f359bd6e1c667893e1ad1fe2841467907be5a Mon Sep 17 00:00:00 2001
From: EC2 Default User <ec2-user@ip-172-31-14-148.eu-west-1.compute.internal>
Date: Tue, 7 Jan 2014 14:53:48 +0000
Subject: [PATCH] Squashed warning under gcc 4.6.3

---
 mongoose.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/mongoose.c b/mongoose.c
index 936015754..c90f551cf 100644
--- a/mongoose.c
+++ b/mongoose.c
@@ -3397,13 +3397,12 @@ static void transfer_file_data(struct connection *conn) {
 static void execute_iteration(struct mg_server *server) {
   struct ll *lp, *tmp;
   struct connection *conn;
-  void *msg[2];
+  union { void (*f)(struct mg_connection *, void *); void *p; } msg[2];
 
   recv(server->ctl[1], (void *) msg, sizeof(msg), 0);
   LINKED_LIST_FOREACH(&server->active_connections, lp, tmp) {
     conn = LINKED_LIST_ENTRY(lp, struct connection, link);
-    ((void (*)(struct mg_connection *, void *)) msg[0])
-     ((struct mg_connection *) conn, msg[1]);
+    msg[0].f(&conn->mg_conn, msg[1].p);
   }
 }
 
@@ -3516,7 +3515,9 @@ void mg_iterate_over_connections(struct mg_server *server,
                                  void (*func)(struct mg_connection *, void *),
                                  void *param) {
   // Send closure (function + parameter) to the IO thread to execute
-  void *msg[2] = { (void *) func, param };
+  union { void (*f)(struct mg_connection *, void *); void *p; } msg[2];
+  msg[0].f = func;
+  msg[1].p = param;
   send(server->ctl[0], (void *) msg, sizeof(msg), 0);
 }
 
-- 
GitLab