From fdc9e7f8b6a81df14bee9a2bb7d4b626e8df3e1a Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Thu, 17 May 2012 05:33:44 +0000 Subject: [PATCH] work around libzrtp API mistake for VS libzrtp's sas_is_verified field is a uint32_t, but zrtp_verified_set expects a uint8_t. This is a boolean field, so it doesn't matter one way or the other. gcc doesn't care, but Windows Visual Studio apparently throws a warning about this. --- src/switch_rtp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 9211ec2cee..9c42520ff9 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -715,7 +715,7 @@ static void zrtp_event_callback(zrtp_stream_t *stream, zrtp_security_event_t eve switch_channel_set_variable_name_printf(channel, stream->session->sas1.buffer, "zrtp_sas1_string_%s", type); switch_channel_set_variable_name_printf(channel, stream->session->sas2.buffer, "zrtp_sas2_string", type); - zrtp_verified_set(zrtp_global, &stream->session->zid, &stream->session->peer_zid, zrtp_session_info.sas_is_verified ^ 1); + zrtp_verified_set(zrtp_global, &stream->session->zid, &stream->session->peer_zid, (uint8_t)(zrtp_session_info.sas_is_verified ^ 1)); } } @@ -777,7 +777,7 @@ static void zrtp_event_callback(zrtp_stream_t *stream, zrtp_security_event_t eve if (zrtp_status_ok == zrtp_session_get(stream->session, &zrtp_session_info)) { if (zrtp_session_info.sas_is_ready) { - zrtp_verified_set(zrtp_global, &stream->session->zid, &stream->session->peer_zid, zrtp_session_info.sas_is_verified ^ 1); + zrtp_verified_set(zrtp_global, &stream->session->zid, &stream->session->peer_zid, (uint8_t)(zrtp_session_info.sas_is_verified ^ 1)); } } } @@ -790,7 +790,7 @@ static void zrtp_event_callback(zrtp_stream_t *stream, zrtp_security_event_t eve if (zrtp_status_ok == zrtp_session_get(stream->session, &zrtp_session_info)) { if (zrtp_session_info.sas_is_ready) { - zrtp_verified_set(zrtp_global, &stream->session->zid, &stream->session->peer_zid, zrtp_session_info.sas_is_verified ^ 1); + zrtp_verified_set(zrtp_global, &stream->session->zid, &stream->session->peer_zid, (uint8_t)(zrtp_session_info.sas_is_verified ^ 1)); } } } @@ -803,7 +803,7 @@ static void zrtp_event_callback(zrtp_stream_t *stream, zrtp_security_event_t eve if (zrtp_status_ok == zrtp_session_get(stream->session, &zrtp_session_info)) { if (zrtp_session_info.sas_is_ready) { - zrtp_verified_set(zrtp_global, &stream->session->zid, &stream->session->peer_zid, zrtp_session_info.sas_is_verified ^ 1); + zrtp_verified_set(zrtp_global, &stream->session->zid, &stream->session->peer_zid, (uint8_t)(zrtp_session_info.sas_is_verified ^ 1)); } } } @@ -3645,7 +3645,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp switch_clear_flag(other_rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_RECV); switch_clear_flag(other_rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_SEND); zrtp_verified_set(zrtp_global, &rtp_session->zrtp_session->zid, - &rtp_session->zrtp_session->peer_zid, zrtp_session_info.sas_is_verified ^ 1); + &rtp_session->zrtp_session->peer_zid, (uint8_t)(zrtp_session_info.sas_is_verified ^ 1)); rtp_session->zrtp_mitm_tries++; } } @@ -4275,7 +4275,7 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra switch_clear_flag(other_rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_RECV); switch_clear_flag(other_rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_SEND); zrtp_verified_set(zrtp_global, &rtp_session->zrtp_session->zid, - &rtp_session->zrtp_session->peer_zid, zrtp_session_info.sas_is_verified ^ 1); + &rtp_session->zrtp_session->peer_zid, (uint8_t)(zrtp_session_info.sas_is_verified ^ 1)); rtp_session->zrtp_mitm_tries++; } rtp_session->zrtp_mitm_tries++;