Commit 4b648c11 authored by Erwan Croze's avatar Erwan Croze 👋🏻

Use of BCTBX_NO_BREAK instead of LINPHONE_NO_BREAK

parent 7e52892b
......@@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "sal_impl.h"
#include "offeranswer.h"
#include <bctoolbox/defs.h>
static int extract_sdp(SalOp* op,belle_sip_message_t* message,belle_sdp_session_description_t** session_desc, SalReason *error);
/*used for calls terminated before creation of a dialog*/
......@@ -149,10 +151,10 @@ static void call_process_io_error(void *user_ctx, const belle_sip_io_error_event
if (op->state == SalOpStateTerminated) return;
if (op->pending_client_trans && (belle_sip_transaction_get_state(BELLE_SIP_TRANSACTION(op->pending_client_trans)) == BELLE_SIP_TRANSACTION_INIT)) {
sal_error_info_set(&op->error_info, SalReasonIOError, "SIP", 503, "IO error", NULL);
op->base.root->callbacks.call_failure(op);
if (!op->dialog || belle_sip_dialog_get_state(op->dialog) != BELLE_SIP_DIALOG_CONFIRMED){
/* Call terminated very very early, before INVITE is even sent, probably DNS resolution timeout. */
op->state = SalOpStateTerminating;
......@@ -223,7 +225,7 @@ void sal_call_cancel_invite(SalOp* op) {
sal_op_send_request(op,cancel);
}else if (op->dialog){
belle_sip_dialog_state_t state = belle_sip_dialog_get_state(op->dialog);;
/*case where the response received is invalid (could not establish a dialog), but the transaction is not cancellable
/*case where the response received is invalid (could not establish a dialog), but the transaction is not cancellable
* because already terminated*/
switch(state){
case BELLE_SIP_DIALOG_EARLY:
......@@ -412,7 +414,7 @@ static void call_process_transaction_terminated(void *user_ctx, const belle_sip_
resp=belle_sip_transaction_get_response(BELLE_SIP_TRANSACTION(server_transaction));
}
if (resp) code = belle_sip_response_get_status_code(resp);
if (op->state == SalOpStateTerminating
&& strcmp("BYE",belle_sip_request_get_method(req))==0
&& (!resp || (belle_sip_response_get_status_code(resp) != 401
......@@ -611,7 +613,7 @@ static void process_request_event(void *op_base, const belle_sip_request_event_t
drop_op = TRUE;
}
break;
} /* else same behavior as for EARLY state, thus NO BREAK*/
}BCTBX_NO_BREAK; /* else same behavior as for EARLY state, thus NO BREAK*/
}
case BELLE_SIP_DIALOG_EARLY: {
if (strcmp("CANCEL",method)==0) {
......@@ -646,7 +648,7 @@ static void process_request_event(void *op_base, const belle_sip_request_event_t
case BELLE_SIP_DIALOG_CONFIRMED:
/*great ACK received*/
if (strcmp("ACK",method)==0) {
if (!op->pending_client_trans ||
if (!op->pending_client_trans ||
!belle_sip_transaction_state_is_transient(belle_sip_transaction_get_state((belle_sip_transaction_t*)op->pending_client_trans))){
if (op->sdp_offering){
SalReason reason;
......@@ -990,7 +992,7 @@ int sal_call_decline_with_error_info(SalOp *op, const SalErrorInfo *info, const
belle_sip_header_contact_t* contact=NULL;
int status = info->protocol_code;
belle_sip_transaction_t *trans;
if (info->reason==SalReasonRedirect){
if (redirection!=NULL) {
if (strstr(redirection,"sip:")!=0) status=302;
......@@ -1098,7 +1100,7 @@ int sal_call_terminate_with_error(SalOp *op, const SalErrorInfo *info){
p_sei = &sei;
} else{
p_sei = info;
}
belle_sip_dialog_state_t dialog_state=op->dialog?belle_sip_dialog_get_state(op->dialog):BELLE_SIP_DIALOG_NULL;
if (op->state==SalOpStateTerminating || op->state==SalOpStateTerminated) {
......
......@@ -24,6 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "private.h"
#include "mediastreamer2/mediastream.h"
#include "linphone/lpconfig.h"
#include <bctoolbox/defs.h>
// stat
#ifndef _WIN32
......@@ -255,7 +256,7 @@ static LinphoneCall * look_for_broken_call_to_replace(SalOp *h, LinphoneCore *lc
}
it = bctbx_list_next(it);
}
return NULL;
}
......@@ -277,7 +278,7 @@ static void call_received(SalOp *h){
linphone_call_replace_op(replaced_call, h);
return;
}
p_asserted_id = sal_custom_header_find(sal_op_get_recv_custom_header(h),"P-Asserted-Identity");
/*in some situation, better to trust the network rather than the UAC*/
if (lp_config_get_int(lc->config,"sip","call_logs_use_asserted_id_instead_of_from",0)) {
......@@ -332,7 +333,7 @@ static void call_received(SalOp *h){
sal_op_release(h);
return;
}
if (sal_op_get_privacy(h) == SalPrivacyNone) {
from_address_to_search_if_me=linphone_address_clone(from_addr);
......@@ -569,10 +570,10 @@ static void process_call_accepted(LinphoneCore *lc, LinphoneCall *call, SalOp *o
switch (call->state){
case LinphoneCallResuming:
linphone_core_notify_display_status(lc,_("Call resumed."));
LINPHONE_NO_BREAK; /*intentionally no break*/
BCTBX_NO_BREAK; /*intentionally no break*/
case LinphoneCallConnected:
if (call->referer) linphone_core_notify_refer_state(lc,call->referer,call);
LINPHONE_NO_BREAK; /*intentionally no break*/
BCTBX_NO_BREAK; /*intentionally no break*/
case LinphoneCallUpdating:
case LinphoneCallUpdatedByRemote:
if (!sal_media_description_has_dir(call->localdesc, SalStreamInactive) &&
......@@ -741,7 +742,7 @@ static void call_updated(LinphoneCore *lc, LinphoneCall *call, SalOp *op, bool_t
case LinphoneCallResuming:
sal_error_info_set(&sei,SalReasonInternalError, "SIP", 0, NULL, NULL);
sal_call_decline_with_error_info(call->op, &sei,NULL);
LINPHONE_NO_BREAK; /*no break*/
BCTBX_NO_BREAK; /*no break*/
case LinphoneCallIdle:
case LinphoneCallOutgoingInit:
case LinphoneCallEnd:
......@@ -764,7 +765,7 @@ static void call_updating(SalOp *op, bool_t is_update){
LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
SalMediaDescription *rmd=sal_call_get_remote_media_description(op);
SalErrorInfo sei = {0};
if (!call) {
ms_error("call_updating(): call doesn't exist anymore");
return ;
......@@ -903,12 +904,12 @@ static void call_failure(SalOp *op){
LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
bool_t stop_ringing = TRUE;
bctbx_list_t *calls = lc->calls;
if (call==NULL){
ms_warning("Call faillure reported on already terminated call.");
return ;
}
referer=call->referer;
linphone_core_notify_show_interface(lc);
......@@ -1296,7 +1297,7 @@ static bool_t fill_auth_info(LinphoneCore *lc, SalAuthInfo* sai) {
fill_auth_info_with_client_certificate(lc, sai);
}
}
if (sai->realm && !ai->realm){
/*if realm was not known, then set it so that ha1 may eventually be calculated and clear text password dropped*/
linphone_auth_info_set_realm(ai, sai->realm);
......@@ -1423,7 +1424,7 @@ static void notify(SalOp *op, SalSubscribeStatus st, const char *eventname, SalB
if (out_of_dialog){
/*out of dialog NOTIFY do not create an implicit subscription*/
linphone_event_set_state(lev, LinphoneSubscriptionTerminated);
}else if (st!=SalSubscribeNone){
}else if (st!=SalSubscribeNone){
linphone_event_set_state(lev,linphone_subscription_state_from_sal(st));
}
}
......@@ -1534,5 +1535,3 @@ SalCallbacks linphone_sal_callbacks={
on_expire,
on_notify_response
};
......@@ -41,6 +41,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "mediastreamer2/mssndcard.h"
#include "mediastreamer2/msrtt4103.h"
#include <bctoolbox/defs.h>
static const char *EC_STATE_STORE = ".linphone.ecstate";
#define EC_STATE_MAX_LEN 1048576 // 1Mo
......@@ -2540,7 +2542,7 @@ static void setZrtpCryptoTypesParameters(MSZrtpParams *params, LinphoneCore *lc)
break;
case MS_AES_CM_256_SHA1_80:
ms_warning("Deprecated crypto suite MS_AES_CM_256_SHA1_80, use MS_AES_256_SHA1_80 instead");
LINPHONE_NO_BREAK;
BCTBX_NO_BREAK;
case MS_AES_256_SHA1_80:
params->ciphers[params->ciphersCount++] = MS_ZRTP_CIPHER_AES3;
params->authTags[params->authTagsCount++] = MS_ZRTP_AUTHTAG_HS80;
......@@ -3090,7 +3092,7 @@ static RtpProfile *make_profile(LinphoneCall *call, const SalMediaDescription *m
*used_pt = payload_type_get_number(pt);
}
}
if (pt->flags & PAYLOAD_TYPE_BITRATE_OVERRIDE){
ms_message("Payload type [%s/%i] has explicit bitrate [%i] kbit/s", pt->mime_type, pt->clock_rate, pt->normal_bitrate/1000);
pt->normal_bitrate=get_min_bandwidth(pt->normal_bitrate,bw*1000);
......@@ -3798,7 +3800,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, LinphoneCallState nex
if (linphone_core_get_remote_ringback_tone(lc)){
call->playing_ringbacktone = TRUE;
}
LINPHONE_NO_BREAK;
BCTBX_NO_BREAK;
case LinphoneCallOutgoingEarlyMedia:
if (!call->params->real_early_media){
call->all_muted = TRUE;
......
......@@ -36,6 +36,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <ortp/telephonyevents.h>
#include <mediastreamer2/zrtp.h>
#include <mediastreamer2/dtls_srtp.h>
#include <bctoolbox/defs.h>
#include "mediastreamer2/dtmfgen.h"
#include "mediastreamer2/mediastream.h"
#include "mediastreamer2/msequalizer.h"
......@@ -460,16 +461,16 @@ void linphone_core_set_log_level(OrtpLogLevel loglevel) {
case ORTP_TRACE:
case ORTP_DEBUG:
mask |= ORTP_DEBUG;
LINPHONE_NO_BREAK;
BCTBX_NO_BREAK;
case ORTP_MESSAGE:
mask |= ORTP_MESSAGE;
LINPHONE_NO_BREAK;
BCTBX_NO_BREAK;
case ORTP_WARNING:
mask |= ORTP_WARNING;
LINPHONE_NO_BREAK;
BCTBX_NO_BREAK;
case ORTP_ERROR:
mask |= ORTP_ERROR;
LINPHONE_NO_BREAK;
BCTBX_NO_BREAK;
case ORTP_FATAL:
mask |= ORTP_FATAL;
break;
......@@ -3487,7 +3488,7 @@ LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const
bool_t defer = FALSE;
LinphoneCallParams *cp;
if (!(!linphone_call_params_audio_enabled(params) ||
if (!(!linphone_call_params_audio_enabled(params) ||
linphone_call_params_get_audio_direction(params) == LinphoneMediaDirectionInactive ||
linphone_call_params_get_local_conference_mode(params) == TRUE
)
......
......@@ -24,6 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "linphone/lpconfig.h"
#include "liblinphone_gitversion.h"
#include <bctoolbox/vfs.h>
#include <bctoolbox/defs.h>
#include <sys/types.h>
#include <sys/stat.h>
......@@ -303,7 +304,7 @@ static void linphone_gtk_init_liblinphone(const char *config_file,
if (chat_messages_db_file) linphone_core_set_chat_database_path(the_core,chat_messages_db_file);
if (call_logs_db_file) linphone_core_set_call_logs_database_path(the_core, call_logs_db_file);
if (friends_db_file) linphone_core_set_friends_database_path(the_core, friends_db_file);
// Disable the generic OpenGL displaying filter
msfactory = linphone_core_get_ms_factory(the_core);
ogl_filter_desc = ms_factory_lookup_filter_by_id(msfactory, MS_OGL_ID);
......@@ -1417,7 +1418,7 @@ static void linphone_gtk_call_state_changed(LinphoneCore *lc, LinphoneCall *call
case LinphoneCallPausing:
linphone_gtk_enable_hold_button(call,TRUE,FALSE);
linphone_gtk_call_update_tab_header(call,FALSE);
LINPHONE_NO_BREAK;
BCTBX_NO_BREAK;
case LinphoneCallPausedByRemote:
linphone_gtk_in_call_view_set_paused(call);
linphone_gtk_call_update_tab_header(call,TRUE);
......
......@@ -48,15 +48,5 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define LINPHONE_DEPRECATED MS2_DEPRECATED
#endif
/* Macro telling GCC that a 'break' statement has been deliberately omitted
* in switch block */
#ifndef LINPHONE_NO_BREAK
#if defined(__GNUC__) && __GNUC__ >= 7
#define LINPHONE_NO_BREAK __attribute__((fallthrough))
#else
#define LINPHONE_NO_BREAK
#endif // __GNUC__
#endif // LINPHONE_NO_BREAK
#endif /* LINPHONE_DEFS_H_ */
This diff is collapsed.
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