You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2020/03/22 12:23:07 UTC

[thrift] branch master updated: Fix some compile warnings Client: c_glib Patch: zeshuai007 <51382517@qq.com>

This is an automated email from the ASF dual-hosted git repository.

jensg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git


The following commit(s) were added to refs/heads/master by this push:
     new 655f525  Fix some compile warnings Client: c_glib Patch: zeshuai007 <51...@qq.com>
655f525 is described below

commit 655f52590d23443a432a3326cbb64ca93cb4b90a
Author: zeshuai007 <51...@qq.com>
AuthorDate: Sat Mar 21 10:52:03 2020 +0800

    Fix some compile warnings
    Client: c_glib
    Patch: zeshuai007 <51...@qq.com>
    
    This closes #2063
---
 .../thrift/c_glib/processor/thrift_multiplexed_processor.c   |  4 ++--
 lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.c   | 12 ++++++++----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/lib/c_glib/src/thrift/c_glib/processor/thrift_multiplexed_processor.c b/lib/c_glib/src/thrift/c_glib/processor/thrift_multiplexed_processor.c
index 68a0f4d..12a24a7 100644
--- a/lib/c_glib/src/thrift/c_glib/processor/thrift_multiplexed_processor.c
+++ b/lib/c_glib/src/thrift/c_glib/processor/thrift_multiplexed_processor.c
@@ -41,6 +41,8 @@ static GParamSpec *thrift_multiplexed_processor_obj_properties[PROP_THRIFT_MULTI
 static gboolean
 thrift_multiplexed_processor_register_processor_impl(ThriftProcessor *processor, const gchar * multiplexed_processor_name, ThriftProcessor * multiplexed_processor , GError **error)
 {
+  THRIFT_UNUSED_VAR (error);
+
   ThriftMultiplexedProcessor *self = THRIFT_MULTIPLEXED_PROCESSOR(processor);
   g_hash_table_replace(self->multiplexed_services,
 		       g_strdup(multiplexed_processor_name),
@@ -336,11 +338,9 @@ thrift_multiplexed_processor_init (ThriftMultiplexedProcessor *self)
   self->default_processor_name = NULL;
 }
 
-
 gboolean
 thrift_multiplexed_processor_register_processor(ThriftProcessor *processor, const gchar * multiplexed_processor_name, ThriftProcessor * multiplexed_processor , GError **error)
 {
   return THRIFT_MULTIPLEXED_PROCESSOR_GET_CLASS(processor)->register_processor(processor, multiplexed_processor_name, multiplexed_processor, error);
 }
 
-
diff --git a/lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.c b/lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.c
index 216da44..dcb2f86 100644
--- a/lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.c
+++ b/lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.c
@@ -80,7 +80,11 @@ static unsigned long thrift_ssl_socket_static_id_function(void)
 #endif
 }
 
-static void thrift_ssl_socket_static_locking_callback(int mode, int n, const char* unk, int id) {
+static void thrift_ssl_socket_static_locking_callback(int mode, int n, const char* unk, int id) 
+{
+  THRIFT_UNUSED_VAR (unk);
+  THRIFT_UNUSED_VAR (id);
+
   if (mode & CRYPTO_LOCK)
     MUTEX_LOCK(thrift_ssl_socket_global_mutex_buf[n]);
   else
@@ -175,15 +179,15 @@ void thrift_ssl_socket_get_ssl_error(ThriftSSLSocket *socket, const guchar *erro
 	  break;
 	case SSL_ERROR_SYSCALL:
 	  buffer_size-=snprintf(buffer, buffer_size, "%s: ", error_msg);
-	  buffer_size-=snprintf(buffer+(1024-buffer_size), buffer_size, "%lX -> %s", errno, strerror(errno));
+	  buffer_size-=snprintf(buffer+(1024-buffer_size), buffer_size, "%X -> %s", errno, strerror(errno));
 	  break;
 	case SSL_ERROR_WANT_READ:
 	  buffer_size-=snprintf(buffer, buffer_size, "%s: ", error_msg);
-	  buffer_size-=snprintf(buffer+(1024-buffer_size), buffer_size, "%lX -> %s", ssl_error_type, "Error while reading from underlaying layer");
+	  buffer_size-=snprintf(buffer+(1024-buffer_size), buffer_size, "%X -> %s", ssl_error_type, "Error while reading from underlaying layer");
 	  break;
 	case SSL_ERROR_WANT_WRITE:
 	  buffer_size-=snprintf(buffer, buffer_size, "%s: ", error_msg);
-	  buffer_size-=snprintf(buffer+(1024-buffer_size), buffer_size, "%lX -> %s", ssl_error_type, "Error while writting to underlaying layer");
+	  buffer_size-=snprintf(buffer+(1024-buffer_size), buffer_size, "%X -> %s", ssl_error_type, "Error while writting to underlaying layer");
 	  break;
 
       }