/pidgin/main: d69aa7d3530c: Clang warnings: gnutls, gnome keyrin...

Tomasz Wasilczyk twasilczyk at pidgin.im
Fri Oct 4 06:58:23 EDT 2013


Changeset: d69aa7d3530c508878bb8eed709b7531faa12ce7
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2013-10-04 12:58 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/d69aa7d3530c

Description:

Clang warnings: gnutls, gnome keyring and G_GNUC_*_IGNORE_DEPRECATIONS

diffstat:

 configure.ac                              |   4 ++++
 libpurple/glibcompat.h                    |  13 +++++++++++++
 libpurple/plugins/keyrings/gnomekeyring.c |   4 ++--
 libpurple/plugins/ssl/ssl-gnutls.c        |   4 ++--
 4 files changed, 21 insertions(+), 4 deletions(-)

diffs (79 lines):

diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1490,6 +1490,10 @@ AC_SUBST(CFLAGS)
 
 AC_PATH_PROG(pidginpath, pidgin)
 
+if test "x$CC" = "xclang"; then
+	AC_DEFINE([HAVE_CLANG], [1], [Define to 1 if you compile with clang.])
+fi
+
 dnl #######################################################################
 dnl # Check for D-Bus libraries
 dnl #######################################################################
diff --git a/libpurple/glibcompat.h b/libpurple/glibcompat.h
--- a/libpurple/glibcompat.h
+++ b/libpurple/glibcompat.h
@@ -25,6 +25,19 @@
  * Also, any public API should not depend on this file.
  */
 
+#ifdef HAVE_CLANG
+
+#undef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
+	_Pragma ("clang diagnostic push") \
+	_Pragma ("clang diagnostic ignored \"-Wdeprecated-declarations\"")
+
+#undef G_GNUC_END_IGNORE_DEPRECATIONS
+#define G_GNUC_END_IGNORE_DEPRECATIONS \
+	_Pragma ("clang diagnostic pop")
+
+#endif /* HAVE_CLANG */
+
 #if !GLIB_CHECK_VERSION(2, 32, 0)
 
 #define G_GNUC_BEGIN_IGNORE_DEPRECATIONS
diff --git a/libpurple/plugins/keyrings/gnomekeyring.c b/libpurple/plugins/keyrings/gnomekeyring.c
--- a/libpurple/plugins/keyrings/gnomekeyring.c
+++ b/libpurple/plugins/keyrings/gnomekeyring.c
@@ -107,7 +107,7 @@ gnomekeyring_read_cb(GnomeKeyringResult 
 			_("Access denied."));
 		gnomekeyring_cancel_queue();
 	} else if (result == GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON ||
-		GNOME_KEYRING_RESULT_IO_ERROR) {
+		result == GNOME_KEYRING_RESULT_IO_ERROR) {
 		error = g_error_new(PURPLE_KEYRING_ERROR,
 			PURPLE_KEYRING_ERROR_BACKENDFAIL,
 			_("Communication with GNOME Keyring failed."));
@@ -180,7 +180,7 @@ gnomekeyring_save_cb(GnomeKeyringResult 
 			_("Access denied."));
 		gnomekeyring_cancel_queue();
 	} else if (result == GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON ||
-		GNOME_KEYRING_RESULT_IO_ERROR) {
+		result == GNOME_KEYRING_RESULT_IO_ERROR) {
 		error = g_error_new(PURPLE_KEYRING_ERROR,
 			PURPLE_KEYRING_ERROR_BACKENDFAIL,
 			_("Communication with GNOME Keyring failed."));
diff --git a/libpurple/plugins/ssl/ssl-gnutls.c b/libpurple/plugins/ssl/ssl-gnutls.c
--- a/libpurple/plugins/ssl/ssl-gnutls.c
+++ b/libpurple/plugins/ssl/ssl-gnutls.c
@@ -309,7 +309,7 @@ static void ssl_gnutls_handshake_cb(gpoi
 				gnutls_x509_crt_import (cert, &cert_list[i],
 						GNUTLS_X509_FMT_DER);
 
-				gnutls_x509_crt_get_fingerprint(cert, GNUTLS_MAC_SHA,
+				gnutls_x509_crt_get_fingerprint(cert, GNUTLS_DIG_SHA,
 						fpr_bin, &fpr_bin_sz);
 
 				fpr_asc =
@@ -977,7 +977,7 @@ x509_sha1sum(PurpleCertificate *crt)
 
 	/* Extract the fingerprint */
 	g_return_val_if_fail(
-		0 == gnutls_x509_crt_get_fingerprint(crt_dat, GNUTLS_MAC_SHA,
+		0 == gnutls_x509_crt_get_fingerprint(crt_dat, GNUTLS_DIG_SHA,
 						     hashbuf, &tmpsz),
 		NULL);
 



More information about the Commits mailing list