Commit b9f9dc1c authored by Ronan's avatar Ronan

fix(core): clean a lot of C4800 errors on Windows

parent 72326763
......@@ -227,7 +227,7 @@ static void call_updating(SalOp *op, bool_t is_update) {
ms_warning("call_updating: CallSession no longer exists");
return;
}
L_GET_PRIVATE(session)->updating(is_update);
L_GET_PRIVATE(session)->updating(!!is_update);
}
......
......@@ -73,7 +73,7 @@ bool Address::operator< (const Address &address) const {
bool Address::isValid () const {
L_D();
return static_cast<bool>(d->internalAddress);
d->internalAddress;
}
const string &Address::getScheme () const {
......@@ -162,7 +162,7 @@ bool Address::setTransport (Transport transport) {
bool Address::getSecure () const {
L_D();
return d->internalAddress ? sal_address_is_secure(d->internalAddress) : false;
return d->internalAddress && sal_address_is_secure(d->internalAddress);
}
bool Address::setSecure (bool enabled) {
......@@ -177,7 +177,7 @@ bool Address::setSecure (bool enabled) {
bool Address::isSip () const {
L_D();
return d->internalAddress ? sal_address_is_sip(d->internalAddress) : false;
return d->internalAddress && sal_address_is_sip(d->internalAddress);
}
const string &Address::getMethodParam () const {
......@@ -280,7 +280,7 @@ bool Address::setHeader (const string &headerName, const string &headerValue) {
bool Address::hasParam (const string &paramName) const {
L_D();
return sal_address_has_param(d->internalAddress, L_STRING_TO_C(paramName));
return !!sal_address_has_param(d->internalAddress, L_STRING_TO_C(paramName));
}
const string &Address::getParamValue (const string &paramName) const {
......@@ -317,7 +317,7 @@ bool Address::setParams (const string &params) {
bool Address::hasUriParam (const string &uriParamName) const {
L_D();
return sal_address_has_uri_param(d->internalAddress, L_STRING_TO_C(uriParamName));
return !!sal_address_has_uri_param(d->internalAddress, L_STRING_TO_C(uriParamName));
}
const string &Address::getUriParamValue (const string &uriParamName) const {
......
......@@ -102,7 +102,7 @@ bool_t linphone_address_get_secure (const LinphoneAddress *address) {
}
void linphone_address_set_secure (LinphoneAddress *address, bool_t enabled) {
L_GET_CPP_PTR_FROM_C_OBJECT(address)->setSecure(enabled);
L_GET_CPP_PTR_FROM_C_OBJECT(address)->setSecure(!!enabled);
}
bool_t linphone_address_is_sip (const LinphoneAddress *address) {
......
......@@ -118,24 +118,24 @@ bool_t linphone_call_params_early_media_sending_enabled (const LinphoneCallParam
}
void linphone_call_params_enable_early_media_sending (LinphoneCallParams *params, bool_t enabled) {
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableEarlyMediaSending(enabled);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableEarlyMediaSending(!!enabled);
}
void linphone_call_params_enable_low_bandwidth (LinphoneCallParams *params, bool_t enabled) {
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableLowBandwidth(enabled);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableLowBandwidth(!!enabled);
}
void linphone_call_params_enable_audio (LinphoneCallParams *params, bool_t enabled) {
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableAudio(enabled);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableAudio(!!enabled);
}
LinphoneStatus linphone_call_params_enable_realtime_text (LinphoneCallParams *params, bool_t yesno) {
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableRealtimeText(yesno);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableRealtimeText(!!yesno);
return 0;
}
void linphone_call_params_enable_video (LinphoneCallParams *params, bool_t enabled) {
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableVideo(enabled);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableVideo(!!enabled);
}
const char *linphone_call_params_get_custom_header (const LinphoneCallParams *params, const char *header_name) {
......@@ -309,7 +309,7 @@ void linphone_call_params_set_video_direction (LinphoneCallParams *params, Linph
}
void linphone_call_params_enable_audio_multicast (LinphoneCallParams *params, bool_t yesno) {
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableAudioMulticast(yesno);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableAudioMulticast(!!yesno);
}
bool_t linphone_call_params_audio_multicast_enabled (const LinphoneCallParams *params) {
......@@ -317,7 +317,7 @@ bool_t linphone_call_params_audio_multicast_enabled (const LinphoneCallParams *p
}
void linphone_call_params_enable_video_multicast (LinphoneCallParams *params, bool_t yesno) {
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableVideoMulticast(yesno);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableVideoMulticast(!!yesno);
}
bool_t linphone_call_params_video_multicast_enabled (const LinphoneCallParams *params) {
......@@ -333,7 +333,7 @@ bool_t linphone_call_params_avpf_enabled (const LinphoneCallParams *params) {
}
void linphone_call_params_enable_avpf (LinphoneCallParams *params, bool_t enable) {
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableAvpf(enable);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableAvpf(!!enable);
}
bool_t linphone_call_params_mandatory_media_encryption_enabled (const LinphoneCallParams *params) {
......@@ -341,7 +341,7 @@ bool_t linphone_call_params_mandatory_media_encryption_enabled (const LinphoneCa
}
void linphone_call_params_enable_mandatory_media_encryption (LinphoneCallParams *params, bool_t value) {
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableMandatoryMediaEncryption(value);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableMandatoryMediaEncryption(!!value);
}
uint16_t linphone_call_params_get_avpf_rr_interval (const LinphoneCallParams *params) {
......@@ -369,7 +369,7 @@ bool_t linphone_call_params_get_in_conference (const LinphoneCallParams *params)
}
void linphone_call_params_set_in_conference (LinphoneCallParams *params, bool_t value) {
L_GET_PRIVATE_FROM_C_OBJECT(params)->setInConference(value);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setInConference(!!value);
}
bool_t linphone_call_params_get_internal_call_update (const LinphoneCallParams *params) {
......@@ -377,7 +377,7 @@ bool_t linphone_call_params_get_internal_call_update (const LinphoneCallParams *
}
void linphone_call_params_set_internal_call_update (LinphoneCallParams *params, bool_t value) {
L_GET_PRIVATE_FROM_C_OBJECT(params)->setInternalCallUpdate(value);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setInternalCallUpdate(!!value);
}
bool_t linphone_call_params_implicit_rtcp_fb_enabled (const LinphoneCallParams *params) {
......@@ -385,7 +385,7 @@ bool_t linphone_call_params_implicit_rtcp_fb_enabled (const LinphoneCallParams *
}
void linphone_call_params_enable_implicit_rtcp_fb (LinphoneCallParams *params, bool_t value) {
L_GET_PRIVATE_FROM_C_OBJECT(params)->enableImplicitRtcpFb(value);
L_GET_PRIVATE_FROM_C_OBJECT(params)->enableImplicitRtcpFb(!!value);
}
int linphone_call_params_get_down_bandwidth (const LinphoneCallParams *params) {
......@@ -445,7 +445,7 @@ bool_t linphone_call_params_get_update_call_when_ice_completed (const LinphoneCa
}
void linphone_call_params_set_update_call_when_ice_completed (LinphoneCallParams *params, bool_t value) {
L_GET_PRIVATE_FROM_C_OBJECT(params)->setUpdateCallWhenIceCompleted(value);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setUpdateCallWhenIceCompleted(!!value);
}
void linphone_call_params_set_sent_vsize (LinphoneCallParams *params, MSVideoSize vsize) {
......@@ -469,7 +469,7 @@ bool_t linphone_call_params_get_no_user_consent (const LinphoneCallParams *param
}
void linphone_call_params_set_no_user_consent (LinphoneCallParams *params, bool_t value) {
L_GET_PRIVATE_FROM_C_OBJECT(params)->setNoUserConsent(value);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setNoUserConsent(!!value);
}
// =============================================================================
......
......@@ -528,7 +528,7 @@ bool_t linphone_call_get_audio_muted (const LinphoneCall *call) {
}
void linphone_call_set_audio_muted (LinphoneCall *call, bool_t value) {
L_GET_PRIVATE_FROM_C_OBJECT(call)->setAudioMuted(value);
L_GET_PRIVATE_FROM_C_OBJECT(call)->setAudioMuted(!!value);
}
bool_t linphone_call_get_all_muted (const LinphoneCall *call) {
......@@ -700,7 +700,7 @@ const LinphoneCallParams *linphone_call_get_remote_params(LinphoneCall *call) {
}
void linphone_call_enable_camera (LinphoneCall *call, bool_t enable) {
L_GET_CPP_PTR_FROM_C_OBJECT(call)->enableCamera(enable);
L_GET_CPP_PTR_FROM_C_OBJECT(call)->enableCamera(!!enable);
}
bool_t linphone_call_camera_enabled (const LinphoneCall *call) {
......@@ -753,7 +753,7 @@ bool_t linphone_call_get_authentication_token_verified (const LinphoneCall *call
}
void linphone_call_set_authentication_token_verified (LinphoneCall *call, bool_t verified) {
L_GET_CPP_PTR_FROM_C_OBJECT(call)->setAuthenticationTokenVerified(verified);
L_GET_CPP_PTR_FROM_C_OBJECT(call)->setAuthenticationTokenVerified(!!verified);
}
void linphone_call_send_vfu_request (LinphoneCall *call) {
......@@ -1011,7 +1011,7 @@ void linphone_call_set_native_video_window_id (LinphoneCall *call, void *id) {
}
void linphone_call_enable_echo_cancellation (LinphoneCall *call, bool_t enable) {
L_GET_CPP_PTR_FROM_C_OBJECT(call)->enableEchoCancellation(enable);
L_GET_CPP_PTR_FROM_C_OBJECT(call)->enableEchoCancellation(!!enable);
}
bool_t linphone_call_echo_cancellation_enabled (const LinphoneCall *call) {
......@@ -1019,7 +1019,7 @@ bool_t linphone_call_echo_cancellation_enabled (const LinphoneCall *call) {
}
void linphone_call_enable_echo_limiter (LinphoneCall *call, bool_t val) {
L_GET_CPP_PTR_FROM_C_OBJECT(call)->enableEchoLimiter(val);
L_GET_CPP_PTR_FROM_C_OBJECT(call)->enableEchoLimiter(!!val);
}
bool_t linphone_call_echo_limiter_enabled (const LinphoneCall *call) {
......
......@@ -116,7 +116,7 @@ bool_t linphone_chat_message_is_secured(LinphoneChatMessage *msg) {
}
void linphone_chat_message_set_is_secured(LinphoneChatMessage *msg, bool_t secured) {
L_GET_CPP_PTR_FROM_C_OBJECT(msg)->setIsSecured(secured);
L_GET_CPP_PTR_FROM_C_OBJECT(msg)->setIsSecured(!!secured);
}
bool_t linphone_chat_message_is_outgoing(LinphoneChatMessage *msg) {
......@@ -206,7 +206,7 @@ bool_t linphone_chat_message_get_to_be_stored(const LinphoneChatMessage *msg) {
}
void linphone_chat_message_set_to_be_stored(LinphoneChatMessage *msg, bool_t to_be_stored) {
L_GET_CPP_PTR_FROM_C_OBJECT(msg)->setIsToBeStored(to_be_stored);
L_GET_CPP_PTR_FROM_C_OBJECT(msg)->setIsToBeStored(!!to_be_stored);
}
belle_http_request_t * linphone_chat_message_get_http_request(LinphoneChatMessage *msg) {
......
......@@ -59,5 +59,5 @@ bool_t linphone_participant_is_admin (const LinphoneParticipant *participant) {
}
void linphone_participant_set_admin (LinphoneParticipant *participant, bool_t value) {
L_GET_CPP_PTR_FROM_C_OBJECT(participant)->setAdmin(value);
L_GET_CPP_PTR_FROM_C_OBJECT(participant)->setAdmin(!!value);
}
......@@ -239,18 +239,18 @@ void MediaSessionParams::initDefault (LinphoneCore *core) {
lError() << "LinphoneCore has video disabled for both capture and display, but video policy is to start the call with video. "
"This is a possible mis-use of the API. In this case, video is disabled in default LinphoneCallParams";
}
d->realtimeTextEnabled = linphone_core_realtime_text_enabled(core);
d->realtimeTextEnabled = !!linphone_core_realtime_text_enabled(core);
d->encryption = linphone_core_get_media_encryption(core);
d->avpfEnabled = (linphone_core_get_avpf_mode(core) == LinphoneAVPFEnabled);
d->_implicitRtcpFbEnabled = lp_config_get_int(linphone_core_get_config(core), "rtp", "rtcp_fb_implicit_rtcp_fb", true);
d->_implicitRtcpFbEnabled = !!lp_config_get_int(linphone_core_get_config(core), "rtp", "rtcp_fb_implicit_rtcp_fb", true);
d->avpfRrInterval = static_cast<uint16_t>(linphone_core_get_avpf_rr_interval(core));
d->audioDirection = LinphoneMediaDirectionSendRecv;
d->videoDirection = LinphoneMediaDirectionSendRecv;
d->earlyMediaSendingEnabled = lp_config_get_int(linphone_core_get_config(core), "misc", "real_early_media", false);
d->audioMulticastEnabled = linphone_core_audio_multicast_enabled(core);
d->videoMulticastEnabled = linphone_core_video_multicast_enabled(core);
d->updateCallWhenIceCompleted = lp_config_get_int(linphone_core_get_config(core), "sip", "update_call_when_ice_completed", true);
d->mandatoryMediaEncryptionEnabled = linphone_core_is_media_encryption_mandatory(core);
d->earlyMediaSendingEnabled = !!lp_config_get_int(linphone_core_get_config(core), "misc", "real_early_media", false);
d->audioMulticastEnabled = !!linphone_core_audio_multicast_enabled(core);
d->videoMulticastEnabled = !!linphone_core_video_multicast_enabled(core);
d->updateCallWhenIceCompleted = !!lp_config_get_int(linphone_core_get_config(core), "sip", "update_call_when_ice_completed", true);
d->mandatoryMediaEncryptionEnabled = !!linphone_core_is_media_encryption_mandatory(core);
}
// -----------------------------------------------------------------------------
......
......@@ -354,7 +354,7 @@ void CallSessionPrivate::terminated () {
}
void CallSessionPrivate::updated (bool isUpdate) {
deferUpdate = lp_config_get_int(linphone_core_get_config(core), "sip", "defer_update_default", FALSE);
deferUpdate = !!lp_config_get_int(linphone_core_get_config(core), "sip", "defer_update_default", FALSE);
SalErrorInfo sei;
memset(&sei, 0, sizeof(sei));
switch (state) {
......
This diff is collapsed.
......@@ -34,7 +34,7 @@ LINPHONE_BEGIN_NAMESPACE
bool IceAgent::candidatesGathered () const {
if (!iceSession)
return false;
return ice_session_candidates_gathered(iceSession);
return !!ice_session_candidates_gathered(iceSession);
}
void IceAgent::checkSession (IceRole role, bool isReinvite) {
......@@ -107,7 +107,7 @@ bool IceAgent::hasCompletedCheckList () const {
switch (ice_session_state(iceSession)) {
case IS_Completed:
case IS_Failed:
return ice_session_has_completed_check_list(iceSession);
return !!ice_session_has_completed_check_list(iceSession);
default:
return false;
}
......@@ -213,7 +213,7 @@ void IceAgent::updateFromRemoteMediaDescription (
if (!iceParamsFoundInRemoteMediaDescription(remoteDesc)) {
// Response from remote does not contain mandatory ICE attributes, delete the session.
deleteSession();
mediaSession.getPrivate()->enableSymmetricRtp(linphone_core_symmetric_rtp_enabled(mediaSession.getPrivate()->getCore()));
mediaSession.getPrivate()->enableSymmetricRtp(!!linphone_core_symmetric_rtp_enabled(mediaSession.getPrivate()->getCore()));
return;
}
......@@ -236,7 +236,7 @@ void IceAgent::updateFromRemoteMediaDescription (
if (ice_session_nb_check_lists(iceSession) == 0) {
deleteSession();
mediaSession.getPrivate()->enableSymmetricRtp(linphone_core_symmetric_rtp_enabled(mediaSession.getPrivate()->getCore()));
mediaSession.getPrivate()->enableSymmetricRtp(!!linphone_core_symmetric_rtp_enabled(mediaSession.getPrivate()->getCore()));
}
}
......@@ -302,7 +302,7 @@ void IceAgent::updateLocalMediaDescriptionFromIce (SalMediaDescription *desc) {
}
}
if (firstCl)
result = ice_check_list_selected_valid_local_candidate(firstCl, &rtpCandidate, nullptr);
result = !!ice_check_list_selected_valid_local_candidate(firstCl, &rtpCandidate, nullptr);
if (result)
strncpy(desc->addr, rtpCandidate->taddr.ip, sizeof(desc->addr));
else
......@@ -320,13 +320,13 @@ void IceAgent::updateLocalMediaDescriptionFromIce (SalMediaDescription *desc) {
if (ice_check_list_state(cl) == ICL_Completed) {
LinphoneConfig *config = linphone_core_get_config(mediaSession.getPrivate()->getCore());
// TODO: Remove `ice_uses_nortpproxy` option, let's say in December 2018.
bool useNoRtpProxy = lp_config_get_int(config, "sip", "ice_uses_nortpproxy", false);
bool useNoRtpProxy = !!lp_config_get_int(config, "sip", "ice_uses_nortpproxy", false);
if (useNoRtpProxy)
stream->set_nortpproxy = true;
result = ice_check_list_selected_valid_local_candidate(ice_session_check_list(iceSession, i), &rtpCandidate, &rtcpCandidate);
result = !!ice_check_list_selected_valid_local_candidate(ice_session_check_list(iceSession, i), &rtpCandidate, &rtcpCandidate);
} else {
stream->set_nortpproxy = false;
result = ice_check_list_default_local_candidate(ice_session_check_list(iceSession, i), &rtpCandidate, &rtcpCandidate);
result = !!ice_check_list_default_local_candidate(ice_session_check_list(iceSession, i), &rtpCandidate, &rtcpCandidate);
}
if (result) {
strncpy(stream->rtp_addr, rtpCandidate->taddr.ip, sizeof(stream->rtp_addr));
......
......@@ -52,7 +52,7 @@ public:
bool hasCompleted () const;
bool hasCompletedCheckList () const;
bool hasSession () const {
return iceSession;
return !!iceSession;
}
bool isControlling () const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment