File pidgin-sipe-no-deprecated.patch of Package pidgin-sipe

Patch is based on this commit:

From 7f339a653af14431afcac5a4435967ec24970616 Mon Sep 17 00:00:00 2001
From: Stefan Becker <chemobejk@gmail.com>
Date: Mon, 9 Jan 2012 11:20:22 +0200
Subject: [PATCH] build: replace deprecated glib2 functions

In glib2 2.31 the following functions

    g_strcasecmp()
    g_strncasecmp()

are marked with the GCC attribute "deprecated". In the upcoming GCC
4.7.0 -Wdeprecated-declarations is enabled by default and therefore the
build fails, e.g. for Fedora 17.

Replaced all occurences with g_ascii_str(n)casecmp().
Added -Wdeprecated-declarations to the list of quality check flags.

Index: pidgin-sipe-1.12.0/src/core/sip-transport.c
===================================================================
--- pidgin-sipe-1.12.0.orig/src/core/sip-transport.c
+++ pidgin-sipe-1.12.0/src/core/sip-transport.c
@@ -308,12 +308,12 @@ static void fill_auth(const gchar *hdr,
 		return;
 	}
 
-	if (!g_strncasecmp(hdr, "NTLM", 4)) {
+	if (!g_ascii_strncasecmp(hdr, "NTLM", 4)) {
 		SIPE_DEBUG_INFO_NOFORMAT("fill_auth: type NTLM");
 		auth->type = AUTH_TYPE_NTLM;
 		hdr += 5;
 		auth->nc = 1;
-	} else	if (!g_strncasecmp(hdr, "Kerberos", 8)) {
+	} else	if (!g_ascii_strncasecmp(hdr, "Kerberos", 8)) {
 		SIPE_DEBUG_INFO_NOFORMAT("fill_auth: type Kerberos");
 		auth->type = AUTH_TYPE_KERBEROS;
 		hdr += 9;
@@ -566,7 +566,7 @@ static struct transaction *transactions_
 	key = g_strdup_printf("<%s><%s>", call_id, cseq);
 	while (transactions) {
 		struct transaction *trans = transactions->data;
-		if (!g_strcasecmp(trans->key, key)) {
+		if (!g_ascii_strcasecmp(trans->key, key)) {
 			g_free(key);
 			return trans;
 		}
@@ -1113,7 +1113,7 @@ static gboolean process_register_respons
 			{
 				gchar *redirect = parse_from(sipmsg_find_header(msg, "Contact"));
 
-				if (redirect && (g_strncasecmp("sip:", redirect, 4) == 0)) {
+				if (redirect && (g_ascii_strncasecmp("sip:", redirect, 4) == 0)) {
 					gchar **parts = g_strsplit(redirect + 4, ";", 0);
 					gchar **tmp;
 					gchar *hostname;
@@ -1129,8 +1129,8 @@ static gboolean process_register_respons
 					while (parts[i]) {
 						tmp = g_strsplit(parts[i], "=", 0);
 						if (tmp[1]) {
-							if (g_strcasecmp("transport", tmp[0]) == 0) {
-								if (g_strcasecmp("tcp", tmp[1]) == 0) {
+							if (g_ascii_strcasecmp("transport", tmp[0]) == 0) {
+								if (g_ascii_strcasecmp("tcp", tmp[1]) == 0) {
 									transport = SIPE_TRANSPORT_TCP;
 								}
 							}
Index: pidgin-sipe-1.12.0/src/core/sipe-chat.c
===================================================================
--- pidgin-sipe-1.12.0.orig/src/core/sipe-chat.c
+++ pidgin-sipe-1.12.0/src/core/sipe-chat.c
@@ -419,10 +419,10 @@ process_info_response(struct sipe_core_p
 				return FALSE;
 			}
 
-			if (allow && !g_strcasecmp(allow, "true")) {
+			if (allow && !g_ascii_strcasecmp(allow, "true")) {
 				SIPE_DEBUG_INFO("process_info_response: %s has voted PRO", with);
 				dialog->election_vote = 1;
-			} else if (allow && !g_strcasecmp(allow, "false")) {
+			} else if (allow && !g_ascii_strcasecmp(allow, "false")) {
 				SIPE_DEBUG_INFO("process_info_response: %s has voted CONTRA", with);
 				dialog->election_vote = -1;
 			}
Index: pidgin-sipe-1.12.0/src/core/sipe-conf.c
===================================================================
--- pidgin-sipe-1.12.0.orig/src/core/sipe-conf.c
+++ pidgin-sipe-1.12.0/src/core/sipe-conf.c
@@ -1033,7 +1033,7 @@ sipe_process_conference(struct sipe_core
 					if (!sipe_backend_chat_find(session->chat_session->backend, user_uri)) {
 						sipe_backend_chat_add(session->chat_session->backend,
 								      user_uri,
-								      !just_joined && g_strcasecmp(user_uri, self));
+								      !just_joined && g_ascii_strcasecmp(user_uri, self));
 					}
 					if (is_operator) {
 						sipe_backend_chat_operator(session->chat_session->backend,
Index: pidgin-sipe-1.12.0/src/core/sipe-incoming.c
===================================================================
--- pidgin-sipe-1.12.0.orig/src/core/sipe-incoming.c
+++ pidgin-sipe-1.12.0/src/core/sipe-incoming.c
@@ -94,7 +94,7 @@ void process_incoming_bye(struct sipe_co
 	if (session->chat_session &&
 	    (session->chat_session->type == SIPE_CHAT_TYPE_MULTIPARTY) &&
 	    session->chat_session->id &&
-	    !g_strcasecmp(from, session->chat_session->id))
+	    !g_ascii_strcasecmp(from, session->chat_session->id))
 		sipe_chat_set_roster_manager(session, NULL);
 
 	sipe_im_cancel_unconfirmed(sipe_private, session, callid, from);
@@ -104,7 +104,7 @@ void process_incoming_bye(struct sipe_co
 	sipe_dialog_free(dialog);
 	if (session->chat_session) {
 		if ((session->chat_session->type == SIPE_CHAT_TYPE_CONFERENCE) &&
-		    !g_strcasecmp(from, session->im_mcu_uri)) {
+		    !g_ascii_strcasecmp(from, session->im_mcu_uri)) {
 			SIPE_DEBUG_INFO("process_incoming_bye: disconnected from conference %s",
 					session->im_mcu_uri);
 			sipe_conf_immcu_closed(sipe_private, session);
@@ -417,7 +417,7 @@ void process_incoming_invite(struct sipe
 			is_multiparty = TRUE;
 		}
 	}
-	if (trig_invite && !g_strcasecmp(trig_invite, "TRUE")) {
+	if (trig_invite && !g_ascii_strcasecmp(trig_invite, "TRUE")) {
 		is_multiparty = TRUE;
 	}
 
@@ -479,8 +479,8 @@ void process_incoming_invite(struct sipe
 			struct sipendpoint *end_point = entry->data;
 			entry = entry->next;
 
-			if (!g_strcasecmp(from, end_point->contact) ||
-			    !g_strcasecmp(to,   end_point->contact))
+			if (!g_ascii_strcasecmp(from, end_point->contact) ||
+			    !g_ascii_strcasecmp(to,   end_point->contact))
 				continue;
 
 			dialog = sipe_dialog_find(session, end_point->contact);
Index: pidgin-sipe-1.12.0/src/core/sipmsg.c
===================================================================
--- pidgin-sipe-1.12.0.orig/src/core/sipmsg.c
+++ pidgin-sipe-1.12.0/src/core/sipmsg.c
@@ -237,7 +237,7 @@ void sipmsg_strip_headers(struct sipmsg
 
 		elem = entry->data;
 		while (keepers[i]) {
-			if (!g_strcasecmp(elem->name, keepers[i])) {
+			if (!g_ascii_strcasecmp(elem->name, keepers[i])) {
 				keeper = TRUE;
 				break;
 			}
@@ -450,7 +450,7 @@ gchar *sipmsg_find_auth_header(struct si
 		if (elem && elem->name &&
 		    (sipe_strcase_equal(elem->name,"WWW-Authenticate") ||
 		     sipe_strcase_equal(elem->name,"Authentication-Info")) ) {
-			if (!g_strncasecmp((gchar *)elem->value, name, name_len)) {
+			if (!g_ascii_strncasecmp((gchar *)elem->value, name, name_len)) {
 				/* SIPE_DEBUG_INFO("elem->value: %s", elem->value); */
 				return elem->value;
 			}
Index: pidgin-sipe-1.12.0/src/core/sipe.c
===================================================================
--- pidgin-sipe-1.12.0.orig/src/core/sipe.c
+++ pidgin-sipe-1.12.0/src/core/sipe.c
@@ -5171,7 +5171,7 @@ static gboolean process_search_contact_r
 
 	if ((mrow = sipe_xml_child(searchResults, "Body/directorySearch/moreAvailable")) != NULL) {
 		char *data = sipe_xml_data(mrow);
-		more = (g_strcasecmp(data, "true") == 0);
+		more = (g_ascii_strcasecmp(data, "true") == 0);
 		g_free(data);
 	}
 
openSUSE Build Service is sponsored by