[gamin] Patch to fix gamin-0.1.10 IRIX/MIPSpro compiler quirk




Without modification, gamin-0.1.10 fails to build with errors such as:

cc-3316 cc: ERROR File = gam_connection.c, Line = 524
  The expression must be a pointer to a complete object type.

memmove(&conn->request, (void *)req + req->len, conn->request_len);
                                  ^

1 error detected in the compilation of "gam_connection.c".

... in a couple of files.

The attached patch fixes the problem - but probably needs a sanity-check to ensure that I've not inadvertently changed the sense of either problematic statement?

Cheers,

Stuart
--- ./server/gam_channel.c.dist	2009-02-05 10:17:12.212499400 +0000
+++ ./server/gam_channel.c	2009-02-05 10:33:57.965238760 +0000
@@ -825,6 +825,7 @@ gam_client_conn_write(GIOChannel * sourc
 {
     int written;
     int remaining;
+    int tmp;
 
     /**
      * Todo: check if write will block, or use non-blocking options
@@ -848,7 +849,8 @@ gam_client_conn_write(GIOChannel * sourc
 	    return (FALSE);
 	}
 
-	data += written;
+	tmp = (int)data + written;
+  data = (gpointer)tmp;
 	remaining -= written;
     } while (remaining > 0);
 
--- ./server/gam_connection.c.dist	2009-02-05 10:37:26.300740920 +0000
+++ ./server/gam_connection.c	2009-02-05 10:42:13.393285360 +0000
@@ -451,6 +451,7 @@ int
 gam_connection_data(GamConnDataPtr conn, int len)
 {
     GAMPacketPtr req;
+    GAMPacketPtr tmp;
 
     g_assert(conn);
     g_assert(len >= 0);
@@ -521,7 +522,8 @@ gam_connection_data(GamConnDataPtr conn,
 #if defined(__i386__) || defined(__x86_64__)
 	req = (void *) req + req->len;
 #else
-        memmove(&conn->request, (void *)req + req->len, conn->request_len);
+        tmp = req + req->len;
+        memmove(&conn->request, (void *)tmp, conn->request_len);
 #endif
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]