[gnio: 1/7] Cast to int for format



commit 557b77aaf438b4ae93b47a5b6c14cf38f98ec6bc
Author: Brian Lavender <brian brie com>
Date:   Tue Mar 10 16:03:08 2009 -0700

    Cast to int for format
---
 examples/client.c |    8 ++++----
 gio/gtls.c        |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/examples/client.c b/examples/client.c
index 88dea8a..158a34f 100644
--- a/examples/client.c
+++ b/examples/client.c
@@ -25,14 +25,14 @@ ready (GObject *obj,
 
   bytes = g_input_stream_read (input, buffer, sizeof buffer, NULL, NULL);
   buffer[bytes] = '\0';
-  g_print ("%d bytes read: %s\n", bytes, buffer);
+  g_print ("%d bytes read: %s\n", (int)bytes, buffer);
 
 
   g_output_stream_write (output, "a starttls\n", 11, NULL, NULL);
 
   bytes = g_input_stream_read (input, buffer, sizeof buffer, NULL, NULL);
   buffer[bytes] = '\0';
-  g_print ("%d bytes read: %s\n", bytes, buffer);
+  g_print ("%d bytes read: %s\n", (int)bytes, buffer);
 
   sess = g_object_new (G_TYPE_TLS_SESSION, "base-stream", connection, NULL);
   tcon = g_tls_session_handshake (sess, NULL, &error);
@@ -49,7 +49,7 @@ ready (GObject *obj,
   bytes = g_input_stream_read (input, buffer, sizeof buffer, NULL, NULL);
 
   buffer[bytes] = '\0';
-  g_print ("%d bytes read: %s\n", bytes, buffer);
+  g_print ("%d bytes read: %s\n", (int)bytes, buffer);
 }
 
 int
@@ -82,7 +82,7 @@ main (void)
                                    sizeof buffer,
                                    NULL, NULL);
 
-      g_print ("%d bytes read\n", bytes);
+      g_print ("%d bytes read\n",(int) bytes);
     }
 }
 
diff --git a/gio/gtls.c b/gio/gtls.c
index ba16f74..d8ff2a3 100644
--- a/gio/gtls.c
+++ b/gio/gtls.c
@@ -157,7 +157,7 @@ g_tls_set_error (GError **error,
                  gssize   result)
 {
   if (result < 0)
-    g_set_error (error, 0, 0, "got error code %d", result);
+    g_set_error (error, 0, 0, "got error code %d", (int) result);
 
   return result < 0;
 }



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