THRIFT-3288 c_glib: Build unit tests without compiler warnings

These changes allow the unit tests for C (GLib) to build without
compiler warnings, even with additional warnings enabled. They
include

- Disabling string-function optimizations when glibc is used, as
  these produce compiler warnings when a string function is used
  within a call to assert ();

- Remove the "LL" suffix (added in C99) from 64-bit integer
  literals;

- Replace C++-style ("//") comments with C-style equivalents;

- Remove unused constant declarations that generated warnings;
  and

- Mark (or remove, from main ()) unused function parameters.
diff --git a/lib/c_glib/test/testbinaryprotocol.c b/lib/c_glib/test/testbinaryprotocol.c
index c6de385..517fd25 100755
--- a/lib/c_glib/test/testbinaryprotocol.c
+++ b/lib/c_glib/test/testbinaryprotocol.c
@@ -17,6 +17,14 @@
  * under the License.
  */
 
+/* Disable string-function optimizations when glibc is used, as these produce
+   compiler warnings about string length when a string function is used inside
+   a call to assert () */
+#include <features.h>
+#ifdef __GLIBC__
+#define __NO_STRING_INLINES 1
+#endif
+
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -33,7 +41,7 @@
 #define TEST_BYTE 123
 #define TEST_I16 12345
 #define TEST_I32 1234567890
-#define TEST_I64 123456789012345LL
+#define TEST_I64 123456789012345
 #define TEST_DOUBLE 1234567890.123
 #define TEST_STRING "this is a test string 1234567890!@#$%^&*()"
 #define TEST_PORT 51199
@@ -654,7 +662,7 @@
   thrift_binary_protocol_read_string (protocol, &message_name, NULL);
 
   g_object_unref (client);
-  // TODO: investigate g_object_unref (tbp);
+  /* TODO: investigate g_object_unref (tbp); */
   g_object_unref (tsocket);
 }
 
diff --git a/lib/c_glib/test/testbufferedtransport.c b/lib/c_glib/test/testbufferedtransport.c
index e4bee69..3203a66 100755
--- a/lib/c_glib/test/testbufferedtransport.c
+++ b/lib/c_glib/test/testbufferedtransport.c
@@ -31,9 +31,6 @@
 
 #include "../src/thrift/c_glib/transport/thrift_buffered_transport.c"
 
-static const char TEST_ADDRESS[] = "localhost";
-static const short TEST_PORT = 64444;
-
 static void thrift_server (const int port);
 
 /* test object creation and destruction */
diff --git a/lib/c_glib/test/testframedtransport.c b/lib/c_glib/test/testframedtransport.c
index 7261ff5..d50ff23 100755
--- a/lib/c_glib/test/testframedtransport.c
+++ b/lib/c_glib/test/testframedtransport.c
@@ -30,9 +30,6 @@
 
 #include "../src/thrift/c_glib/transport/thrift_framed_transport.c"
 
-static const char TEST_ADDRESS[] = "localhost";
-static const short TEST_PORT = 64444;
-
 static void thrift_server (const int port);
 
 /* test object creation and destruction */
diff --git a/lib/c_glib/test/testoptionalrequired.c b/lib/c_glib/test/testoptionalrequired.c
index 931d8be..ae0c3d2 100755
--- a/lib/c_glib/test/testoptionalrequired.c
+++ b/lib/c_glib/test/testoptionalrequired.c
@@ -74,7 +74,7 @@
   s2 = g_object_new (T_TEST_TYPE_SIMPLE, NULL);
   s3 = g_object_new (T_TEST_TYPE_SIMPLE, NULL);
 
-  // write-to-read with optional fields
+  /* write-to-read with optional fields */
   s1->im_optional = 10;
   assert (s1->__isset_im_default == FALSE);
   assert (s1->__isset_im_optional == FALSE);  
@@ -174,7 +174,7 @@
   t2 = g_object_new (T_TEST_TYPE_TRICKY2, NULL);
   t3 = g_object_new (T_TEST_TYPE_TRICKY3, NULL);
 
