diff --git a/CMakeLists.txt b/CMakeLists.txt index b1debeaf0..ee02b53b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -258,7 +258,8 @@ else() list(APPEND STRICT_OPTIONS_CPP "-Wno-error=unknown-warning-option" "-Qunused-arguments" "-Wno-tautological-compare" "-Wno-unused-function" "-Wno-array-bounds") endif() if(ENABLE_STRICT) - list(APPEND STRICT_OPTIONS_CPP "-Werror" "-Wextra" "-Wno-unused-parameter" "-fno-strict-aliasing") + list(APPEND STRICT_OPTIONS_C "-Werror" "-Wextra" "-Wno-unused-parameter" "-Wno-missing-field-initializers" "-fno-strict-aliasing") + list(APPEND STRICT_OPTIONS_CPP "-Werror" "-Wextra" "-Wno-unused-parameter" "-Wno-missing-field-initializers" "-fno-strict-aliasing") endif() endif() if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") diff --git a/configure.ac b/configure.ac index f699abdb8..80c7c7b4d 100644 --- a/configure.ac +++ b/configure.ac @@ -802,7 +802,7 @@ case "$target_os" in ;; esac if test "$strictness" = "yes" ; then - STRICT_OPTIONS="$STRICT_OPTIONS -Werror -Wextra -Wno-unused-parameter -Wno-error=deprecated-declarations -Wno-error=strict-prototypes" + STRICT_OPTIONS="$STRICT_OPTIONS -Werror -Wextra -Wno-unused-parameter -Wno-error=deprecated-declarations -Wno-error=strict-prototypes -Wno-missing-field-initializers" CFLAGS="$CFLAGS -fno-strict-aliasing" fi diff --git a/console/commands.c b/console/commands.c index 03610f4c4..72510bd65 100644 --- a/console/commands.c +++ b/console/commands.c @@ -328,12 +328,11 @@ static LPC_COMMAND advanced_commands[] = { "'snapshot ': take a snapshot and records it in jpeg format into the supplied path\n" }, { "preview-snapshot", lpc_cmd_preview_snapshot, "Take a snapshot of currently captured video stream", - "'preview-snapshot ': take a snapshot and records it in jpeg format into the supplied path\n", - NULL + "'preview-snapshot ': take a snapshot and records it in jpeg format into the supplied path\n" }, { "vfureq", lpc_cmd_vfureq, "Request the other side to send VFU for the current call", NULL -}, + }, #endif { "states", lpc_cmd_states, "Show internal states of liblinphone, registrations and calls, according to linphonecore.h definitions", "'states global': shows global state of liblinphone \n" diff --git a/coreapi/help/filetransfer.c b/coreapi/help/filetransfer.c index bc321d54f..a6bfbd346 100644 --- a/coreapi/help/filetransfer.c +++ b/coreapi/help/filetransfer.c @@ -74,12 +74,11 @@ static void file_transfer_received(LinphoneChatMessage *message, const LinphoneC file = (FILE*)linphone_chat_message_get_user_data(message); if (linphone_buffer_is_empty(buffer)) { printf("File transfert completed\n"); - linphone_chat_room_destroy(linphone_chat_message_get_chat_room(message)); linphone_chat_message_destroy(message); fclose(file); running=FALSE; } else { /* store content on a file*/ - if (fwrite(linphone_buffer_get_content(buffer),linphone_buffer_get_size(buffer),1,file)==-1){ + if (fwrite(linphone_buffer_get_content(buffer),linphone_buffer_get_size(buffer),1,file)==0){ ms_warning("file_transfer_received() write failed: %s",strerror(errno)); } } @@ -99,7 +98,7 @@ static LinphoneBuffer * file_transfer_send(LinphoneChatMessage *message, const /* * Call back to get delivery status of a message * */ -static void linphone_file_transfer_state_changed(LinphoneChatMessage* msg,LinphoneChatMessageState state,void* ud) { +static void linphone_file_transfer_state_changed(LinphoneChatMessage* msg,LinphoneChatMessageState state) { const LinphoneAddress* to_address = linphone_chat_message_get_to(msg); char *to = linphone_address_as_string(to_address); printf("File transfer sent to [%s] delivery status is [%s] \n" , to @@ -114,7 +113,7 @@ static void message_received(LinphoneCore *lc, LinphoneChatRoom *cr, LinphoneCha const LinphoneContent *file_transfer_info = linphone_chat_message_get_file_transfer_information(msg); printf ("Do you really want to download %s (size %ld)?[Y/n]\nOk, let's go\n", linphone_content_get_name(file_transfer_info), (long int)linphone_content_get_size(file_transfer_info)); - linphone_chat_message_start_file_download(msg, linphone_file_transfer_state_changed, NULL); + linphone_chat_message_download_file(msg); } @@ -123,7 +122,7 @@ int main(int argc, char *argv[]){ LinphoneCoreVTable vtable={0}; const char* dest_friend=NULL; - int i; + size_t i; const char* big_file_content="big file"; LinphoneChatRoom* chat_room; LinphoneContent* content; @@ -183,6 +182,7 @@ int main(int argc, char *argv[]){ linphone_chat_message_cbs_set_file_transfer_recv(cbs, file_transfer_received); linphone_chat_message_cbs_set_file_transfer_send(cbs, file_transfer_send); linphone_chat_message_cbs_set_file_transfer_progress_indication(cbs, file_transfer_progress_indication); + linphone_chat_message_cbs_set_msg_state_changed(cbs, linphone_file_transfer_state_changed); /*initiating file transfer*/ linphone_chat_room_send_chat_message(chat_room, chat_message); diff --git a/mediastreamer2 b/mediastreamer2 index 48be3ac60..72e76d6dc 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 48be3ac6009fc933ff43bceda80d7f26067e5c72 +Subproject commit 72e76d6dce55722dfde9d864f0b7dbb10781c040