]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fix MacOS build macos 2115/head
authorAndrey Volk <andywolk@gmail.com>
Fri, 31 Mar 2023 21:51:30 +0000 (00:51 +0300)
committerJakub Karolczyk <jakub.karolczyk@signalwire.com>
Tue, 27 Jun 2023 12:44:45 +0000 (07:44 -0500)
Co-authored-by: Jakub Karolczyk <jakub.karolczyk@signalwire.com>
43 files changed:
libs/libyuv/include/libyuv/planar_functions.h
libs/libyuv/source/planar_functions.cc
libs/miniupnpc/miniupnpc.c
libs/xmlrpc-c/include/xmlrpc-c/string_int.h
libs/xmlrpc-c/lib/abyss/src/server.c
libs/xmlrpc-c/lib/abyss/src/thread_fork.c
libs/xmlrpc-c/lib/libutil/asprintf.c
src/fs_encode.c
src/fs_tts.c
src/mod/applications/mod_av/avcodec.c
src/mod/applications/mod_av/avformat.c
src/mod/applications/mod_conference/conference_api.c
src/mod/applications/mod_conference/conference_cdr.c
src/mod/applications/mod_conference/conference_loop.c
src/mod/applications/mod_conference/mod_conference.h
src/mod/applications/mod_db/mod_db.c
src/mod/applications/mod_dptools/mod_dptools.c
src/mod/applications/mod_signalwire/mod_signalwire.c
src/mod/endpoints/mod_skinny/mod_skinny.c
src/mod/endpoints/mod_skinny/mod_skinny.h
src/mod/endpoints/mod_skinny/skinny_api.c
src/mod/endpoints/mod_skinny/skinny_api.h
src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/sip-dig.c
src/mod/endpoints/mod_sofia/sofia_presence.c
src/mod/endpoints/mod_sofia/test/sipp-based-tests.c
src/mod/endpoints/mod_verto/mod_verto.c
src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c
src/mod/event_handlers/mod_event_socket/mod_event_socket.c
src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c
src/switch.c
src/switch_core.c
src/switch_core_media.c
src/switch_event.c
src/switch_ivr_play_say.c
src/switch_loadable_module.c
src/switch_log.c
src/switch_msrp.c
src/switch_rtp.c
src/switch_speex.c
src/switch_time.c
src/switch_utils.c
src/switch_vpx.c

