Skip to content

Commit

Permalink
Fix some compile warnings
Browse files Browse the repository at this point in the history
Client: c_glib
Patch: zeshuai007 <51382517@qq.com>

This closes apache#2063
  • Loading branch information
zeshuai007 authored and Jens-G committed Mar 22, 2020
1 parent 4b66a9d commit 655f525
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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);
}


12 changes: 8 additions & 4 deletions lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;

}
Expand Down

0 comments on commit 655f525

Please sign in to comment.