From 5d9722ef9e8a3e1c85e6c7f7ac7615e7f246bde0 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Fri, 18 Feb 2011 10:36:40 +0200 Subject: [PATCH] configure: add -Wunused-but-set-variable compiler warning The gcc in Fedora 15 enables this warning by default and therefore pidgin-sipe build fails. Fixed all places in the code that failed. --- configure.ac | 1 + src/core/sip-sec-krb5.c | 13 ++++++------- src/core/sip-sec-ntlm-tests.c | 7 +++---- src/core/sipe-conf.c | 4 ++++ src/core/sipe-incoming.c | 2 -- src/core/sipe.c | 17 +++++------------ 6 files changed, 19 insertions(+), 25 deletions(-) diff --git a/configure.ac b/configure.ac index 305599a1..c65021b7 100644 --- a/configure.ac +++ b/configure.ac @@ -98,6 +98,7 @@ AS_IF([test "x$enable_quality_check" = xyes], "-Wnested-externs" \ "-Wpointer-arith" \ "-Wundef" \ + "-Wunused-but-set-variable" \ ; do ac_save_CFLAGS=$CFLAGS AC_MSG_CHECKING([if $CC supports $newflag]) diff --git a/src/core/sip-sec-krb5.c b/src/core/sip-sec-krb5.c index 55130ef5..d67299d1 100644 --- a/src/core/sip-sec-krb5.c +++ b/src/core/sip-sec-krb5.c @@ -281,18 +281,17 @@ sip_sec_krb5_print_gss_error0(char *func, OM_uint32 status, int type) { - OM_uint32 ret; OM_uint32 minor; OM_uint32 message_context = 0; gss_buffer_desc status_string; do { - ret = gss_display_status(&minor, - status, - type, - GSS_C_NO_OID, - &message_context, - &status_string); + gss_display_status(&minor, + status, + type, + GSS_C_NO_OID, + &message_context, + &status_string); printf("GSS-API error in %s (%s): %s\n", func, (type == GSS_C_GSS_CODE ? "GSS" : "Mech"), (char *)status_string.value); gss_release_buffer(&minor, &status_string); diff --git a/src/core/sip-sec-ntlm-tests.c b/src/core/sip-sec-ntlm-tests.c index 7d2d00e8..cfe01bf3 100644 --- a/src/core/sip-sec-ntlm-tests.c +++ b/src/core/sip-sec-ntlm-tests.c @@ -125,7 +125,6 @@ gboolean sip_sec_ntlm_tests(void) struct sipmsg *msg; struct sipmsg_breakdown msgbd; gchar *msg_str; - gchar *sig; const char *password2; const char *user2; const char *domain2; @@ -509,7 +508,7 @@ Response: msg_str, 0, exported_session_key2, exported_session_key2, mac); sipmsg_breakdown_free(&msgbd); assert_equal ("0100000000000000BF2E52667DDF6DED", mac, 16, TRUE); - sig = buff_to_hex_str((guint8 *)mac, 16); + /* sig = buff_to_hex_str((guint8 *)mac, 16); */ } @@ -765,7 +764,7 @@ Message (length 352): sip_sec_ntlm_sipe_signature_make (flags, msg_str, 0, client_sign_key, client_seal_key, mac); sipmsg_breakdown_free(&msgbd); assert_equal ("0100000029618e9651b65a7764000000", mac, 16, TRUE); - sig = buff_to_hex_str((guint8 *)mac, 16); + /* sig = buff_to_hex_str((guint8 *)mac, 16); */ printf ("\n\nTesting (NTLMv2 / OC 2007 R2) Message Parsing, Signing, and Verification\nServer response\n(Authentication Protocol version 4)\n"); msg = sipmsg_parse_msg(response); @@ -777,7 +776,7 @@ Message (length 352): sip_sec_ntlm_sipe_signature_make (flags, msg_str, 0, server_sign_key, server_seal_key, mac); sipmsg_breakdown_free(&msgbd); assert_equal ("01000000E615438A917661BE64000000", mac, 16, TRUE); - sig = buff_to_hex_str((guint8 *)mac, 16); + /* sig = buff_to_hex_str((guint8 *)mac, 16); */ printf ("\n\nTesting (NTLMv2 / OC 2007 R2) MAC - client signing\n"); MAC (flags, (gchar*)request_sig,strlen(request_sig), client_sign_key,16, client_seal_key,16, 0, 100, mac); diff --git a/src/core/sipe-conf.c b/src/core/sipe-conf.c index a6fd98e7..39d7f479 100644 --- a/src/core/sipe-conf.c +++ b/src/core/sipe-conf.c @@ -726,7 +726,9 @@ sipe_process_conference(struct sipe_core_private *sipe_private, const gchar *focus_uri; struct sip_session *session; gboolean just_joined = FALSE; +#ifdef HAVE_VV gboolean audio_was_added = FALSE; +#endif if (msg->response != 0 && msg->response != 200) return; @@ -824,8 +826,10 @@ sipe_process_conference(struct sipe_core_private *sipe_private, user_uri); } } else if (sipe_strequal("audio-video", session_type)) { +#ifdef HAVE_VV if (!session->is_call) audio_was_added = TRUE; +#endif } } if (!is_in_im_mcu) { diff --git a/src/core/sipe-incoming.c b/src/core/sipe-incoming.c index 2a17af97..75499101 100644 --- a/src/core/sipe-incoming.c +++ b/src/core/sipe-incoming.c @@ -279,7 +279,6 @@ void process_incoming_invite(struct sipe_core_private *sipe_private, const gchar *oldHeader; gchar *newHeader; gboolean is_multiparty = FALSE; - gboolean is_triggered = FALSE; gboolean was_multiparty = TRUE; gboolean just_joined = FALSE; gchar *from; @@ -339,7 +338,6 @@ void process_incoming_invite(struct sipe_core_private *sipe_private, } } if (trig_invite && !g_strcasecmp(trig_invite, "TRUE")) { - is_triggered = TRUE; is_multiparty = TRUE; } diff --git a/src/core/sipe.c b/src/core/sipe.c index 63e076a7..c8b6a64d 100644 --- a/src/core/sipe.c +++ b/src/core/sipe.c @@ -1511,16 +1511,12 @@ static void sipe_process_registration_notify(struct sipe_core_private *sipe_priv if (diagnostics != NULL) { reason = sipmsg_find_part_of_header(diagnostics, "reason=\"", "\"", NULL); } else { // for LCS2005 - int error_id = 0; if (event && sipe_strcase_equal(event, "unregistered")) { - error_id = 4140; // [MS-SIPREGE] //reason = g_strdup(_("User logged out")); // [MS-OCER] reason = g_strdup(_("you are already signed in at another location")); } else if (event && sipe_strcase_equal(event, "rejected")) { - error_id = 4141; reason = g_strdup(_("user disabled")); // [MS-OCER] } else if (event && sipe_strcase_equal(event, "deactivated")) { - error_id = 4142; reason = g_strdup(_("user moved")); // [MS-OCER] } } @@ -3645,7 +3641,6 @@ static void process_incoming_notify_msrtc(struct sipe_core_private *sipe_private const sipe_xml *xn_state; const sipe_xml *xn_contact; char *note; - char *free_activity; int user_avail; const char *user_avail_nil; int res_avail; @@ -3682,8 +3677,6 @@ static void process_incoming_notify_msrtc(struct sipe_core_private *sipe_private user_avail_since = 0; } - free_activity = NULL; - name = sipe_xml_attribute(xn_presentity, "uri"); /* without 'sip:' prefix */ uri = sip_uri_from_name(name); avl = sipe_xml_int_attribute(xn_availability, "aggregate", 0); @@ -4837,8 +4830,8 @@ sipe_publish_get_category_cal_free_busy(struct sipe_core_private *sipe_private) guint cal_data_instance = sipe_get_pub_instance(sipe_private, SIPE_PUB_CALENDAR_DATA); char *fb_start_str; char *free_busy_base64; - const char *st; - const char *fb; + /* const char *st; */ + /* const char *fb; */ char *res; /* key is */ @@ -4877,12 +4870,12 @@ sipe_publish_get_category_cal_free_busy(struct sipe_core_private *sipe_private) fb_start_str = sipe_utils_time_to_str(cal->fb_start); free_busy_base64 = sipe_cal_get_freebusy_base64(cal->free_busy); - st = publication_cal_300 ? publication_cal_300->fb_start_str : NULL; - fb = publication_cal_300 ? publication_cal_300->free_busy_base64 : NULL; - /* we will rebuplish the same data to refresh publication time, * so if data from multiple sources, most recent will be choosen */ + // st = publication_cal_300 ? publication_cal_300->fb_start_str : NULL; + // fb = publication_cal_300 ? publication_cal_300->free_busy_base64 : NULL; + // //if (sipe_strequal(st, fb_start_str) && sipe_strequal(fb, free_busy_base64)) //{ // SIPE_DEBUG_INFO_NOFORMAT("sipe_publish_get_category_cal_free_busy: FreeBusy has NOT changed. Exiting."); -- 2.11.4.GIT