index 5299fe2c0ef331b63f0ddcec175b1f23f27c8b89..50fe5f681d4a9e28b5bde3f44c3f907bd7aef7a3 100644 (file)
@@ -582,7 +582,7 @@ typedef void (*ARGBBlendRow)(const uint8_t* src_argb0,
 
 // Get function to Alpha Blend ARGB pixels and store to destination.
 LIBYUV_API
-ARGBBlendRow GetARGBBlend();
+ARGBBlendRow GetARGBBlend(void);
 
 // Alpha Blend ARGB images and store to destination.
 // Source is pre-multiplied by alpha using ARGBAttenuate.
index 5a9d56d88a669e2bd9e7b700f50a1c5b9d14acc8..c07f0943d38f6f1d899addf8268b8a116c11c212 100644 (file)
@@ -1185,7 +1185,7 @@ int ARGBMirror(const uint8_t* src_argb,
 // As there are 6 blenders to choose from, the caller should try to use
 // the same blend function for all pixels if possible.
 LIBYUV_API
-ARGBBlendRow GetARGBBlend() {
+ARGBBlendRow GetARGBBlend(void) {
   void (*ARGBBlendRow)(const uint8_t* src_argb, const uint8_t* src_argb1,
                        uint8_t* dst_argb, int width) = ARGBBlendRow_C;
 #if defined(HAS_ARGBBLENDROW_SSSE3)
index 88faea1c3793046db2a5d5d483a394b931a1aa1d..a72ef892b6cc8fd80d3b7856ea79410c932740a4 100644 (file)
@@ -679,7 +679,6 @@ UPNP_GetValidIGD(struct UPNPDev * devlist,
        char * descXML;
        int descXMLsize = 0;
        struct UPNPDev * dev;
-       int ndev = 0;
        int state; /* state 1 : IGD connected. State 2 : IGD. State 3 : anything */
        if(!devlist)
        {
@@ -698,7 +697,6 @@ UPNP_GetValidIGD(struct UPNPDev * devlist,
                                                        lanaddr, lanaddrlen);
                        if(descXML)
                        {
-                               ndev++;
                                memset(data, 0, sizeof(struct IGDdatas));
                                memset(urls, 0, sizeof(struct UPNPUrls));
                                parserootdesc(descXML, descXMLsize, data);
index 04ac8c782bfc8774e275c914f7f46b8ff712d240..a0cc58605f14edec771999ab9d9eb78a17be97db 100644 (file)
@@ -3,7 +3,12 @@
 
 
 #include <stdarg.h>
+
+#ifdef __APPLE__
+#include <strings.h>
+#else
 #include <string.h>
+#endif
 
 #include "xmlrpc_config.h"
 #include "c_util.h"
index 6337dcfd78e7c1b37a7507ec032d5e92edebd82c..ca05011b832a0c6806ec211eef8d7f0914689bb0 100644 (file)
@@ -1,6 +1,9 @@
 /* Copyright information is at end of file */
 
 #define _XOPEN_SOURCE 600  /* Make sure strdup() is in <string.h> */
+#ifdef __APPLE__
+#define _DARWIN_C_SOURCE
+#endif
 #define _BSD_SOURCE  /* Make sure setgroups()is in <grp.h> */
 #ifndef _DEFAULT_SOURCE
 #define _DEFAULT_SOURCE
index d96bf59eb1e797b12361ce946922d7f8b45c554c..7ea382918aef9434c896c434a92863a78c4aff4c 100644 (file)
@@ -3,7 +3,11 @@
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
+#ifdef __APPLE__
+#include <sys/wait.h>
+#else
 #include <wait.h>
+#endif
 #include <signal.h>
 
 #include "xmlrpc_config.h"
index b52523065ae2f696af07916d2636473756567db5..f078518bb526d9289e0acb79ab4239e33fb50e24 100644 (file)
@@ -1,4 +1,7 @@
 #define _XOPEN_SOURCE 600  /* Make sure strdup() is in <string.h> */
+#ifdef __APPLE__
+#define _DARWIN_C_SOURCE
+#endif
 #ifndef _GNU_SOURCE
        #define _GNU_SOURCE  /* But only when HAVE_ASPRINTF */
 #endif
index 235a5d9f116574fc05fa8cdd680b50489f986f49..527dc3eeffcfcac8a23b47cc734ed0b63db8e4ba 100644 (file)
@@ -46,7 +46,7 @@
 #pragma warning (disable:167)
 #endif
 
-static void fs_encode_cleanup()
+static void fs_encode_cleanup(void)
 {
        switch_safe_free(SWITCH_GLOBAL_dirs.conf_dir);
        switch_safe_free(SWITCH_GLOBAL_dirs.mod_dir);
index 2a963ee68ec8ecba4edd189701b463386964047d..6632e865666dce2ecd70e94145259a63809edf1b 100644 (file)
@@ -46,7 +46,7 @@
 #pragma warning (disable:167)
 #endif
 
-static void fs_tts_cleanup()
+static void fs_tts_cleanup(void)
 {
        switch_safe_free(SWITCH_GLOBAL_dirs.conf_dir);
        switch_safe_free(SWITCH_GLOBAL_dirs.mod_dir);
index a9f6d0927e0296fe2de0fcc89234c0b156337af6..b4eaeadd2ef6b85ffe34ba7247ee53c21878103b 100644 (file)
@@ -2208,7 +2208,7 @@ static void parse_codecs(avcodec_profile_t *aprofile, switch_xml_t codecs)
 }
 
 
-static void load_config()
+static void load_config(void)
 {
        switch_xml_t cfg = NULL, xml = NULL;
 
index 1f767d0bde0e1ebe4350f60167793b0cb36ad73e..d52e141b6b1b1725c196cd833697242691879156 100644 (file)
@@ -2861,7 +2861,7 @@ static char *supported_formats[SWITCH_MAX_CODECS] = { 0 };
 
 static const char modname[] = "mod_av";
 
-static switch_status_t load_config()
+static switch_status_t load_config(void)
 {
        char *cf = "avformat.conf";
        switch_xml_t cfg, xml, param, settings;
index 8bcfc5862fb860c002a3d9f27e1829fb237dee0b..7e566367fbaa424f8bc04e1956ad5e9d33c8e593 100644 (file)
@@ -4087,7 +4087,6 @@ switch_status_t conference_api_sub_set(conference_obj_t *conference,
 
 switch_status_t conference_api_sub_xml_list(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv)
 {
-       int count = 0;
        switch_hash_index_t *hi;
        void *val;
        switch_xml_t x_conference, x_conferences;
@@ -4106,7 +4105,6 @@ switch_status_t conference_api_sub_xml_list(conference_obj_t *conference, switch
                        x_conference = switch_xml_add_child_d(x_conferences, "conference", off++);
                        switch_assert(conference);
 
-                       count++;
                        conference_xlist(conference, x_conference, off);
 
                }
@@ -4114,7 +4112,7 @@ switch_status_t conference_api_sub_xml_list(conference_obj_t *conference, switch
        } else {
                x_conference = switch_xml_add_child_d(x_conferences, "conference", off++);
                switch_assert(conference);
-               count++;
+
                conference_xlist(conference, x_conference, off);
        }
 
index b6eb630540e3e39d7f4982bdcf67aa7d1411d079..33decf25aa265309b58f9f54f67f7055bfb2efa3 100644 (file)
@@ -737,7 +737,7 @@ void conference_cdr_render(conference_obj_t *conference)
 #endif
                                int wrote;
                                wrote = write(fd, xml_text, (unsigned) strlen(xml_text));
-                               wrote++;
+                               (void)wrote;
                                close(fd);
                        } else {
                                char ebuf[512] = { 0 };
index f6c2856892d64f51cc839b4ce445ae9518e1be25..8f112f5453b827b3ad33bef22565f85db47ed59e 100644 (file)
@@ -75,7 +75,7 @@ struct _mapping control_mappings[] = {
        {"deaf off", conference_loop_deaf_off}
 };
 
-int conference_loop_mapping_len()
+int conference_loop_mapping_len(void)
 {
        return (sizeof(control_mappings)/sizeof(control_mappings[0]));
 }
index 3c28634264873eaa07cbbc8a45990db6f5b603bc..ca358f2aa0dd68466d38a42fff7aa6a7788b58b8 100644 (file)
@@ -1123,7 +1123,7 @@ void conference_video_canvas_del_fnode_layer(conference_obj_t *conference, confe
 void conference_video_canvas_set_fnode_layer(mcu_canvas_t *canvas, conference_file_node_t *fnode, int idx);
 void conference_list(conference_obj_t *conference, switch_stream_handle_t *stream, char *delim);
 const char *conference_utils_combine_flag_var(switch_core_session_t *session, const char *var_name);
-int conference_loop_mapping_len();
+int conference_loop_mapping_len(void);
 void conference_api_set_agc(conference_member_t *member, const char *data);
 
 switch_status_t conference_outcall(conference_obj_t *conference,
index 0e3e227de7c991eb9b07338e8fbd1bf9ceac7469..5f14792f2c42b33759d2f37fe8f56bcddbb96714 100644 (file)
@@ -280,7 +280,7 @@ static switch_xml_config_item_t config_settings[] = {
        SWITCH_CONFIG_ITEM_END()
 };
 
-static switch_status_t do_config()
+static switch_status_t do_config(void)
 {
        switch_cache_db_handle_t *dbh = NULL;
        switch_status_t status = SWITCH_STATUS_SUCCESS;
index e91ec53d47de18ecd40309d10e166a2f3b2f3024..f52b1184e565831f79c1c024f64cd95439f1cbc9 100644 (file)
@@ -161,7 +161,6 @@ static switch_status_t digit_action_callback(switch_ivr_dmachine_match_t *match)
        char *string = NULL;
        switch_channel_t *channel;
        switch_core_session_t *use_session = act->session;
-       int x = 0;
        char *flags = "";
 
        if (act->target == DIGIT_TARGET_PEER || act->target == DIGIT_TARGET_BOTH) {
@@ -171,7 +170,6 @@ static switch_status_t digit_action_callback(switch_ivr_dmachine_match_t *match)
        }
 
  top:
-       x++;
 
        string = switch_core_session_strdup(use_session, act->string);
        exec = 0;
index 9846e7e1d23ba08b1a0121fdb2dcee2199383dbd..108f99b2c576a6fb953661a0befac200af48ae29 100644 (file)
@@ -704,7 +704,7 @@ done:
        return status;
 }
 
-static switch_status_t load_config()
+static switch_status_t load_config(void)
 {
        char *cf = "signalwire.conf";
        switch_xml_t cfg, xml;
@@ -1390,7 +1390,7 @@ static void mod_signalwire_state_register(void)
        }
 }
 
-static void mod_signalwire_state_ready()
+static void mod_signalwire_state_ready(void)
 {
        if (globals.profile_update) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Signalwire SIP profile update initiated\n");
index c6cfc716c7c61949c89de06440c2e684499fd280..64464e4ef6116aa080399f71e691a8d38865e106 100644 (file)
@@ -2136,7 +2136,7 @@ void launch_skinny_profile_thread(skinny_profile_t *profile) {
 /*****************************************************************************/
 /* MODULE FUNCTIONS */
 /*****************************************************************************/
-switch_endpoint_interface_t *skinny_get_endpoint_interface()
+switch_endpoint_interface_t *skinny_get_endpoint_interface(void)
 {
        return skinny_endpoint_interface;
 }
index 69096ab64ef857d33226257dfef4bcdffb9a581a..aff2ee92c06f26e429fc13685cf6580b201f8f37 100644 (file)
@@ -355,7 +355,7 @@ switch_status_t channel_kill_channel(switch_core_session_t *session, int sig);
 /*****************************************************************************/
 /* MODULE FUNCTIONS */
 /*****************************************************************************/
-switch_endpoint_interface_t *skinny_get_endpoint_interface();
+switch_endpoint_interface_t *skinny_get_endpoint_interface(void);
 
 /*****************************************************************************/
 /* TEXT FUNCTIONS */
index f79f36c0149eeaaae1249f8eeb6cf9c34e144d57..4657a5a9d353f1675eb29b9ec2543800c8361c38 100644 (file)
@@ -697,7 +697,7 @@ switch_status_t skinny_api_register(switch_loadable_module_interface_t **module_
        return SWITCH_STATUS_SUCCESS;
 }
 
-switch_status_t skinny_api_unregister()
+switch_status_t skinny_api_unregister(void)
 {
        switch_console_set_complete("del skinny");
 
index e246957f0d97cf51a2f0c1f116537ff8eeed897a..833d0c15da20a0ce0ebd001d697a014dd012bc7d 100644 (file)
@@ -34,7 +34,7 @@
 #define _SKINNY_API_H
 
 switch_status_t skinny_api_register(switch_loadable_module_interface_t **module_interface);
-switch_status_t skinny_api_unregister();
+switch_status_t skinny_api_unregister(void);
 
 #endif /* _SKINNY_API_H */
 
index 2fdf0063a9f117b53c4a43fe9c49b7fccf589d78..f58bb40ac06f7191828a79e5bc34fee785660b9e 100644 (file)
@@ -54,7 +54,7 @@ switch_endpoint_interface_t *sofia_endpoint_interface;
 
 #define STRLEN 15
 
-void mod_sofia_shutdown_cleanup();
+void mod_sofia_shutdown_cleanup(void);
 static switch_status_t sofia_on_init(switch_core_session_t *session);
 
 static switch_status_t sofia_on_exchange_media(switch_core_session_t *session);
@@ -3255,8 +3255,6 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl
        switch_hash_index_t *hi;
        void *val;
        const void *vvar;
-       int c = 0;
-       int ac = 0;
        const char *header = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";
 
        if (argc > 0) {
@@ -3466,7 +3464,6 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl
                if (sofia_test_pflag(profile, PFLAG_RUNNING)) {
 
                        if (strcmp(vvar, profile->name)) {
-                               ac++;
                                stream->write_function(stream, "<alias>\n<name>%s</name>\n<type>%s</type>\n<data>%s</data>\n<state>%s</state>\n</alias>\n", vvar, "alias",
                                                                           profile->name, "ALIASED");
                        } else {
@@ -3492,8 +3489,6 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl
                                                                           profile->inuse);
                                }
 
-                               c++;
-
                                for (gp = profile->gateways; gp; gp = gp->next) {
                                        switch_assert(gp->state < REG_STATE_LAST);
                                        stream->write_function(stream, "<gateway>\n<name>%s</name>\n<type>%s</type>\n<data>%s</data>\n<state>%s</state>\n</gateway>\n",
@@ -6833,7 +6828,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
        return status;
 }
 
-void mod_sofia_shutdown_cleanup() {
+void mod_sofia_shutdown_cleanup(void) {
        int sanity = 0;
        int i;
        switch_status_t st;
index c9a6f5b463454435a4d5edad60661c0d1cf9d255..10a0a26763af1f6590a20bd9963c1e094be68baa 100644 (file)
@@ -82,9 +82,6 @@
  * <dt>-6</dt>
  * <dd>Query IP6 addresses (AAAA records).
  * </dd>
- * <dt>-v</dt>
- * <dd>Be verbatim.
- * </dd>
  * <dt></dt>
  * <dd>
  * </dd>
@@ -201,7 +198,7 @@ switch_bool_t verify_ip(sres_record_t **answers, const char *ip, switch_bool_t i
 switch_status_t sip_dig_function(_In_opt_z_ const char *cmd, _In_opt_ switch_core_session_t *session, _In_ switch_stream_handle_t *stream)
 
 {
-       int o_sctp = 1, o_tls_sctp = 1, o_verbatim = 1;
+       int o_sctp = 1, o_tls_sctp = 1;
        int family = 0, multiple = 0;
        char const *string;
        url_t *uri = NULL;
@@ -247,9 +244,7 @@ switch_status_t sip_dig_function(_In_opt_z_ const char *cmd, _In_opt_ switch_cor
        }
 
        while (argv[i] && argv[i][0] == '-') {
-               if (strcmp(argv[i], "-v") == 0) {
-                       o_verbatim++;
-               } else if (strcmp(argv[i], "-6") == 0) {
+               if (strcmp(argv[i], "-6") == 0) {
                        dig->ip6 = ++family;
                } else if (strcmp(argv[i], "-4") == 0) {
                        dig->ip4 = ++family;
index b8576ae7f563410080d40b38d3de7b82b1193911..579cea83e28971f57ab026fedc9de6a3504ed418 100644 (file)
@@ -1621,7 +1621,6 @@ void *SWITCH_THREAD_FUNC sofia_presence_event_thread_run(switch_thread_t *thread
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Event Thread Started\n");
 
        while (mod_sofia_globals.running == 1) {
-               int count = 0;
 
                if (switch_queue_pop(mod_sofia_globals.presence_queue, &pop) == SWITCH_STATUS_SUCCESS) {
                        switch_event_t *event = (switch_event_t *) pop;
@@ -1656,7 +1655,6 @@ void *SWITCH_THREAD_FUNC sofia_presence_event_thread_run(switch_thread_t *thread
                        }
 
                        switch_event_destroy(&event);
-                       count++;
                }
        }
 
index 60a7b61a3aa8dda3ff4a3df996d864e8f851f5c3..d12198d8b13d0f90fe822491561d26e4cbdf5628 100644 (file)
@@ -90,7 +90,7 @@ static const char *test_wait_for_chan_var(switch_channel_t *channel, const char
        return var;
 }
 
-static switch_bool_t has_ipv6() 
+static switch_bool_t has_ipv6(void
 {
        switch_stream_handle_t stream = { 0 };
        SWITCH_STANDARD_STREAM(stream);
@@ -110,7 +110,7 @@ static switch_bool_t has_ipv6()
        return SWITCH_TRUE;
 }
 
-static void register_gw()
+static void register_gw(void)
 {
        switch_stream_handle_t stream = { 0 };
        SWITCH_STANDARD_STREAM(stream);
@@ -118,7 +118,7 @@ static void register_gw()
        switch_safe_free(stream.data);
 }
 
-static void unregister_gw()
+static void unregister_gw(void)
 {
        switch_stream_handle_t stream = { 0 };
        SWITCH_STANDARD_STREAM(stream);
index 8920de7e02cb5312ab9d5ed3ccdcb9a708f975a1..9423d03c287c8dd05130accdabd2b9a866ebb935 100644 (file)
@@ -823,7 +823,6 @@ static void set_perm(const char *str, switch_event_t **event, switch_bool_t add)
 {
        char delim = ',';
        char *cur, *next;
-       int count = 0;
        char *edup;
 
        if (!zstr(str)) {
@@ -844,7 +843,7 @@ static void set_perm(const char *str, switch_event_t **event, switch_bool_t add)
                        delim = ' ';
                }
 
-               for (cur = edup; cur; count++) {
+               for (cur = edup; cur;) {
                        if ((next = strchr(cur, delim))) {
                                *next++ = '\0';
                        }
@@ -5579,8 +5578,6 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl
 {
        verto_profile_t *profile = NULL;
        jsock_t *jsock;
-       int cp = 0;
-       int cc = 0;
        const char *header = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";
        int i;
 
@@ -5594,14 +5591,12 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl
                        stream->write_function(stream, "<profile>\n<name>%s</name>\n<type>%s</type>\n<data>%s</data>\n<state>%s</state>\n</profile>\n", profile->name, "profile", tmpurl, (profile->running) ? "RUNNING" : "DOWN");
                        switch_safe_free(tmpurl);
                }
-               cp++;
 
                switch_mutex_lock(profile->mutex);
                for(jsock = profile->jsock_head; jsock; jsock = jsock->next) {
                        char *tmpname = switch_mprintf("%s@%s", jsock->id, jsock->domain);
                        stream->write_function(stream, "<client>\n<profile>%s</profile>\n<name>%s</name>\n<type>%s</type>\n<data>%s</data>\n<state>%s (%s)</state>\n</client>\n", profile->name, tmpname, "client", jsock->name,
                                                                         (!zstr(jsock->uid)) ? "CONN_REG" : "CONN_NO_REG",  (jsock->ptype & PTYPE_CLIENT_SSL) ? "WSS": "WS");
-                       cc++;
                        switch_safe_free(tmpname);
                }
                switch_mutex_unlock(profile->mutex);
@@ -5611,7 +5606,7 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl
        return SWITCH_STATUS_SUCCESS;
 }
 
-static cJSON *json_status()
+static cJSON *json_status(void)
 {
        cJSON *obj, *profiles, *jprofile, *users, *user;
        verto_profile_t *profile = NULL;
@@ -6740,14 +6735,14 @@ static void mod_verto_ks_logger(const char *file, const char *func, int line, in
        va_end(ap);
 }
 
-static void verto_event_free_subclass(
+static void verto_event_free_subclass(void)
 {
        switch_event_free_subclass(MY_EVENT_LOGIN);
        switch_event_free_subclass(MY_EVENT_CLIENT_DISCONNECT);
        switch_event_free_subclass(MY_EVENT_CLIENT_CONNECT);
 }
 
-static void verto_destroy_globals_hash_tables()
+static void verto_destroy_globals_hash_tables(void)
 {
        if (verto_globals.method_hash) {
                switch_core_hash_destroy(&verto_globals.method_hash);
index 20259251dec8952d324d3b02f922e8ab18ea4604..3ec8b060dfe8111797562739cba863b540173a00 100644 (file)
@@ -272,7 +272,7 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
 }
 
 
-static void do_rotate_all()
+static void do_rotate_all(void)
 {
        switch_hash_index_t *hi;
        void *val;
@@ -294,7 +294,7 @@ static void do_rotate_all()
 }
 
 
-static void do_teardown()
+static void do_teardown(void)
 {
        switch_hash_index_t *hi;
        void *val;
index 70331a95e288a3d4d8942c8359525d7dddda1131..520bd92ac7ab87f9201e7a45ccb8dd620b6e018c 100644 (file)
@@ -866,7 +866,7 @@ SWITCH_STANDARD_API(event_sink_function)
                char *loglevel = switch_event_get_header(stream->param_event, "loglevel");
                switch_memory_pool_t *pool;
                char *next, *cur;
-               uint32_t count = 0, key_count = 0;
+               uint32_t key_count = 0;
                uint8_t custom = 0;
                char *edup;
 
@@ -925,7 +925,7 @@ SWITCH_STANDARD_API(event_sink_function)
                                delim = ' ';
                        }
 
-                       for (cur = edup; cur; count++) {
+                       for (cur = edup; cur;) {
                                switch_event_types_t type;
 
                                if ((next = strchr(cur, delim))) {
@@ -1846,7 +1846,7 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
                                if (allowed_events) {
                                        char delim = ',';
                                        char *cur, *next;
-                                       int count = 0, custom = 0, key_count = 0;
+                                       int custom = 0;
 
                                        switch_set_flag(listener, LFLAG_AUTH_EVENTS);
 
@@ -1862,7 +1862,7 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
                                                delim = ' ';
                                        }
 
-                                       for (cur = edup; cur; count++) {
+                                       for (cur = edup; cur;) {
                                                switch_event_types_t type;
 
                                                if ((next = strchr(cur, delim))) {
@@ -1872,7 +1872,6 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
                                                if (custom) {
                                                        switch_core_hash_insert(listener->allowed_event_hash, cur, MARKER);
                                                } else if (switch_name_event(cur, &type) == SWITCH_STATUS_SUCCESS) {
-                                                       key_count++;
                                                        if (type == SWITCH_EVENT_ALL) {
                                                                uint32_t x = 0;
                                                                switch_set_flag(listener, LFLAG_ALL_EVENTS_AUTHED);
@@ -1904,7 +1903,6 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
                                if (allowed_api) {
                                        char delim = ',';
                                        char *cur, *next;
-                                       int count = 0;
 
                                        switch_snprintf(api_reply, sizeof(api_reply), "Allowed-API: %s\n", allowed_api);
 
@@ -1916,7 +1914,7 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
                                                delim = ' ';
                                        }
 
-                                       for (cur = edup; cur; count++) {
+                                       for (cur = edup; cur;) {
                                                if ((next = strchr(cur, delim))) {
                                                        *next++ = '\0';
                                                }
@@ -2540,14 +2538,14 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
 
        } else if (!strncasecmp(cmd, "nixevent", 8)) {
                char *next, *cur;
-               uint32_t count = 0, key_count = 0;
+               uint32_t key_count = 0;
                uint8_t custom = 0;
 
                strip_cr(cmd);
                cur = cmd + 8;
 
                if ((cur = strchr(cur, ' '))) {
-                       for (cur++; cur; count++) {
+                       for (cur++; cur;) {
                                switch_event_types_t type;
 
                                if ((next = strchr(cur, ' '))) {
index 4e3bd81f784de7f82d22ea2821ff4ad1768e5806..8a6efbf54417d92cc4f81e0d4a9152219ea1a776 100644 (file)
@@ -88,7 +88,7 @@ static size_t httpCallBack(char *buffer, size_t size, size_t nitems, void *outst
        return size * nitems;
 }
 
-static switch_status_t set_xml_cdr_log_dirs()
+static switch_status_t set_xml_cdr_log_dirs(void)
 {
        switch_time_exp_t tm;
        char *path = NULL;
@@ -254,7 +254,7 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
 #endif
                                int wrote;
                                wrote = write(fd, xml_text, (unsigned) strlen(xml_text));
-                               wrote++;
+                               (void)wrote;
                                close(fd);
                        } else {
                                char ebuf[512] = { 0 };
@@ -427,7 +427,7 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
 #endif
                                int wrote;
                                wrote = write(fd, xml_text, (unsigned) strlen(xml_text));
-                               wrote++;
+                               (void)wrote;
                                close(fd);
                        } else {
                                char ebuf[512] = { 0 };
index 19a3d93fad7382b54ed910e31018c6515a111b9a..5011ff2d46ddc3aa9acd38ccad335b245416a3b3 100644 (file)
@@ -101,7 +101,7 @@ static void handle_SIGTERM(int sig)
 }
 
 /* kill a freeswitch process running in background mode */
-static int freeswitch_kill_background()
+static int freeswitch_kill_background(void)
 {
        FILE *f;                                        /* FILE handle to open the pid file */
        char path[PATH_MAX] = "";               /* full path of the PID file */
index 4e2b70778a70522f35c26d25a3d7cc457bc6fed8..7ec10d88856ae3b9118867b10123e055876971e0 100644 (file)
@@ -3566,7 +3566,7 @@ SWITCH_DECLARE(int) switch_stream_system(const char *cmd, switch_stream_handle_t
        }
 }
 
-SWITCH_DECLARE(uint16_t) switch_core_get_rtp_port_range_start_port()
+SWITCH_DECLARE(uint16_t) switch_core_get_rtp_port_range_start_port(void)
 {
        uint16_t start_port = 0;
 
@@ -3577,7 +3577,7 @@ SWITCH_DECLARE(uint16_t) switch_core_get_rtp_port_range_start_port()
        return start_port;
 }
 
-SWITCH_DECLARE(uint16_t) switch_core_get_rtp_port_range_end_port()
+SWITCH_DECLARE(uint16_t) switch_core_get_rtp_port_range_end_port(void)
 {
        uint16_t end_port = 0;
 
index 60cc3d531c27322d04367850f19c6e0ab3ecc8d0..e75387581d0ef4113a181b62c67bb0f59cb98d6c 100644 (file)
@@ -4762,7 +4762,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
        switch_channel_t *channel = switch_core_session_get_channel(session);
        const char *val;
        const char *crypto = NULL;
-       int got_crypto = 0, got_video_crypto = 0, got_audio = 0, saw_audio = 0, saw_video = 0, got_avp = 0, got_video_avp = 0, got_video_savp = 0, got_savp = 0, got_udptl = 0, got_webrtc = 0, got_text = 0, got_text_crypto = 0, got_msrp = 0;
+       int got_crypto = 0, got_video_crypto = 0, got_audio = 0, saw_audio = 0, saw_video = 0, got_avp = 0, got_savp = 0, got_udptl = 0, got_webrtc = 0, got_text = 0, got_text_crypto = 0, got_msrp = 0;
        int scrooge = 0;
        sdp_parser_t *parser = NULL;
        sdp_session_t *sdp;
@@ -4958,14 +4958,10 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
                if (m->m_proto == sdp_proto_srtp || m->m_proto == sdp_proto_extended_srtp) {
                        if (m->m_type == sdp_media_audio) {
                                got_savp++;
-                       } else {
-                               got_video_savp++;
                        }
                } else if (m->m_proto == sdp_proto_rtp) {
                        if (m->m_type == sdp_media_audio) {
                                got_avp++;
-                       } else {
-                               got_video_avp++;
                        }
                } else if (m->m_proto == sdp_proto_udptl) {
                        got_udptl++;
@@ -7406,7 +7402,7 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
        switch_status_t status;
        switch_frame_t *read_frame = NULL;
        switch_media_handle_t *smh;
-       uint32_t loops = 0, xloops = 0, vloops = 0;
+       uint32_t loops = 0, xloops = 0;
        switch_image_t *blank_img = NULL;
        switch_frame_t fr = { 0 };
        unsigned char *buf = NULL;
@@ -7531,8 +7527,6 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
                        continue;
                }
 
-               vloops++;
-
                send_blank = blank_enabled || switch_channel_test_flag(channel, CF_VIDEO_ECHO);
 
                if (switch_channel_test_flag(channel, CF_VIDEO_READY) && !switch_test_flag(read_frame, SFF_CNG)) {
@@ -14243,7 +14237,7 @@ SWITCH_DECLARE(char *) switch_core_media_filter_sdp(const char *sdp_str, const c
        switch_size_t len;
        const char *i;
        char *o;
-       int in_m = 0, m_tally = 0, slash = 0;
+       int in_m = 0, slash = 0;
        int number = 0, skip = 0;
        int remove = !strcasecmp(cmd, "remove");
        int only = !strcasecmp(cmd, "only");
@@ -14277,7 +14271,6 @@ SWITCH_DECLARE(char *) switch_core_media_filter_sdp(const char *sdp_str, const c
 
                if (*i == 'm' && *(i+1) == '=') {
                        in_m = 1;
-                       m_tally++;
                }
 
                if (in_m) {
@@ -14981,7 +14974,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core
 {
        switch_status_t status = SWITCH_STATUS_FALSE;
        switch_io_event_hook_video_read_frame_t *ptr;
-       uint32_t loops = 0;
        switch_media_handle_t *smh;
        int is_keyframe = 0;
 
@@ -14993,8 +14985,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core
 
  top:
 
-       loops++;
-
        if (switch_channel_down_nosig(session->channel)) {
                return SWITCH_STATUS_FALSE;
        }
index be49f2fc14579b575f430f5caa50f0854ce7ea44..272255d31c41e5873f9389a581b8a4d8ea81ea84 100644 (file)
@@ -651,7 +651,6 @@ SWITCH_DECLARE(void) switch_event_launch_dispatch_threads(uint32_t max)
 {
        switch_threadattr_t *thd_attr;
        uint32_t index = 0;
-       int launched = 0;
        uint32_t sanity = 200;
 
        switch_memory_pool_t *pool = RUNTIME_POOL;
@@ -682,7 +681,6 @@ SWITCH_DECLARE(void) switch_event_launch_dispatch_threads(uint32_t max)
                } else {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Create additional event dispatch thread %d\n", index);
                }
-               launched++;
        }
 
        SOFT_MAX_DISPATCH = index;
index 25486eee7fe4a1bc4d87c07e087df9f02232176b..33f3a4e51abbb989c9619cbb2e8054eaea947cca 100644 (file)
@@ -1271,7 +1271,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
        int sleep_val_i = 250;
        int eof = 0;
        switch_size_t bread = 0;
-       int l16 = 0;
        switch_codec_implementation_t read_impl = { 0 };
        char *file_dup;
        char *argv[128] = { 0 };
@@ -1334,10 +1333,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
 
        arg_recursion_check_start(args);
 
-       if (!zstr(read_impl.iananame) && !strcasecmp(read_impl.iananame, "l16")) {
-               l16++;
-       }
-
        if (play_delimiter) {
                file_dup = switch_core_session_strdup(session, file);
                argc = switch_separate_string(file_dup, play_delimiter, argv, (sizeof(argv) / sizeof(argv[0])));
index f782e89f6ebc3915078cd7e57235e9e5ec98f693..0964943acac9f459e7e0d23d98fc4b445339c18a 100644 (file)
@@ -115,12 +115,11 @@ static void *SWITCH_THREAD_FUNC switch_loadable_module_exec(switch_thread_t *thr
        switch_status_t status = SWITCH_STATUS_SUCCESS;
        switch_core_thread_session_t *ts = obj;
        switch_loadable_module_t *module = ts->objs[0];
-       int restarts;
 
        switch_assert(thread != NULL);
        switch_assert(module != NULL);
 
-       for (restarts = 0; status != SWITCH_STATUS_TERM && !module->shutting_down; restarts++) {
+       for (; status != SWITCH_STATUS_TERM && !module->shutting_down;) {
                status = module->switch_module_runtime();
        }
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Thread ended for %s\n", module->module_interface->module_name);
index 74a5713635b40b309b2f146a35e9961c2ad05458..563a554510f417fcb6311066442ae56eb69efbc0 100644 (file)
@@ -246,7 +246,7 @@ SWITCH_DECLARE(cJSON *) switch_log_node_to_json(const switch_log_node_t *node, i
        return json;
 }
 
-static switch_log_node_t *switch_log_node_alloc()
+static switch_log_node_t *switch_log_node_alloc(void)
 {
        switch_log_node_t *node = NULL;
 #ifdef SWITCH_LOG_RECYCLE
index 1f5db7ac2012e3b6f4c43ea287c3a9d3771fe23b..9fd84d846b738a142851ab15a0a27336f5b10f2e 100644 (file)
@@ -99,7 +99,7 @@ static switch_bool_t msrp_check_success_report(switch_msrp_msg_t *msrp_msg)
        return (msrp_h_success_report && !strcmp(msrp_h_success_report, "yes"));
 }
 
-static void msrp_deinit_ssl()
+static void msrp_deinit_ssl(void)
 {
        globals.ssl_ready = 0;
        if (globals.ssl_ctx) {
@@ -112,7 +112,7 @@ static void msrp_deinit_ssl()
        }
 }
 
-static void msrp_init_ssl()
+static void msrp_init_ssl(void)
 {
        const char *err = "";
 
@@ -187,7 +187,7 @@ static void msrp_init_ssl()
 
 SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_ip, globals.ip);
 
-static switch_status_t load_config()
+static switch_status_t load_config(void)
 {
        char *cf = "msrp.conf";
        switch_xml_t cfg, xml = NULL, settings, param;
@@ -286,12 +286,12 @@ sock_fail:
        return rv;
 }
 
-SWITCH_DECLARE(const char *) switch_msrp_listen_ip()
+SWITCH_DECLARE(const char *) switch_msrp_listen_ip(void)
 {
        return globals.ip;
 }
 
-SWITCH_DECLARE(switch_status_t) switch_msrp_init()
+SWITCH_DECLARE(switch_status_t) switch_msrp_init(void)
 {
        switch_memory_pool_t *pool;
        switch_thread_t *thread;
@@ -346,7 +346,7 @@ SWITCH_DECLARE(switch_status_t) switch_msrp_init()
        return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_DECLARE(switch_status_t) switch_msrp_destroy()
+SWITCH_DECLARE(switch_status_t) switch_msrp_destroy(void)
 {
        switch_status_t st = SWITCH_STATUS_SUCCESS;
        switch_socket_t *sock;
@@ -1622,7 +1622,7 @@ SWITCH_DECLARE (switch_status_t) switch_msrp_perform_send(switch_msrp_session_t
        return status;
 }
 
-SWITCH_DECLARE(switch_msrp_msg_t *) switch_msrp_msg_create()
+SWITCH_DECLARE(switch_msrp_msg_t *) switch_msrp_msg_create(void)
 {
        switch_msrp_msg_t *msg = malloc(sizeof(switch_msrp_msg_t));
        switch_assert(msg);
index 05b0858313fc468a48843aef6adb003a938166a2..91e1fca823e1fcea9ecb9a7b555c4da2bc7dd61a 100644 (file)
@@ -262,8 +262,8 @@ typedef struct {
 
 struct switch_rtp;
 
-static void switch_rtp_dtls_init();
-static void switch_rtp_dtls_destroy();
+static void switch_rtp_dtls_init(void);
+static void switch_rtp_dtls_destroy(void);
 
 #define MAX_DTLS_MTU 4096
 
@@ -1660,7 +1660,7 @@ static void rtcp_generate_sender_info(switch_rtp_t *rtp_session, struct switch_r
                        );
 }
 
-static inline uint32_t calc_local_lsr_now() 
+static inline uint32_t calc_local_lsr_now(void
 {
        switch_time_t now;
        uint32_t ntp_sec, ntp_usec, lsr_now, sec;
@@ -3493,7 +3493,7 @@ static BIO_METHOD dtls_bio_filter_methods = {
 static BIO_METHOD *dtls_bio_filter_methods = NULL;
 #endif
 
-static void switch_rtp_dtls_init() {
+static void switch_rtp_dtls_init(void) {
 #if OPENSSL_VERSION_NUMBER >= 0x10100000L
        dtls_bio_filter_methods = BIO_meth_new(BIO_TYPE_FILTER | BIO_get_new_index(), "DTLS filter");
        BIO_meth_set_write(dtls_bio_filter_methods, dtls_bio_filter_write);
@@ -3503,7 +3503,7 @@ static void switch_rtp_dtls_init() {
 #endif
 }
 
-static void switch_rtp_dtls_destroy() {
+static void switch_rtp_dtls_destroy(void) {
 #if OPENSSL_VERSION_NUMBER >= 0x10100000L
        if (dtls_bio_filter_methods) {
                BIO_meth_free(dtls_bio_filter_methods);
@@ -5494,7 +5494,6 @@ static switch_size_t do_flush(switch_rtp_t *rtp_session, int force, switch_size_
 {
        int was_blocking = 0;
        switch_size_t bytes;
-       uint32_t flushed = 0;
        switch_size_t bytes_out = 0;
 
        if (!switch_rtp_ready(rtp_session)) {
@@ -5576,8 +5575,6 @@ static switch_size_t do_flush(switch_rtp_t *rtp_session, int force, switch_size_
 #endif
                                        }
 
-                                       flushed++;
-
                                        rtp_session->stats.inbound.raw_bytes += bytes;
                                        rtp_session->stats.inbound.flush_packet_count++;
                                        rtp_session->stats.inbound.packet_count++;
index 122ae79a73cbc4c25ead4b6451650bbc48929a65..5a97b082f2b1cba3a86f2bf457b07ed27a87e1ce 100644 (file)
@@ -470,7 +470,7 @@ static switch_status_t switch_speex_destroy(switch_codec_t *codec)
 /**
  * read default settings from speex.conf
  */
-static void load_configuration()
+static void load_configuration(void)
 {
        switch_xml_t xml = NULL, cfg = NULL;
 
index 445e698f9b71899fa3fa1527fc1710422ae11920..a56c5e96f1fc44895d754ef95827f134a8c41b1b 100644 (file)
@@ -1173,9 +1173,8 @@ SWITCH_MODULE_RUNTIME_FUNCTION(softtimer_runtime)
                        } else {
                                if (tfd > -1 && globals.RUNNING == 1) {
                                        uint64_t exp;
-                                       int r;
-                                       r = read(tfd, &exp, sizeof(exp));
-                                       r++;
+                                       read(tfd, &exp, sizeof(exp));
+                                       (void)exp;
                                } else {
                                        switch_time_t timediff = runtime.reference - ts;
 
index d8b830943a9cf9a15733019da88570febcdfc520..332137ebdae0ebe1060652ae2e457b0e7d682ef2 100644 (file)
@@ -139,13 +139,10 @@ struct switch_frame_buffer_s {
 static switch_frame_t *find_free_frame(switch_frame_buffer_t *fb, switch_frame_t *orig)
 {
        switch_frame_node_t *np;
-       int x = 0;
 
        switch_mutex_lock(fb->mutex);
 
        for (np = fb->head; np; np = np->next) {
-               x++;
-
                if (!np->inuse && ((orig->packet && np->frame->packet) || (!orig->packet && !np->frame->packet))) {
 
                        if (np == fb->head) {
index e35d87712fb40ce66129c78ae17a94aa231848f6..751f2b8c5b8708268d215ef01b0b74122f36b5be 100644 (file)
@@ -1853,7 +1853,7 @@ static void parse_codecs(my_vpx_cfg_t *my_cfg, switch_xml_t codecs)
        }
 }
 
-static void load_config()
+static void load_config(void)
 {
        switch_xml_t cfg = NULL, xml = NULL;
        my_vpx_cfg_t *my_cfg = NULL;