-  // throws protocol exception
+  /* throws protocol exception */
   write_to_read (THRIFT_STRUCT (t2), THRIFT_STRUCT (t3), NULL, &read_error);
   assert (read_error != NULL);
   g_error_free (read_error);
diff --git a/lib/c_glib/test/testsimpleserver.c b/lib/c_glib/test/testsimpleserver.c
index cb270b4..3af2eeb 100755
--- a/lib/c_glib/test/testsimpleserver.c
+++ b/lib/c_glib/test/testsimpleserver.c
@@ -53,6 +53,11 @@
 test_processor_process (ThriftProcessor *processor, ThriftProtocol *in,
                         ThriftProtocol *out, GError **error)
 {
+  THRIFT_UNUSED_VAR (processor);
+  THRIFT_UNUSED_VAR (in);
+  THRIFT_UNUSED_VAR (out);
+  THRIFT_UNUSED_VAR (error);
+
   return FALSE;
 }
 
diff --git a/lib/c_glib/test/teststruct.c b/lib/c_glib/test/teststruct.c
index a1b3cc0..5d4baf3 100755
--- a/lib/c_glib/test/teststruct.c
+++ b/lib/c_glib/test/teststruct.c
@@ -51,6 +51,10 @@
 thrift_test_struct_read (ThriftStruct *object, ThriftProtocol *protocol,
                          GError **error)
 {
+  THRIFT_UNUSED_VAR (object);
+  THRIFT_UNUSED_VAR (protocol);
+  THRIFT_UNUSED_VAR (error);
+
   return 0;
 }
 
@@ -58,6 +62,10 @@
 thrift_test_struct_write (ThriftStruct *object, ThriftProtocol *protocol,
                           GError **error)
 {
+  THRIFT_UNUSED_VAR (object);
+  THRIFT_UNUSED_VAR (protocol);
+  THRIFT_UNUSED_VAR (error);
+
   return 0;
 }
 
diff --git a/lib/c_glib/test/testthrifttestclient.cpp b/lib/c_glib/test/testthrifttestclient.cpp
index a80ddf3..e1737cd 100755
--- a/lib/c_glib/test/testthrifttestclient.cpp
+++ b/lib/c_glib/test/testthrifttestclient.cpp
@@ -191,6 +191,8 @@
   }
 
   void testInsanity(map<UserId, map<Numberz::type,Insanity> > &insane, const Insanity &argument) {
+    THRIFT_UNUSED_VARIABLE (argument);
+
     printf("[C -> C++] testInsanity()\n");
 
     Xtruct hello;
@@ -260,6 +262,10 @@
   }
 
   void testMulti(Xtruct &hello, const int8_t arg0, const int32_t arg1, const int64_t arg2, const std::map<int16_t, std::string>  &arg3, const Numberz::type arg4, const UserId arg5) {
+    THRIFT_UNUSED_VARIABLE (arg3);
+    THRIFT_UNUSED_VARIABLE (arg4);
+    THRIFT_UNUSED_VARIABLE (arg5);
+
     printf("[C -> C++] testMulti()\n");
 
     hello.string_thing = "Hello2";
@@ -582,11 +588,13 @@
 static void
 bailout (int signum)
 {
+  THRIFT_UNUSED_VARIABLE (signum);
+
   exit (1);
 }
 
 int
-main (int argc, char **argv)
+main (void)
 {
   int status;
   int pid = fork ();
@@ -607,7 +615,7 @@
     sleep (1);
     test_thrift_client ();
     kill (pid, SIGINT);
-    wait (&status) == pid;
+    assert (wait (&status) == pid);
   }
 
   return 0;
diff --git a/lib/c_glib/test/testtransportsocket.c b/lib/c_glib/test/testtransportsocket.c
index bb1d47c..d91507f 100755
--- a/lib/c_glib/test/testtransportsocket.c
+++ b/lib/c_glib/test/testtransportsocket.c
@@ -70,9 +70,6 @@
 #undef recv
 #undef send
 
-static const char TEST_ADDRESS[] = "localhost";
-static const short TEST_PORT = 64444;
-
 static void thrift_socket_server (const int port);
 
 /* test object creation and destruction */