diff --git a/coreapi/bellesip_sal/sal_op_call.c b/coreapi/bellesip_sal/sal_op_call.c index f8e42e211..ec7ef149c 100644 --- a/coreapi/bellesip_sal/sal_op_call.c +++ b/coreapi/bellesip_sal/sal_op_call.c @@ -985,7 +985,7 @@ int sal_call_send_dtmf(SalOp *h, char dtmf){ if (h->dialog && (belle_sip_dialog_get_state(h->dialog) == BELLE_SIP_DIALOG_CONFIRMED || belle_sip_dialog_get_state(h->dialog) == BELLE_SIP_DIALOG_EARLY)){ belle_sip_request_t *req=belle_sip_dialog_create_queued_request(h->dialog,"INFO"); if (req){ - int bodylen; + size_t bodylen; char dtmf_body[128]={0}; snprintf(dtmf_body, sizeof(dtmf_body)-1, "Signal=%c\r\nDuration=250\r\n", dtmf); diff --git a/coreapi/conference.cc b/coreapi/conference.cc index db5930713..16b9f82a4 100644 --- a/coreapi/conference.cc +++ b/coreapi/conference.cc @@ -112,7 +112,7 @@ public: bool microphoneIsMuted() const {return m_isMuted;} float getInputVolume() const; - virtual int getSize() const {return m_participants.size() + (isIn()?1:0);} + virtual int getSize() const {return (int)m_participants.size() + (isIn()?1:0);} const std::list &getParticipants() const {return m_participants;} virtual int startRecording(const char *path) = 0; diff --git a/coreapi/enum.c b/coreapi/enum.c index 419e7000e..b083595d7 100644 --- a/coreapi/enum.c +++ b/coreapi/enum.c @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static char *create_enum_domain(const char *number){ - size_t len=strlen(number); + long len=(long)strlen(number); char *domain=ms_malloc((len*2)+10); long i,j; diff --git a/coreapi/lime.c b/coreapi/lime.c index 7d4e1ab93..4af7177a7 100644 --- a/coreapi/lime.c +++ b/coreapi/lime.c @@ -588,7 +588,7 @@ int lime_createMultipartMessage(xmlDocPtr cacheBuffer, uint8_t *message, uint8_t lime_strToUint8(selfZid, selfZidHex, 24); /* encrypted message length is plaintext + 16 for tag */ - encryptedMessageLength = strlen((char *)message) + 16; + encryptedMessageLength = (uint32_t)strlen((char *)message) + 16; /* retrieve keys associated to the peer URI */ associatedKeys.peerURI = (uint8_t *)malloc(strlen((char *)peerURI)+1); @@ -626,7 +626,7 @@ int lime_createMultipartMessage(xmlDocPtr cacheBuffer, uint8_t *message, uint8_t limeKey_t *currentKey = associatedKeys.peerKeys[i]; /* encrypted message include a 16 bytes tag */ uint8_t *encryptedMessage = (uint8_t *)malloc(encryptedMessageLength); - lime_encryptMessage(currentKey, message, strlen((char *)message), selfZid, encryptedMessage); + lime_encryptMessage(currentKey, message, (uint32_t)strlen((char *)message), selfZid, encryptedMessage); /* add a "msg" node the the output message, doc node is : * * peerZID @@ -795,7 +795,7 @@ int lime_decryptMultipartMessage(xmlDocPtr cacheBuffer, uint8_t *message, uint8_ /* decrypt the message */ *output = (uint8_t *)malloc(encryptedMessageLength - 16 +1); /* plain message is same length than encrypted one with 16 bytes less for the tag + 1 to add the null termination char */ - retval = lime_decryptMessage(&associatedKey, encryptedMessage, encryptedMessageLength, selfZid, *output); + retval = lime_decryptMessage(&associatedKey, encryptedMessage, (uint32_t)encryptedMessageLength, selfZid, *output); free(encryptedMessage); diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 317a87a16..66bc483e2 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -603,7 +603,7 @@ static int compress_file(FILE *input_file, COMPRESS_FILE_PTR output_file) { total_bytes += fwrite(buffer, 1, bytes, output_file); #endif } - return total_bytes; + return (int)total_bytes; } static int prepare_log_collection_file_to_upload(const char *filename) { @@ -799,7 +799,7 @@ static void net_config_read (LinphoneCore *lc) static void build_sound_devices_table(LinphoneCore *lc){ const char **devices; const char **old; - int ndev; + size_t ndev; int i; const bctbx_list_t *elem=ms_snd_card_manager_get_list(ms_factory_get_snd_card_manager(lc->factory)); ndev=bctbx_list_size(elem); @@ -1369,7 +1369,7 @@ static void codecs_config_read(LinphoneCore *lc){ static void build_video_devices_table(LinphoneCore *lc){ const bctbx_list_t *elem; int i; - int ndev; + size_t ndev; const char **devices; if (lc->video_conf.cams) ms_free((void *)lc->video_conf.cams); @@ -5390,7 +5390,7 @@ void linphone_core_remove_call_log(LinphoneCore *lc, LinphoneCallLog *cl) { void linphone_core_migrate_logs_from_rc_to_db(LinphoneCore *lc) { bctbx_list_t *logs_to_migrate = NULL; LpConfig *lpc = NULL; - int original_logs_count, migrated_logs_count; + size_t original_logs_count, migrated_logs_count; int i; #ifndef SQLITE_STORAGE_ENABLED @@ -5423,7 +5423,7 @@ void linphone_core_migrate_logs_from_rc_to_db(LinphoneCore *lc) { logs_to_migrate = lc->call_logs; lc->call_logs = NULL; // We can't use bctbx_list_for_each because logs_to_migrate are listed in the wrong order (latest first), and we want to store the logs latest last - for (i = bctbx_list_size(logs_to_migrate) - 1; i >= 0; i--) { + for (i = (int)bctbx_list_size(logs_to_migrate) - 1; i >= 0; i--) { LinphoneCallLog *log = (LinphoneCallLog *) bctbx_list_nth_data(logs_to_migrate, i); linphone_core_store_call_log(lc, log); } @@ -5431,13 +5431,13 @@ void linphone_core_migrate_logs_from_rc_to_db(LinphoneCore *lc) { original_logs_count = bctbx_list_size(logs_to_migrate); migrated_logs_count = bctbx_list_size(lc->call_logs); if (original_logs_count == migrated_logs_count) { - int i = 0; + size_t i = 0; ms_debug("call logs migration successful: %u logs migrated", (unsigned int)bctbx_list_size(lc->call_logs)); lp_config_set_int(lpc, "misc", "call_logs_migration_done", 1); for (; i < original_logs_count; i++) { char logsection[32]; - snprintf(logsection, sizeof(logsection), "call_log_%i", i); + snprintf(logsection, sizeof(logsection), "call_log_%u", (unsigned int)i); lp_config_clean_section(lpc, logsection); } } else { @@ -6895,7 +6895,7 @@ void linphone_core_destroy(LinphoneCore *lc){ * @ingroup call_control **/ int linphone_core_get_calls_nb(const LinphoneCore *lc){ - return bctbx_list_size(lc->calls);; + return (int)bctbx_list_size(lc->calls); } /** diff --git a/coreapi/lpconfig.c b/coreapi/lpconfig.c index ace08362b..d855cc5d7 100644 --- a/coreapi/lpconfig.c +++ b/coreapi/lpconfig.c @@ -1020,7 +1020,7 @@ int lp_config_read_relative_file(const LpConfig *lpconfig, const char *filename, } - if(bctbx_file_read(pFile, data, 1, max_length) < 0){ + if(bctbx_file_read(pFile, data, 1, (off_t)max_length) < 0){ ms_error("%s could not be loaded.", realfilepath); goto err; @@ -1043,7 +1043,7 @@ err: const char** lp_config_get_sections_names(LpConfig *lpconfig) { const char **sections_names; const bctbx_list_t *sections = lpconfig->sections; - int ndev; + size_t ndev; int i; ndev = bctbx_list_size(sections); diff --git a/coreapi/misc.c b/coreapi/misc.c index 6f713553c..a5bf43040 100644 --- a/coreapi/misc.c +++ b/coreapi/misc.c @@ -319,7 +319,7 @@ static ortp_socket_t create_socket(int local_port){ static int send_stun_request(int sock, const struct sockaddr *server, socklen_t addrlen, int id, bool_t change_addr){ char *buf = NULL; - int len; + size_t len; int err = 0; MSStunMessage *req = ms_stun_binding_request_create(); UInt96 tr_id = ms_stun_message_get_tr_id(req); @@ -332,7 +332,7 @@ static int send_stun_request(int sock, const struct sockaddr *server, socklen_t ms_error("Fail to encode stun message."); err = -1; } else { - err = sendto(sock, buf, len, 0, server, addrlen); + err = bctbx_sendto(sock, buf, len, 0, server, addrlen); if (err < 0) { ms_error("sendto failed: %s",strerror(errno)); err = -1; @@ -905,7 +905,7 @@ void _update_local_media_description_from_ice(SalMediaDescription *desc, IceSess IceSessionState session_state = ice_session_state(session); int nb_candidates; int i; - size_t j; + int j; bool_t result; if (session_state == IS_Completed) { @@ -955,7 +955,7 @@ void _update_local_media_description_from_ice(SalMediaDescription *desc, IceSess stream->ice_mismatch = ice_check_list_is_mismatch(cl); if ((ice_check_list_state(cl) == ICL_Running) || (ice_check_list_state(cl) == ICL_Completed)) { memset(stream->ice_candidates, 0, sizeof(stream->ice_candidates)); - for (j = 0; j < MIN(bctbx_list_size(cl->local_candidates), SAL_MEDIA_DESCRIPTION_MAX_ICE_CANDIDATES); j++) { + for (j = 0; j < MIN((int)bctbx_list_size(cl->local_candidates), SAL_MEDIA_DESCRIPTION_MAX_ICE_CANDIDATES); j++) { SalIceCandidate *sal_candidate = &stream->ice_candidates[nb_candidates]; IceCandidate *ice_candidate = bctbx_list_nth_data(cl->local_candidates, j); const char *default_addr = NULL; diff --git a/coreapi/presence.c b/coreapi/presence.c index 306fc9a1f..294a8ac74 100644 --- a/coreapi/presence.c +++ b/coreapi/presence.c @@ -360,7 +360,7 @@ int linphone_presence_model_set_contact(LinphonePresenceModel *model, const char } static void presence_model_count_activities(const LinphonePresencePerson *person, unsigned int *nb) { - *nb += bctbx_list_size(person->activities); + *nb += (unsigned int)bctbx_list_size(person->activities); } struct _get_activity_st { @@ -371,7 +371,7 @@ struct _get_activity_st { static void presence_model_get_activity(const LinphonePresencePerson *person, struct _get_activity_st *st) { if (st->current_idx != (unsigned)-1) { - unsigned int size = bctbx_list_size(person->activities); + unsigned int size = (unsigned int)bctbx_list_size(person->activities); if (st->requested_idx < (st->current_idx + size)) { st->activity = (LinphonePresenceActivity *)bctbx_list_nth_data(person->activities, st->requested_idx - st->current_idx); st->current_idx = (unsigned)-1; @@ -471,10 +471,8 @@ struct _find_note_st { }; static LinphonePresenceNote * find_presence_note_in_list(bctbx_list_t *list, const char *lang) { - int nb; int i; - - nb = bctbx_list_size(list); + int nb = (int)bctbx_list_size(list); for (i = 0; i < nb; i++) { LinphonePresenceNote *note = (LinphonePresenceNote *)bctbx_list_nth_data(list, i); if (lang == NULL) { @@ -632,7 +630,7 @@ LinphonePresenceModel * linphone_presence_model_new(void) { } unsigned int linphone_presence_model_get_nb_services(const LinphonePresenceModel *model) { - return bctbx_list_size(model->services); + return (unsigned int)bctbx_list_size(model->services); } LinphonePresenceService * linphone_presence_model_get_nth_service(const LinphonePresenceModel *model, unsigned int idx) { @@ -658,7 +656,7 @@ int linphone_presence_model_clear_services(LinphonePresenceModel *model) { } unsigned int linphone_presence_model_get_nb_persons(const LinphonePresenceModel *model) { - return bctbx_list_size(model->persons); + return (unsigned int)bctbx_list_size(model->persons); } LinphonePresencePerson * linphone_presence_model_get_nth_person(const LinphonePresenceModel *model, unsigned int idx) { @@ -762,7 +760,7 @@ int linphone_presence_service_set_contact(LinphonePresenceService *service, cons } unsigned int linphone_presence_service_get_nb_notes(const LinphonePresenceService *service) { - return bctbx_list_size(service->notes); + return (unsigned int)bctbx_list_size(service->notes); } LinphonePresenceNote * linphone_presence_service_get_nth_note(const LinphonePresenceService *service, unsigned int idx) { @@ -815,7 +813,7 @@ int linphone_presence_person_set_id(LinphonePresencePerson *person, const char * unsigned int linphone_presence_person_get_nb_activities(const LinphonePresencePerson *person) { if (person == NULL) return 0; - return bctbx_list_size(person->activities); + return (unsigned int)bctbx_list_size(person->activities); } LinphonePresenceActivity * linphone_presence_person_get_nth_activity(const LinphonePresencePerson *person, unsigned int idx) { @@ -841,7 +839,7 @@ int linphone_presence_person_clear_activities(LinphonePresencePerson *person) { unsigned int linphone_presence_person_get_nb_notes(const LinphonePresencePerson *person) { if (person == NULL) return 0; - return bctbx_list_size(person->notes); + return (unsigned int)bctbx_list_size(person->notes); } LinphonePresenceNote * linphone_presence_person_get_nth_note(const LinphonePresencePerson *person, unsigned int idx) { @@ -866,7 +864,7 @@ int linphone_presence_person_clear_notes(LinphonePresencePerson *person) { unsigned int linphone_presence_person_get_nb_activities_notes(const LinphonePresencePerson *person) { if (person == NULL) return 0; - return bctbx_list_size(person->activities_notes); + return (unsigned int)bctbx_list_size(person->activities_notes); } LinphonePresenceNote * linphone_presence_person_get_nth_activities_note(const LinphonePresencePerson *person, unsigned int idx) { diff --git a/coreapi/sal.c b/coreapi/sal.c index a54df1611..05b472fd1 100644 --- a/coreapi/sal.c +++ b/coreapi/sal.c @@ -854,7 +854,7 @@ const char* sal_privacy_to_string(SalPrivacy privacy) { } static void remove_trailing_spaces(char *line){ - int i; + size_t i; for(i=strlen(line)-1;i>=0;--i){ if (isspace(line[i])) line[i]='\0'; else break; diff --git a/tester/call_multi_tester.c b/tester/call_multi_tester.c index fbece53c6..f73698964 100644 --- a/tester/call_multi_tester.c +++ b/tester/call_multi_tester.c @@ -342,7 +342,7 @@ static void simple_conference_base(LinphoneCoreManager* marie, LinphoneCoreManag BC_ASSERT_PTR_NOT_NULL(conference = linphone_core_get_conference(marie->lc)); if(conference) { bctbx_list_t *participants = linphone_conference_get_participants(conference); - BC_ASSERT_EQUAL(bctbx_list_size(participants), 2, int, "%d"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(participants), 2, unsigned int, "%u"); bctbx_list_free_with_data(participants, (void(*)(void *))linphone_address_destroy); } @@ -716,7 +716,7 @@ static void eject_from_3_participants_conference(LinphoneCoreManager *marie, Lin BC_ASSERT_TRUE(wait_for_list(lcs,&laure->stat.number_of_LinphoneCallStreamsRunning,3,10000)); BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallStreamsRunning,5,10000)); BC_ASSERT_PTR_NOT_NULL(linphone_core_get_current_call(marie->lc)); - BC_ASSERT_EQUAL(bctbx_list_size(linphone_core_get_calls(marie->lc)), 2, int, "%d"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(linphone_core_get_calls(marie->lc)), 2, unsigned int, "%u"); BC_ASSERT_PTR_NOT_NULL(linphone_core_get_current_call(pauline->lc)); BC_ASSERT_PTR_NOT_NULL(linphone_core_get_current_call(laure->lc)); } else { @@ -811,7 +811,7 @@ static void eject_from_4_participants_conference(void) { BC_ASSERT_PTR_NULL(linphone_core_get_current_call(marie->lc)); BC_ASSERT_TRUE(linphone_core_is_in_conference(marie->lc)); BC_ASSERT_EQUAL(linphone_core_get_conference_size(marie->lc),3, int, "%d"); - BC_ASSERT_EQUAL(bctbx_list_size(linphone_core_get_calls(marie->lc)), 3, int, "%d"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(linphone_core_get_calls(marie->lc)), 3, unsigned int, "%u"); BC_ASSERT_PTR_NOT_NULL(linphone_core_get_current_call(pauline->lc)); BC_ASSERT_PTR_NOT_NULL(linphone_core_get_current_call(laure->lc)); BC_ASSERT_PTR_NOT_NULL(linphone_core_get_current_call(michelle->lc)); diff --git a/tester/call_single_tester.c b/tester/call_single_tester.c index 6fcc548ff..5bd6a7821 100644 --- a/tester/call_single_tester.c +++ b/tester/call_single_tester.c @@ -4359,7 +4359,7 @@ static void call_logs_migrate(void) { BC_ASSERT_TRUE(linphone_core_get_call_history_size(laure->lc) == 10); for (; i < bctbx_list_size(laure->lc->call_logs); i++) { - LinphoneCallLog *log = bctbx_list_nth_data(laure->lc->call_logs, i); + LinphoneCallLog *log = bctbx_list_nth_data(laure->lc->call_logs, (int)i); LinphoneCallStatus state = linphone_call_log_get_status(log); LinphoneCallDir direction = linphone_call_log_get_dir(log); diff --git a/tester/complex_sip_case_tester.c b/tester/complex_sip_case_tester.c index 1e524bb2c..6e9aa8dc4 100644 --- a/tester/complex_sip_case_tester.c +++ b/tester/complex_sip_case_tester.c @@ -23,6 +23,7 @@ #include "private.h" +#if HAVE_SIPP void check_rtcp(LinphoneCall *call) { MSTimeSpec ts; @@ -45,7 +46,6 @@ void check_rtcp(LinphoneCall *call) { } FILE *sip_start(const char *senario, const char* dest_username, const char *passwd, LinphoneAddress* dest_addres) { -#if HAVE_SIPP char *dest; char *command; FILE *file; @@ -65,14 +65,10 @@ FILE *sip_start(const char *senario, const char* dest_username, const char *pass ms_free(command); ms_free(dest); return file; -#else - return NULL; -#endif } static FILE *sip_start_recv(const char *senario) { -#if HAVE_SIPP char *command; FILE *file; @@ -83,9 +79,6 @@ static FILE *sip_start_recv(const char *senario) { file = popen(command, "r"); ms_free(command); return file; -#else - return NULL; -#endif } static void dest_server_server_resolved(void *data, const char *name, struct addrinfo *ai_list) { @@ -359,6 +352,7 @@ static test_t tests[] = { TEST_NO_TAG("Call with multiple video mline in sdp", call_with_multiple_video_mline_in_sdp), TEST_NO_TAG("Call invite 200ok without contact header", call_invite_200ok_without_contact_header) }; +#endif test_suite_t complex_sip_call_test_suite = { "Complex SIP Case", @@ -366,6 +360,11 @@ test_suite_t complex_sip_call_test_suite = { NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, +#if HAVE_SIPP sizeof(tests) / sizeof(tests[0]), tests +#else + 0, + NULL +#endif }; diff --git a/tester/flexisip_tester.c b/tester/flexisip_tester.c index 1310aab47..d6dcb3ef0 100644 --- a/tester/flexisip_tester.c +++ b/tester/flexisip_tester.c @@ -962,7 +962,7 @@ static void dos_module_trigger(void) { linphone_core_manager_destroy(pauline); } - +#if HAVE_SIPP static void test_subscribe_notify_with_sipp_publisher(void) { char *scen; FILE * sipp_out; @@ -1004,7 +1004,8 @@ static void test_subscribe_notify_with_sipp_publisher(void) { linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); } - //does not work because sipp seams not able to manage 2 call id in case file + +//does not work because sipp seams not able to manage 2 call id in case file #if 0 static void test_subscribe_notify_with_sipp_publisher_double_publish(void) { char *scen; @@ -1046,6 +1047,7 @@ static void test_subscribe_notify_with_sipp_publisher_double_publish(void) { linphone_core_manager_destroy(pauline); } #endif +#endif static void test_publish_unpublish(void) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); @@ -1142,6 +1144,7 @@ static void test_list_subscribe (void) { linphone_core_manager_destroy(laure); } +#if HAVE_SIPP static void test_subscribe_on_wrong_dialog(void) { char *scen; FILE * sipp_out; @@ -1162,6 +1165,7 @@ static void test_subscribe_on_wrong_dialog(void) { linphone_core_manager_destroy(marie); } +#endif test_t flexisip_tests[] = { @@ -1183,15 +1187,19 @@ test_t flexisip_tests[] = { TEST_NO_TAG("Call ipv6 to ipv6", call_with_ipv6), TEST_NO_TAG("Call ipv6 to ipv4", call_ipv6_to_ipv4), TEST_NO_TAG("Call ipv4 to ipv6", call_ipv4_to_ipv6), +#if HAVE_SIPP TEST_ONE_TAG("Subscribe Notify with sipp publisher", test_subscribe_notify_with_sipp_publisher, "LeaksMemory"), /*TEST_ONE_TAG("Subscribe Notify with sipp double publish", test_subscribe_notify_with_sipp_publisher_double_publish, "LeaksMemory"),*/ +#endif TEST_NO_TAG("Publish/unpublish", test_publish_unpublish), TEST_ONE_TAG("List subscribe", test_list_subscribe,"LeaksMemory"), TEST_NO_TAG("File transfer message rcs to external body client", file_transfer_message_rcs_to_external_body_client), TEST_ONE_TAG("File transfer message external body to rcs client", file_transfer_message_external_body_to_rcs_client, "LeaksMemory"), TEST_ONE_TAG("File transfer message external body to external body client", file_transfer_message_external_body_to_external_body_client, "LeaksMemory"), TEST_NO_TAG("DoS module trigger by sending a lot of chat messages", dos_module_trigger), +#if HAVE_SIPP TEST_NO_TAG("Subscribe on wrong dialog", test_subscribe_on_wrong_dialog) +#endif }; test_suite_t flexisip_test_suite = {"Flexisip", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/message_tester.c b/tester/message_tester.c index abdf8edf2..6f535ee9b 100644 --- a/tester/message_tester.c +++ b/tester/message_tester.c @@ -362,7 +362,7 @@ static void text_message_with_send_error(void) { linphone_chat_room_send_chat_message(chat_room,msg); /* check transient msg list: the msg should be in it, and should be the only one */ - BC_ASSERT_EQUAL(bctbx_list_size(chat_room->transient_messages), 1, int, "%d"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(chat_room->transient_messages), 1, unsigned int, "%u"); BC_ASSERT_PTR_EQUAL(bctbx_list_nth_data(chat_room->transient_messages,0), msg); BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageNotDelivered,1)); @@ -370,7 +370,7 @@ static void text_message_with_send_error(void) { BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageReceived,0, int, "%d"); /* the msg should have been discarded from transient list after an error */ - BC_ASSERT_EQUAL(bctbx_list_size(chat_room->transient_messages), 0, int, "%d"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(chat_room->transient_messages), 0, unsigned int, "%u"); sal_set_send_error(marie->lc->sal, 0); @@ -396,7 +396,7 @@ static void text_message_with_external_body(void) { linphone_chat_room_send_chat_message(chat_room,msg); /* check transient msg list: the msg should be in it, and should be the only one */ - BC_ASSERT_EQUAL(bctbx_list_size(chat_room->transient_messages), 1, int, "%d"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(chat_room->transient_messages), 1, unsigned int, "%u"); BC_ASSERT_PTR_EQUAL(bctbx_list_nth_data(chat_room->transient_messages,0), msg); BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageReceived,1)); @@ -405,7 +405,7 @@ static void text_message_with_external_body(void) { BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageInProgress,1, int, "%d"); BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageExtBodyReceived,1, int, "%d"); - BC_ASSERT_EQUAL(bctbx_list_size(chat_room->transient_messages), 0, int, "%d"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(chat_room->transient_messages), 0, unsigned int, "%u"); linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); @@ -615,7 +615,7 @@ static void file_transfer_2_messages_simultaneously(void) { cbs = linphone_chat_message_get_callbacks(msg2); linphone_chat_message_cbs_set_msg_state_changed(cbs,liblinphone_tester_chat_message_msg_state_changed); - BC_ASSERT_EQUAL(bctbx_list_size(linphone_core_get_chat_rooms(marie->lc)), 0, int, "%d"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(linphone_core_get_chat_rooms(marie->lc)), 0, unsigned int, "%u"); if (bctbx_list_size(linphone_core_get_chat_rooms(marie->lc)) == 0) { linphone_chat_room_send_chat_message(pauline_room,msg); linphone_chat_room_send_chat_message(pauline_room,msg2); @@ -623,7 +623,7 @@ static void file_transfer_2_messages_simultaneously(void) { msg = linphone_chat_message_clone(marie->stat.last_received_chat_message); BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageReceivedWithFile,2)); msg2 = marie->stat.last_received_chat_message; - BC_ASSERT_EQUAL(bctbx_list_size(linphone_core_get_chat_rooms(marie->lc)), 1, int, "%d"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(linphone_core_get_chat_rooms(marie->lc)), 1, unsigned int, "%u"); if (bctbx_list_size(linphone_core_get_chat_rooms(marie->lc)) != 1) { char * buf = ms_strdup_printf("Found %d rooms instead of 1: ", bctbx_list_size(linphone_core_get_chat_rooms(marie->lc))); const bctbx_list_t *it = linphone_core_get_chat_rooms(marie->lc); @@ -1028,12 +1028,12 @@ static void lime_unit(void) { ms_message("session index %d\n", associatedKey.sessionIndex); /* encrypt/decrypt a msg */ - lime_encryptMessage(associatedKeys.peerKeys[0], (uint8_t *)PLAIN_TEXT_TEST_MESSAGE, strlen(PLAIN_TEXT_TEST_MESSAGE), senderZID, encryptedMessage); + lime_encryptMessage(associatedKeys.peerKeys[0], (uint8_t *)PLAIN_TEXT_TEST_MESSAGE, (uint32_t)strlen(PLAIN_TEXT_TEST_MESSAGE), senderZID, encryptedMessage); printHex("Ciphered", encryptedMessage, strlen((char *)encryptedMessage)); /* invert sender and receiverZID to decrypt/authenticate */ memcpy(receiverZID, associatedKeys.peerKeys[0]->peerZID, 12); memcpy(associatedKeys.peerKeys[0]->peerZID, senderZID, 12); - retval = lime_decryptMessage(associatedKeys.peerKeys[0], encryptedMessage, strlen(PLAIN_TEXT_TEST_MESSAGE)+16, receiverZID, plainMessage); + retval = lime_decryptMessage(associatedKeys.peerKeys[0], encryptedMessage, (uint32_t)strlen(PLAIN_TEXT_TEST_MESSAGE)+16, receiverZID, plainMessage); BC_ASSERT_EQUAL(retval, 0, int, "%d"); BC_ASSERT_STRING_EQUAL((char *)plainMessage, (char *)PLAIN_TEXT_TEST_MESSAGE); ms_message("Decrypt and auth returned %d\nPlain text is %s\n", retval, plainMessage); @@ -1190,9 +1190,9 @@ int check_no_strange_time(void* data,int argc, char** argv,char** cNames) { return 0; } -void history_message_count_helper(LinphoneChatRoom* chatroom, int x, int y, int expected ){ +void history_message_count_helper(LinphoneChatRoom* chatroom, int x, int y, unsigned int expected ){ bctbx_list_t* messages = linphone_chat_room_get_history_range(chatroom, x, y); - BC_ASSERT_EQUAL(bctbx_list_size(messages), expected, int, "%d"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(messages), expected, unsigned int, "%u"); bctbx_list_free_with_data(messages, (void (*)(void *))linphone_chat_message_unref); } @@ -1288,16 +1288,16 @@ static void history_count(void) { BC_ASSERT_PTR_NOT_NULL(chatroom); if (chatroom){ messages=linphone_chat_room_get_history(chatroom,10); - BC_ASSERT_EQUAL(bctbx_list_size(messages), 10, int, "%d"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(messages), 10, unsigned int, "%u"); bctbx_list_free_with_data(messages, (void (*)(void*))linphone_chat_message_unref); messages=linphone_chat_room_get_history(chatroom,1); - BC_ASSERT_EQUAL(bctbx_list_size(messages), 1, int, "%d"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(messages), 1, unsigned int, "%u"); bctbx_list_free_with_data(messages, (void (*)(void*))linphone_chat_message_unref); messages=linphone_chat_room_get_history(chatroom,0); BC_ASSERT_EQUAL(linphone_chat_room_get_history_size(chatroom), 1270, int, "%d"); - BC_ASSERT_EQUAL(bctbx_list_size(messages), 1270, int, "%d"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(messages), 1270, unsigned int, "%u"); /*check the second most recent msg*/ BC_ASSERT_PTR_NOT_NULL(messages); @@ -1312,23 +1312,23 @@ static void history_count(void) { /*test offset+limit: retrieve the 42th latest msg only and check its content*/ messages=linphone_chat_room_get_history_range(chatroom, 42, 42); - BC_ASSERT_EQUAL(bctbx_list_size(messages), 1, int, "%d"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(messages), 1, unsigned int, "%u"); BC_ASSERT_STRING_EQUAL(linphone_chat_message_get_text((LinphoneChatMessage *)messages->data), "If you open yourself to the Tao is intangible and evasive, yet prefers to keep us at the mercy of the kingdom, then all of the streams of hundreds of valleys because of its limitless possibilities."); bctbx_list_free_with_data(messages, (void (*)(void*))linphone_chat_message_unref); /*test offset without limit*/ messages = linphone_chat_room_get_history_range(chatroom, 1265, -1); - BC_ASSERT_EQUAL(bctbx_list_size(messages), 1270-1265, int, "%d"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(messages), 1270-1265, unsigned int, "%u"); bctbx_list_free_with_data(messages, (void (*)(void*))linphone_chat_message_unref); /*test limit without offset*/ messages = linphone_chat_room_get_history_range(chatroom, 0, 5); - BC_ASSERT_EQUAL(bctbx_list_size(messages), 6, int, "%d"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(messages), 6, unsigned int, "%u"); bctbx_list_free_with_data(messages, (void (*)(void*))linphone_chat_message_unref); /*test invalid start*/ messages = linphone_chat_room_get_history_range(chatroom, 1265, 1260); - BC_ASSERT_EQUAL(bctbx_list_size(messages), 1270-1265, int, "%d"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(messages), 1270-1265, unsigned int, "%u"); bctbx_list_free_with_data(messages, (void (*)(void*))linphone_chat_message_unref); } @@ -1476,7 +1476,7 @@ static void real_time_text(bool_t audio_stream_enabled, bool_t srtp_enabled, boo for (i = 0; i < strlen(message); i++) { BC_ASSERT_FALSE(linphone_chat_message_put_char(rtt_message, message[i])); - BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneIsComposingActiveReceived, i+1, 1000)); + BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneIsComposingActiveReceived, (int)i+1, 1000)); BC_ASSERT_EQUAL(linphone_chat_room_get_char(marie_chat_room), message[i], char, "%c"); } linphone_chat_room_send_chat_message(pauline_chat_room, rtt_message); @@ -1488,11 +1488,11 @@ static void real_time_text(bool_t audio_stream_enabled, bool_t srtp_enabled, boo LinphoneChatMessage *marie_msg = NULL; LinphoneChatMessage *pauline_msg = NULL; if (do_not_store_rtt_messages_in_sql_storage) { - BC_ASSERT_EQUAL(bctbx_list_size(marie_messages), 0, int , "%i"); - BC_ASSERT_EQUAL(bctbx_list_size(pauline_messages), 0, int , "%i"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(marie_messages), 0, unsigned int , "%u"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(pauline_messages), 0, unsigned int , "%u"); } else { - BC_ASSERT_EQUAL(bctbx_list_size(marie_messages), 1, int , "%i"); - BC_ASSERT_EQUAL(bctbx_list_size(pauline_messages), 1, int , "%i"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(marie_messages), 1, unsigned int , "%u"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(pauline_messages), 1, unsigned int , "%u"); if (!marie_messages || !pauline_messages) { goto end; } @@ -1569,11 +1569,11 @@ static void real_time_text_conversation(void) { for (i = 0; i < strlen(message1_1); i++) { linphone_chat_message_put_char(pauline_rtt_message, message1_1[i]); - BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneIsComposingActiveReceived, i+1, 1000)); + BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneIsComposingActiveReceived, (int)i+1, 1000)); BC_ASSERT_EQUAL(linphone_chat_room_get_char(marie_chat_room), message1_1[i], char, "%c"); linphone_chat_message_put_char(marie_rtt_message, message1_2[i]); - BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &pauline->stat.number_of_LinphoneIsComposingActiveReceived, i+1, 1000)); + BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &pauline->stat.number_of_LinphoneIsComposingActiveReceived, (int)i+1, 1000)); BC_ASSERT_EQUAL(linphone_chat_room_get_char(pauline_chat_room), message1_2[i], char, "%c"); } @@ -1605,11 +1605,11 @@ static void real_time_text_conversation(void) { for (i = 0; i < strlen(message2_1); i++) { linphone_chat_message_put_char(pauline_rtt_message, message2_1[i]); - BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneIsComposingActiveReceived, i+1, 1000)); + BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneIsComposingActiveReceived, (int)i+1, 1000)); BC_ASSERT_EQUAL(linphone_chat_room_get_char(marie_chat_room), message2_1[i], char, "%c"); linphone_chat_message_put_char(marie_rtt_message, message2_2[i]); - BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &pauline->stat.number_of_LinphoneIsComposingActiveReceived, i+1, 1000)); + BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &pauline->stat.number_of_LinphoneIsComposingActiveReceived, (int)i+1, 1000)); BC_ASSERT_EQUAL(linphone_chat_room_get_char(pauline_chat_room), message2_2[i], char, "%c"); } @@ -1680,7 +1680,7 @@ static void real_time_text_message_compat(bool_t end_with_crlf, bool_t end_with_ for (i = 0; i < strlen(message); i++) { linphone_chat_message_put_char(rtt_message, message[i]); - BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneIsComposingActiveReceived, i+1, 1000)); + BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneIsComposingActiveReceived, (int)i+1, 1000)); BC_ASSERT_EQUAL(linphone_chat_room_get_char(marie_chat_room), message[i], char, "%c"); } @@ -1689,7 +1689,7 @@ static void real_time_text_message_compat(bool_t end_with_crlf, bool_t end_with_ } else if (end_with_lf) { linphone_chat_message_put_char(rtt_message, lf); } - BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneIsComposingActiveReceived, strlen(message), 1000)); + BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneIsComposingActiveReceived, (int)strlen(message), 1000)); BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneMessageReceived, 1)); linphone_chat_message_unref(rtt_message); } @@ -1794,7 +1794,7 @@ static void real_time_text_copy_paste(void) { linphone_chat_message_put_char(rtt_message, message[i-1]); if (i % 4 == 0) { int j; - BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneIsComposingActiveReceived, i, 1000)); + BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneIsComposingActiveReceived, (int)i, 1000)); for (j = 4; j > 0; j--) { BC_ASSERT_EQUAL(linphone_chat_room_get_char(marie_chat_room), message[i-j], char, "%c"); } diff --git a/tester/presence_tester.c b/tester/presence_tester.c index 6bb1771bd..042dff08f 100644 --- a/tester/presence_tester.c +++ b/tester/presence_tester.c @@ -529,7 +529,7 @@ static void simple_subscribe_with_friend_from_rc(void) { LinphoneCoreManager *marie = presence_linphone_core_manager_new_with_rc_name("marie", "pauline_as_friend_rc"); LinphoneFriend *pauline_as_friend; - BC_ASSERT_EQUAL(bctbx_list_size(linphone_core_get_friend_list(marie->lc)), 1, int , "%i"); + BC_ASSERT_EQUAL((unsigned int)bctbx_list_size(linphone_core_get_friend_list(marie->lc)), 1, unsigned int , "%u"); if (bctbx_list_size(linphone_core_get_friend_list(marie->lc))>0) { pauline_as_friend = (LinphoneFriend*)linphone_core_get_friend_list(marie->lc)->data; diff --git a/tester/quality_reporting_tester.c b/tester/quality_reporting_tester.c index 31ec4d7a5..ad6563ecc 100644 --- a/tester/quality_reporting_tester.c +++ b/tester/quality_reporting_tester.c @@ -406,7 +406,7 @@ static void quality_reporting_interval_report_video_and_rtt(void) { for (i = 0; i < strlen(message); i++) { linphone_chat_message_put_char(rtt_message, message[i]); - BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneIsComposingActiveReceived, i+1, 1000)); + BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneIsComposingActiveReceived, (int)i+1, 1000)); BC_ASSERT_EQUAL(linphone_chat_room_get_char(marie_chat_room), message[i], char, "%c"); } linphone_chat_room_send_chat_message(pauline_chat_room, rtt_message); diff --git a/tester/register_tester.c b/tester/register_tester.c index d9a33a4e2..d8392a1e2 100644 --- a/tester/register_tester.c +++ b/tester/register_tester.c @@ -505,7 +505,7 @@ static LinphoneCoreManager* configure_lcm(void) { if (transport_supported(LinphoneTransportTls)) { LinphoneCoreManager *lcm=linphone_core_manager_new2( "multi_account_rc", FALSE); stats *counters=&lcm->stat; - BC_ASSERT_TRUE(wait_for(lcm->lc,lcm->lc,&counters->number_of_LinphoneRegistrationOk,bctbx_list_size(linphone_core_get_proxy_config_list(lcm->lc)))); + BC_ASSERT_TRUE(wait_for(lcm->lc,lcm->lc,&counters->number_of_LinphoneRegistrationOk,(int)bctbx_list_size(linphone_core_get_proxy_config_list(lcm->lc)))); BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationFailed,0, int, "%d"); return lcm; } @@ -567,7 +567,7 @@ static void transport_change(void){ register_ok=counters->number_of_LinphoneRegistrationOk; number_of_udp_proxy=get_number_of_udp_proxy(lc); - total_number_of_proxies=bctbx_list_size(linphone_core_get_proxy_config_list(lc)); + total_number_of_proxies=(int)bctbx_list_size(linphone_core_get_proxy_config_list(lc)); linphone_core_get_sip_transports(lc,&sip_tr_orig); sip_tr.udp_port=sip_tr_orig.udp_port; @@ -739,7 +739,7 @@ static void io_recv_error_late_recovery(void){ lc=lcm->lc; sal_set_refresher_retry_after(lc->sal,1000); counters=&lcm->stat; - BC_ASSERT_TRUE(wait_for(lcm->lc,lcm->lc,&counters->number_of_LinphoneRegistrationOk,bctbx_list_size(linphone_core_get_proxy_config_list(lcm->lc)))); + BC_ASSERT_TRUE(wait_for(lcm->lc,lcm->lc,&counters->number_of_LinphoneRegistrationOk,(int)bctbx_list_size(linphone_core_get_proxy_config_list(lcm->lc)))); counters = get_stats(lc); @@ -791,7 +791,7 @@ static void io_recv_error_without_active_register(void){ /*nothing should happen because no active registration*/ wait_for_until(lc,lc, &dummy, 1, 3000); - BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationProgress, bctbx_list_size(linphone_core_get_proxy_config_list(lc)), int, "%d"); + BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationProgress, (int)bctbx_list_size(linphone_core_get_proxy_config_list(lc)), int, "%d"); BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationFailed,0,int,"%d"); diff --git a/tester/tester.c b/tester/tester.c index 69d51f4c8..5c5f8c97a 100644 --- a/tester/tester.c +++ b/tester/tester.c @@ -358,7 +358,7 @@ void linphone_core_manager_start(LinphoneCoreManager *mgr, int check_for_proxies /*BC_ASSERT_EQUAL(bctbx_list_size(linphone_core_get_proxy_config_list(lc)),proxy_count, int, "%d");*/ if (check_for_proxies){ /**/ - proxy_count=bctbx_list_size(linphone_core_get_proxy_config_list(mgr->lc)); + proxy_count=(int)bctbx_list_size(linphone_core_get_proxy_config_list(mgr->lc)); }else{ proxy_count=0; /*this is to prevent registration to go on*/