diff --git a/sflphone-client-gnome/configure.ac b/sflphone-client-gnome/configure.ac index 1edc2268545149c064df0393b345a79331dd7539..1e94d1923e118e4e2cb024d86334997d335c8729 100644 --- a/sflphone-client-gnome/configure.ac +++ b/sflphone-client-gnome/configure.ac @@ -21,12 +21,13 @@ AC_ARG_WITH(debug, [with_debug=no] ) if test "x$with_debug" = "xfull" -o "x$with_debug" = "xyes"; then - CFLAGS="-g -O0 -DDEBUG -Wall -Wextra" + CFLAGS="-g -O0 -Wall -Wextra" else CFLAGS="$CFLAGS -Wall -Wextra" fi AC_PROG_CC +AM_PROG_CC_C_O dnl for per target flags, i.e. test_program_CFLAGS AC_PROG_INSTALL AC_HEADER_STDC LT_INIT diff --git a/sflphone-client-gnome/src/accountlist.c b/sflphone-client-gnome/src/accountlist.c index cf3e96c2ddedab5f6e169b911de0fcc0c64f4131..c3216468846405017c5a362720c26a67fd6cec70 100644 --- a/sflphone-client-gnome/src/accountlist.c +++ b/sflphone-client-gnome/src/accountlist.c @@ -275,46 +275,6 @@ gchar* account_list_get_current_id (void) return ""; } -int account_list_get_sip_account_number (void) -{ - - int n; - guint size, i; - account_t *current; - - size = account_list_get_size(); - n = 0; - - for (i=0; i<size ; i++) { - current = account_list_get_nth (i); - - if (strcmp (g_hash_table_lookup (current->properties, ACCOUNT_TYPE), "SIP") == 0) - n++; - } - - return n; -} - -int account_list_get_iax_account_number (void) -{ - - int n; - guint size, i; - account_t *current; - - size = account_list_get_size(); - n = 0; - - for (i=0; i<size ; i++) { - current = account_list_get_nth (i); - - if (strcmp (g_hash_table_lookup (current->properties, ACCOUNT_TYPE), "IAX") == 0) - n++; - } - - return n; -} - gchar * account_list_get_ordered_list (void) { @@ -407,4 +367,3 @@ gboolean current_account_has_new_message (void) return FALSE; } - diff --git a/sflphone-client-gnome/src/accountlist.h b/sflphone-client-gnome/src/accountlist.h index bc893a4900e0cdad0db18d2d0030c6516414abc1..46103121e9f71556e9f86c0ed2291959eb6465f3 100644 --- a/sflphone-client-gnome/src/accountlist.h +++ b/sflphone-client-gnome/src/accountlist.h @@ -191,16 +191,6 @@ void account_list_move_down (guint index); */ gchar* account_list_get_current_id (void); -/** - * Returns the number of SIP accounts that have been configured - */ -int account_list_get_sip_account_number (void); - -/** - * Returns the number of IAX accounts that have been configured - */ -int account_list_get_iax_account_number (void); - gchar * account_list_get_ordered_list (void); guint account_list_get_position (account_t *account); diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c index e07387a767a79b205e4dadb828526664a2a35464..885cd57d0d059d1f6708d5d013398c3d8e947812 100644 --- a/sflphone-client-gnome/src/actions.c +++ b/sflphone-client-gnome/src/actions.c @@ -1367,7 +1367,7 @@ void sflphone_fill_conference_list (void) void sflphone_fill_history (void) { - const gchar **entries, **history_entries; + const gchar **entries; gchar *current_entry; callable_obj_t *history_call, *call; conference_obj_t *history_conf, *conf; @@ -1428,7 +1428,7 @@ void sflphone_fill_history (void) entries++; } - // fill the treeview wtih calls + // fill the treeview with calls n = calllist_get_size(history); for(i = 0; i < n; i++) { element = calllist_get_nth(history, i); diff --git a/sflphone-client-gnome/src/callable_obj.c b/sflphone-client-gnome/src/callable_obj.c index f5e4df49495cbc250085fc4aa1cd17ddd8cc7800..97d722a1985c1cafd285de9b8a9c2b8d0d72bde3 100644 --- a/sflphone-client-gnome/src/callable_obj.c +++ b/sflphone-client-gnome/src/callable_obj.c @@ -214,7 +214,6 @@ void create_new_call (callable_type_t type, call_state_t state, gchar* callID , GError *err1 = NULL ; callable_obj_t *obj; - gchar *call_id; DEBUG ("CallableObj: Create new call"); @@ -243,12 +242,14 @@ void create_new_call (callable_type_t type, call_state_t state, gchar* callID , set_timestamp (& (obj->_time_stop)); if (g_strcasecmp (callID, "") == 0) - call_id = generate_call_id (); + { + obj->_callID = g_new0 (gchar, 30); + if (obj->_callID) + g_sprintf (obj->_callID, "%d", rand()); + } else - call_id = callID; + obj->_callID = g_strdup (callID); - // Set the IDs - obj->_callID = g_strdup (call_id); obj->clockStarted = 1; if (obj->_type == CALL) { @@ -397,15 +398,6 @@ void attach_thumbnail (callable_obj_t *call, GdkPixbuf *pixbuf) call->_contact_thumbnail = pixbuf; } -gchar* generate_call_id (void) -{ - gchar *call_id; - - call_id = g_new0 (gchar, 30); - g_sprintf (call_id, "%d", rand()); - return call_id; -} - gchar* get_peer_info (gchar* number, gchar* name) { gchar *info; diff --git a/sflphone-client-gnome/src/callable_obj.h b/sflphone-client-gnome/src/callable_obj.h index 34be817e23f9c78457e2580aad05d699142b1170..f353fab3f0c14a39d8b79a6eae033f21e89c79e3 100644 --- a/sflphone-client-gnome/src/callable_obj.h +++ b/sflphone-client-gnome/src/callable_obj.h @@ -222,11 +222,6 @@ free_callable_obj_t (callable_obj_t *c); void stop_call_clock (callable_obj_t *c); -/** - * @return gchar* A random ID - */ -gchar* generate_call_id (void); - gchar* get_peer_info (gchar*, gchar*); history_state_t get_history_state_from_id (gchar *indice); diff --git a/sflphone-client-gnome/src/conference_obj.c b/sflphone-client-gnome/src/conference_obj.c index d9a9ce4658b6af369f530351bfac48e56ae58446..ee8c9426b96ef38d6e875866e660ae9f9b8df244 100644 --- a/sflphone-client-gnome/src/conference_obj.c +++ b/sflphone-client-gnome/src/conference_obj.c @@ -38,8 +38,6 @@ static void set_conference_timestamp (time_t *); static void conference_add_participant_number(const gchar *, conference_obj_t *); -static void process_conference_participant_from_serialized(gchar *, conference_obj_t *); - static void set_conference_timestamp (time_t *timestamp) { time_t tmp; @@ -337,23 +335,3 @@ void create_conference_history_entry_from_serialized(gchar *entry, conference_ob (*conf)->_recordfile = g_strdup(recordfile); } - -static void process_conference_participant_from_serialized(gchar *participant, conference_obj_t *conf) -{ - gchar **ptr = NULL; - gchar *delim = ";"; - gint tok = 0; - - - DEBUG("Conference: Process participant from serialized form"); - - ptr = g_strsplit(participant, delim, 3); - while(ptr != NULL && (tok < 2)) { - gchar *call_id = NULL; - - conference_add_participant(call_id, conf); - - tok++; - ptr++; - } -} diff --git a/sflphone-client-gnome/src/contacts/addrbookfactory.c b/sflphone-client-gnome/src/contacts/addrbookfactory.c index 6f6feead298a9d9e67e9cb68f438e77475661253..cd3e9a8af6b0b383ce1cfc709ef4639fb06cfcac 100644 --- a/sflphone-client-gnome/src/contacts/addrbookfactory.c +++ b/sflphone-client-gnome/src/contacts/addrbookfactory.c @@ -65,14 +65,14 @@ void abookfactory_load_module(AddrBookFactory *factory) { DEBUG("AddressbookFactory: Loading addressbook: %s", pluginpath); - ab = g_malloc(sizeof(AddrBookHandle)); - handle = dlopen(pluginpath, RTLD_LAZY); + g_free(pluginpath); if(handle == NULL) { ERROR("AddressbookFactory: Error: Could not load addressbook"); return; } - g_free(pluginpath); + + ab = g_malloc(sizeof(AddrBookHandle)); ab->init = dlsym(handle, "addressbook_init"); if(ab->init == NULL) { diff --git a/sflphone-client-gnome/src/contacts/conferencelist.c b/sflphone-client-gnome/src/contacts/conferencelist.c index c7bf7a90e486302d73c83ae874f75eb029eb49be..dedc922aebfeee34a7b4c86a63d2c6ea60b9403d 100644 --- a/sflphone-client-gnome/src/contacts/conferencelist.c +++ b/sflphone-client-gnome/src/contacts/conferencelist.c @@ -33,7 +33,6 @@ #include "logger.h" static gint is_confID_confstruct(gconstpointer, gconstpointer); -static gchar *generate_conf_id (void); static gint is_confID_confstruct (gconstpointer a, gconstpointer b) { @@ -46,17 +45,6 @@ static gint is_confID_confstruct (gconstpointer a, gconstpointer b) } } -static gchar *generate_conf_id (void) -{ - gchar *conf_id; - - conf_id = g_new0 (gchar, 30); - g_sprintf (conf_id, "%d", rand()); - - return conf_id; -} - - void conferencelist_init(calltab_t *tab) { if(tab == NULL) { diff --git a/sflphone-client-gnome/src/mainwindow.c b/sflphone-client-gnome/src/mainwindow.c index 3f44a9e8bc9887b7f8eca4c83fdbe93b4f422ff2..ddac77cadf5250abbab8a60f6f63e5bd7e6d305e 100644 --- a/sflphone-client-gnome/src/mainwindow.c +++ b/sflphone-client-gnome/src/mainwindow.c @@ -57,7 +57,6 @@ static GtkWidget * dialpad = NULL; static GtkWidget * speaker_control = NULL; static GtkWidget * mic_control = NULL; static GtkWidget * statusBar = NULL; -static GtkWidget * filterEntry = NULL; static PidginScrollBook *embedded_error_notebook; static gchar *status_current_message = NULL; diff --git a/sflphone-client-gnome/src/widget/imwidget.c b/sflphone-client-gnome/src/widget/imwidget.c index 5cb55eb237789137d859e8851532635cd87e77c3..9593372317ce6d1b5f0fc40ff803493ca00f2a1a 100644 --- a/sflphone-client-gnome/src/widget/imwidget.c +++ b/sflphone-client-gnome/src/widget/imwidget.c @@ -409,6 +409,7 @@ im_widget_infobar (IMWidget *im) msg1 = g_strdup (""); GtkWidget *call_label = gtk_label_new (msg1); + g_free (msg1); if (im_widget_call) im->info_state = call_state_image_widget (im_widget_call->_state); @@ -429,9 +430,6 @@ im_widget_infobar (IMWidget *im) /* Show the info bar */ gtk_widget_show (infobar); - - /* Clean up */ - free (msg1); } GtkWidget* diff --git a/sflphone-client-gnome/tests/Makefile.am b/sflphone-client-gnome/tests/Makefile.am index 3d3ffb8f4dfa7d8216f47ae495b5f310a1c76e29..9bfb21689f348f67e6882e20c17372bc0c8c292c 100644 --- a/sflphone-client-gnome/tests/Makefile.am +++ b/sflphone-client-gnome/tests/Makefile.am @@ -7,44 +7,29 @@ SFLPHONE_LIBS = $(top_builddir)/src/contacts/libcontacts.la \ $(top_builddir)/src/dbus/libdbus.la \ $(top_builddir)/src/config/libconfig.la -SFLPHONE_OBJ = $(top_builddir)/src/accountlist.o \ - $(top_builddir)/src/actions.o \ - $(top_builddir)/src/assistant.o \ - $(top_builddir)/src/call.o \ - $(top_builddir)/src/codeclist.o \ - $(top_builddir)/src/dialpad.o \ - $(top_builddir)/src/errors.o \ - $(top_builddir)/src/mainwindow.o \ - $(top_builddir)/src/menus.o \ - $(top_builddir)/src/reqaccount.o \ - $(top_builddir)/src/sflnotify.o \ - $(top_builddir)/src/sliders.o \ - $(top_builddir)/src/statusicon.o \ - $(top_builddir)/src/timestamp.o \ - $(top_builddir)/src/toolbar.o - ########################################################### -check_global_SOURCES = check_global.c -check_global_CFLAGS = @CHECK_CFLAGS@ @DEPS_CFLAGS@ -check_global_LDADD = $(SFLPHONE_LIBS) $(SFLPHONE_OBJ) @CHECK_LIBS@ $(DEPS_LIBS) @LIBSEXY_LIBS@ +check_global_SOURCES = check_global.c $(top_srcdir)/src/accountlist.c $(top_srcdir)/src/logger.c +check_global_CFLAGS = @CHECK_CFLAGS@ @SFLGTK_CFLAGS@ @DBUSGLIB_CFLAGS@ +check_global_LDADD = $(SFLPHONE_LIBS) @CHECK_LIBS@ @LIBSEXY_LIBS@ @SFLGTK_LIBS@ @DBUSGLIB_LIBS@ ########################################################### check_contacts_SOURCES = check_contacts.c -check_contacts_CFLAGS = @CHECK_CFLAGS@ @DEPS_CFLAGS@ -check_contacts_LDADD = $(SFLPHONE_LIBS) $(SFLPHONE_OBJ) @CHECK_LIBS@ $(DEPS_LIBS) @LIBSEXY_LIBS@ +check_contacts_CFLAGS = @CHECK_CFLAGS@ @SFLGTK_CFLAGS@ +check_contacts_LDADD = $(SFLPHONE_LIBS) @CHECK_LIBS@ @LIBSEXY_LIBS@ ########################################################### check_config_SOURCES = check_config.c -check_config_CFLAGS = @CHECK_CFLAGS@ @DEPS_CFLAGS@ -check_config_LDADD = $(SFLPHONE_LIBS) $(SFLPHONE_OBJ) @CHECK_LIBS@ @DEPS_LIBS@ @LIBSEXY_LIBS@ +check_config_CFLAGS = @CHECK_CFLAGS@ @SFLGTK_CFLAGS@ +check_config_LDADD = $(SFLPHONE_LIBS) @CHECK_LIBS@ @LIBSEXY_LIBS@ ########################################################### -check_dbus_SOURCES = check_dbus.c -check_dbus_CFLAGS = @CHECK_CFLAGS@ @DEPS_CFLAGS@ -check_dbus_LDADD = $(SFLPHONE_LIBS) $(SFLPHONE_OBJ) @CHECK_LIBS@ @DEPS_LIBS@ @LIBSEXY_LIBS@ +check_dbus_SOURCES = check_dbus.c $(top_srcdir)/src/logger.c $(top_srcdir)/src/accountlist.c $(top_srcdir)/src/actions.c $(top_srcdir)/src/codeclist.c $(top_srcdir)/src/dialpad.c $(top_srcdir)/src/errors.c $(top_srcdir)/src/mainwindow.c $(top_srcdir)/src/reqaccount.c $(top_srcdir)/src/sflnotify.c $(top_srcdir)/src/sliders.c $(top_srcdir)/src/statusicon.c $(top_srcdir)/src/callable_obj.c $(top_srcdir)/src/eel-gconf-extensions.c $(top_srcdir)/src/uimanager.c $(top_srcdir)/src/conference_obj.c $(top_srcdir)/src/shortcuts.c $(top_srcdir)/src/imwindow.c + +check_dbus_CFLAGS = @CHECK_CFLAGS@ @SFLGTK_CFLAGS@ @DBUSGLIB_CFLAGS@ @WEBKIT_CFLAGS@ @LIBGNOMEUI_CFLAGS@ +check_dbus_LDADD = $(SFLPHONE_LIBS) @CHECK_LIBS@ @LIBSEXY_LIBS@ $(top_builddir)/src/widget/libwidget.la $(top_builddir)/src/icons/libicons.la ########################################################### diff --git a/sflphone-client-gnome/tests/check_contacts.c b/sflphone-client-gnome/tests/check_contacts.c index 6aed2872291b4b6216cdff48ab50bc130f27870f..ab38d7b36f6d53e64744796f1730271a45a05796 100644 --- a/sflphone-client-gnome/tests/check_contacts.c +++ b/sflphone-client-gnome/tests/check_contacts.c @@ -28,7 +28,6 @@ #include <check.h> #include <stdlib.h> -#include "../src/contacts/addressbook/eds.h" #include "../src/contacts/addressbook.h" diff --git a/sflphone-client-gnome/tests/check_dbus.c b/sflphone-client-gnome/tests/check_dbus.c index 902127bb5963029b9d234cc626385863f03973fd..2653f84992229c1d32ac74f047aea71b23399705 100644 --- a/sflphone-client-gnome/tests/check_dbus.c +++ b/sflphone-client-gnome/tests/check_dbus.c @@ -33,7 +33,8 @@ START_TEST (test_dbus_connect) { - fail_unless (dbus_connect () == TRUE, "dbus_connect () returns FALSE"); + GError *error = NULL; + fail_unless (dbus_connect (&error) == TRUE, "dbus_connect () returns FALSE"); } END_TEST diff --git a/sflphone-client-gnome/tests/check_global.c b/sflphone-client-gnome/tests/check_global.c index c1197673daeec0091e23eef129b4394bf5d34eb8..8a3cd2d49f74f473f5625fa8a7e9ee782e35cf73 100644 --- a/sflphone-client-gnome/tests/check_global.c +++ b/sflphone-client-gnome/tests/check_global.c @@ -101,16 +101,6 @@ START_TEST (test_get_by_id) } END_TEST -START_TEST (test_sip_account) -{ - account_t *test = create_test_account ("test"); - - account_list_init (); - account_list_add (test); - fail_unless (account_list_get_sip_account_number () == 1, "ERROR - BAD SIP ACCOUNT NUMBER"); -} -END_TEST - START_TEST (test_get_account_position) { guint pos, pos1; @@ -123,16 +113,16 @@ START_TEST (test_get_account_position) pos = account_list_get_position (test); pos1 = account_list_get_position (test2); - fail_if (pos == -1, "ERROR - bad account position"); + fail_if (pos == (guint)-1, "ERROR - bad account position"); fail_unless (pos == 0, "ERROR - bad account position"); - fail_if (pos1 == -1, "ERROR - bad account position"); + fail_if (pos1 == (guint)-1, "ERROR - bad account position"); fail_unless (pos1 == 1, "ERROR - bad account position"); account_list_set_current (test); pos = account_list_get_position (test); pos1 = account_list_get_position (test2); - fail_if (pos == -1, "ERROR - bad account position"); + fail_if (pos == (guint)-1, "ERROR - bad account position"); fail_unless (pos == 0, "ERROR - bad account position"); fail_unless (pos1 == 1, "ERROR - bad account position"); } @@ -171,20 +161,6 @@ START_TEST (test_get_current_account) } END_TEST -START_TEST (test_current_account_has_mailbox) -{ - account_t *test = create_test_account ("test"); - - account_list_init (); - account_list_add (test); - fail_unless (account_list_current_account_has_mailbox () == FALSE, "current account has a default mailbox"); - - g_hash_table_replace (test->properties, ACCOUNT_MAILBOX, "888"); - fail_unless (account_list_current_account_has_mailbox () == TRUE, "current account has not no voicemail number"); -} -END_TEST - - Suite * global_suite (void) { @@ -193,11 +169,9 @@ global_suite (void) TCase *tc_cases = tcase_create ("Accounts"); tcase_add_test (tc_cases, test_add_account); tcase_add_test (tc_cases, test_ordered_list); - tcase_add_test (tc_cases, test_sip_account); tcase_add_test (tc_cases, test_get_by_id); tcase_add_test (tc_cases, test_get_account_position); tcase_add_test (tc_cases, test_get_current_account); - tcase_add_test (tc_cases, test_current_account_has_mailbox); suite_add_tcase (s, tc_cases); return s; diff --git a/sflphone-common/libs/iax2/iax-client.h b/sflphone-common/libs/iax2/iax-client.h index bd5bf609b768ef55b502e2ae00158f17fe78d5f4..7ba1d311f5053c99cca1704ab6229957bcc82363 100644 --- a/sflphone-common/libs/iax2/iax-client.h +++ b/sflphone-common/libs/iax2/iax-client.h @@ -19,7 +19,7 @@ #pragma warning(disable:4200) #endif -#ifndef LINUX +#ifndef __linux__ #define socklen_t int #endif diff --git a/sflphone-common/libs/iax2/iax.c b/sflphone-common/libs/iax2/iax.c index 00d06e7e5146f3f69a5108bb05f7de90258d3ddb..3ae3c25b82df55487b1ae934f36afca477ccec39 100644 --- a/sflphone-common/libs/iax2/iax.c +++ b/sflphone-common/libs/iax2/iax.c @@ -878,7 +878,6 @@ int iax_init(int preferredportno) { struct sockaddr_in sin; socklen_t sinlen; - socklen_t *slen = &sinlen; int flags; int bufsize = 256 * 1024; @@ -929,7 +928,7 @@ int iax_init(int preferredportno) } sinlen = sizeof(sin); - if (getsockname(netfd, (struct sockaddr *) &sin, slen) < 0) + if (getsockname(netfd, (struct sockaddr *) &sin, &sinlen) < 0) { close(netfd); netfd = -1; diff --git a/sflphone-common/libs/iax2/md5.c b/sflphone-common/libs/iax2/md5.c index 56382221c44102643e3c38482b8b826cd716b52d..5524d26b1f031673ba93cc38a11fb47a6ce232d2 100644 --- a/sflphone-common/libs/iax2/md5.c +++ b/sflphone-common/libs/iax2/md5.c @@ -3,7 +3,7 @@ #ifdef FREEBSD # include <machine/endian.h> -#elif defined(LINUX) +#elif defined(__linux__) # include <endian.h> # include <features.h> # include <sys/types.h> diff --git a/sflphone-common/src/audio/audiorecorder.cpp b/sflphone-common/src/audio/audiorecorder.cpp index d38c5073107af0d9b9f5d069bd4a2ad0c9bddd06..92acc44fafadbe37ce498e8a2e765de06e9353f7 100644 --- a/sflphone-common/src/audio/audiorecorder.cpp +++ b/sflphone-common/src/audio/audiorecorder.cpp @@ -30,11 +30,13 @@ #include "audiorecorder.h" #include "mainbuffer.h" +#include <assert.h> int AudioRecorder::count = 0; AudioRecorder::AudioRecorder (AudioRecord *arec, MainBuffer *mb) : Thread() { + assert(mb); setCancel (cancelDeferred); ++count; @@ -65,9 +67,6 @@ void AudioRecorder::run (void) while (true) { - if (!mbuffer) - _warn ("AudioRecorder: Error: No instance of ringbuffer"); - int availBytes = mbuffer->availForGet (recorderId); int toGet = (availBytes < bufferLength) ? availBytes : bufferLength; diff --git a/sflphone-common/src/plug-in/pluginmanager.cpp b/sflphone-common/src/plug-in/pluginmanager.cpp index 4789973859aeae904c9a0a3f3ba036d18dd92c83..25a809db4cb5df92b81326e394bbe877f7aa2631 100644 --- a/sflphone-common/src/plug-in/pluginmanager.cpp +++ b/sflphone-common/src/plug-in/pluginmanager.cpp @@ -87,35 +87,38 @@ PluginManager::loadPlugins (const std::string &path) dir = opendir (pluginDir.c_str()); /* Test if the directory exists or is readable */ - if (dir) { - /* Read the directory */ - while ( (dirStruct=readdir (dir))) { - /* Get the name of the current item in the directory */ - current = dirStruct->d_name; - /* Test if the current item is not the parent or the current directory and that it ends with .so*/ - - if (current != pDir && current != cDir and hasSharedExtension(current)) { - - /* Load the dynamic library */ - library = loadDynamicLibrary (pluginDir + current); - - /* Instanciate the plugin object */ - - if (instanciatePlugin (library, &plugin) != 0) { - _debug ("Error instanciating the plugin ..."); - return 1; - } - - /* Regitering the current plugin */ - if (registerPlugin (plugin, library) != 0) { - _debug ("Error registering the plugin ..."); - return 1; - } - } - } - } else + if (!dir) return 1; + /* Read the directory */ + while ( (dirStruct=readdir (dir))) { + /* Get the name of the current item in the directory */ + current = dirStruct->d_name; + + /* Test if the current item is not the parent or the current directory and that it ends with .so*/ + if (current == pDir || current == cDir || !hasSharedExtension(current)) + continue; + + + /* Load the dynamic library */ + library = loadDynamicLibrary (pluginDir + current); + + /* Instanciate the plugin object */ + + if (instanciatePlugin (library, &plugin) != 0) { + _debug ("Error instanciating the plugin ..."); + closedir(dir); + return 1; + } + + /* Regitering the current plugin */ + if (registerPlugin (plugin, library) != 0) { + _debug ("Error registering the plugin ..."); + closedir(dir); + return 1; + } + } + /* Close the directory */ closedir (dir); diff --git a/sflphone-common/src/sip/sipvoiplink.cpp b/sflphone-common/src/sip/sipvoiplink.cpp index 09f5205e0ccc642043cf96a9add096de1fb1ec4c..524f370233aad231b1fd34c4caca26e2cc240af9 100644 --- a/sflphone-common/src/sip/sipvoiplink.cpp +++ b/sflphone-common/src/sip/sipvoiplink.cpp @@ -542,8 +542,7 @@ void SIPVoIPLink::sendRegister (AccountID id) throw(VoipLinkException) // Add User-Agent Header pj_list_init (&hdr_list); - const char *useragent_name = getUseragentName (id).c_str(); - pj_str_t useragent = pj_str ( (char *) useragent_name); + pj_str_t useragent = pj_str ((char*)getUseragentName (id).c_str()); pjsip_generic_string_hdr *h = pjsip_generic_string_hdr_create (_pool, &STR_USER_AGENT, &useragent); pj_list_push_back (&hdr_list, (pjsip_hdr*) h); @@ -1447,8 +1446,7 @@ SIPVoIPLink::dtmfSipInfo (SIPCall *call, char code) { int duration; - const int body_len = 1000; - char *dtmf_body; + char dtmf_body[1000]; pj_status_t status; pjsip_tx_data *tdata; pj_str_t methodName, content; @@ -1467,10 +1465,6 @@ SIPVoIPLink::dtmfSipInfo (SIPCall *call, char code) duration = Manager::instance().voipPreferences.getPulseLength(); - dtmf_body = new char[body_len]; - - snprintf (dtmf_body, body_len - 1, "Signal=%c\r\nDuration=%d\r\n", code, duration); - pj_strdup2 (tmp_pool, &methodName, "INFO"); pjsip_method_init_np (&method, &methodName); @@ -1487,6 +1481,8 @@ SIPVoIPLink::dtmfSipInfo (SIPCall *call, char code) pj_strdup2 (tmp_pool, &ctype.subtype, "dtmf-relay"); + snprintf (dtmf_body, sizeof dtmf_body - 1, "Signal=%c\r\nDuration=%d\r\n", code, duration); + /* Create "application/dtmf-relay" message body. */ pj_strdup2 (tmp_pool, &content, dtmf_body); @@ -3692,8 +3688,7 @@ void registration_cb (struct pjsip_regc_cbparam *param) // TODO: there id a race condition for this ressource when closing the application - if (account) - account->setRegistrationStateDetailed (details); + account->setRegistrationStateDetailed (details); } if (param->status == PJ_SUCCESS) { diff --git a/sflphone-common/test/instantmessagingtest.cpp b/sflphone-common/test/instantmessagingtest.cpp index fb0f49308e57d00641e5906c2632c001d5ef4bac..da8047a4bb19637e051c392a35b2831f4e685df7 100644 --- a/sflphone-common/test/instantmessagingtest.cpp +++ b/sflphone-common/test/instantmessagingtest.cpp @@ -161,7 +161,6 @@ static void XMLCALL startElementCallback(void *userData, const char *name, const char value[50]; const char **att; - const char **val; for (att = atts; *att; att += 2) { const char **val = att+1; diff --git a/sflphone-common/test/sdptest.cpp b/sflphone-common/test/sdptest.cpp index b85102feff640b73e4da9b112ec5ba90b7aa698e..be20f3c76aa319f856b3ce5c6bc2a2fc048c5e49 100644 --- a/sflphone-common/test/sdptest.cpp +++ b/sflphone-common/test/sdptest.cpp @@ -28,10 +28,11 @@ * as that of the covered work. */ +#include "sdptest.h" #include <iostream> -#include <string.h> +#include <cstring> -#include "sdptest.h" +#include "audio/codecs/audiocodec.h" enum session_type diff --git a/sflphone-common/test/sdptest.h b/sflphone-common/test/sdptest.h index ddb4ff8dace71ca057250b82d03b7f69c1a6856a..ee78b0b27986e3f101ccb0a8043814f1e1e627fa 100644 --- a/sflphone-common/test/sdptest.h +++ b/sflphone-common/test/sdptest.h @@ -44,7 +44,7 @@ #include <cppunit/TestCase.h> #include <cppunit/TestSuite.h> -#include <assert.h> +#include <cassert> #include <exception> #include <string>