]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fix windows build
authorMoises Silva <moy@sangoma.com>
Thu, 26 Nov 2009 16:01:55 +0000 (16:01 +0000)
committerMoises Silva <moy@sangoma.com>
Thu, 26 Nov 2009 16:01:55 +0000 (16:01 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@908 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/freetdm/mod_openzap/mod_openzap.c
libs/freetdm/src/ozmod/ozmod_wanpipe/ozmod_wanpipe.c
libs/freetdm/src/zap_io.c
libs/freetdm/src/zap_threadmutex.c

index defdc25a8ae54f82952a914934f36ed257da1c9d..53546e23ecf6b660860152baa599e18126c34c40 100644 (file)
@@ -1844,6 +1844,7 @@ static switch_status_t load_config(void)
        zap_span_t *boost_spans[ZAP_MAX_PHYSICAL_SPANS_PER_LOGICAL_SPAN];
        zap_span_t *boost_span = NULL;
        unsigned boosti = 0;
+       unsigned int i = 0;
 
        memset(boost_spans, 0, sizeof(boost_spans));
        memset(&globals, 0, sizeof(globals));
@@ -2558,7 +2559,6 @@ static switch_status_t load_config(void)
 
        /* start all boost spans now that we're done configuring. Unfortunately at this point boost modules have the limitation
         * of needing all spans to be configured before starting them */
-       unsigned i = 0;
        for ( ; i < boosti; i++) {
                boost_span = boost_spans[i];
                zap_log(ZAP_LOG_DEBUG, "Starting boost span %d\n", boost_span->span_id);
index f239d59f8c3d200bcc143920f751d25f73ac92b4..5e69cf435665c31b16090ef690d2ae7d8ba56374 100644 (file)
@@ -271,14 +271,14 @@ static unsigned wp_open_range(zap_span_t *span, unsigned spanno, unsigned start,
                                        chan->native_codec = chan->effective_codec = ZAP_CODEC_ULAW;
                                }
 
-                               err = sangoma_tdm_get_hw_dtmf(chan->sockfd, &tdm_api);
-                               if (err > 0) {
+                               //err = sangoma_tdm_get_hw_dtmf(chan->sockfd, &tdm_api);
+                               //if (err > 0) {
                                        err = sangoma_tdm_enable_dtmf_events(chan->sockfd, &tdm_api);
                                        if (err == 0) {
                                                zap_channel_set_feature(chan, ZAP_CHANNEL_FEATURE_DTMF_DETECT);
                                                dtmf = "hardware";
                                        }
-                               }
+                               //}
                        }
 
 #if 0
index f4627ea7fe4a412f2f8460518b55bbdc2f809535..b048d7a11be65265b597e8bd8391a85030ab1058 100644 (file)
@@ -181,31 +181,35 @@ static void default_logger(const char *file, const char *func, int line, int lev
 
 }
 
-static inline void *zap_std_malloc(void *pool, zap_size_t size)
+static __inline__ void *zap_std_malloc(void *pool, zap_size_t size)
 {
        void *ptr = malloc(size);
+       pool = NULL; /* fix warning */
        zap_assert(ptr != NULL, NULL, "Out of memory");
        return ptr;
 }
 
-static inline void *zap_std_calloc(void *pool, zap_size_t elements, zap_size_t size)
+static __inline__ void *zap_std_calloc(void *pool, zap_size_t elements, zap_size_t size)
 {
        void *ptr = calloc(elements, size);
+       pool = NULL;
        zap_assert(ptr != NULL, NULL, "Out of memory");
        return ptr;
 }
 
-static inline void zap_std_free(void *pool, void *ptr)
+static __inline__ void zap_std_free(void *pool, void *ptr)
 {
+       pool = NULL;
+       zap_assert(ptr != NULL, , "Attempted to free null pointer");
        free(ptr);
 }
 
 OZ_DECLARE_DATA zap_memory_handler_t g_zap_mem_handler = 
 {
-       .pool = NULL,
-       .malloc = zap_std_malloc,
-       .calloc = zap_std_calloc,
-       .free = zap_std_free
+       /*.pool =*/ NULL,
+       /*.malloc =*/ zap_std_malloc,
+       /*.calloc =*/ zap_std_calloc,
+       /*.free =*/ zap_std_free
 };
 
 OZ_DECLARE_DATA zap_crash_policy_t g_zap_crash_policy = ZAP_CRASH_NEVER;
@@ -762,7 +766,7 @@ OZ_DECLARE(void) zap_channel_rotate_tokens(zap_channel_t *zchan)
 
 OZ_DECLARE(void) zap_channel_replace_token(zap_channel_t *zchan, const char *old_token, const char *new_token)
 {
-       int i;
+       unsigned int i;
 
        if (zchan->token_count) {
                for(i = 0; i < zchan->token_count; i++) {
index e0744158a7ff70f12ae2361120185c786489e1b1..0661decfd74c3e3187e69ac128d3f93839a5dbe0 100644 (file)
@@ -274,19 +274,20 @@ failed:
 
 OZ_DECLARE(zap_status_t) zap_condition_wait(zap_condition_t *condition, int ms)
 {
-       zap_assert(condition != NULL, ZAP_FAIL, "Condition is null!\n");
 #ifdef WIN32
        DWORD res = 0;
-       res = WaitForSingleObject(condition->condition, waitms > 0 ? waitms : INFINITE);
+#endif
+       zap_assert(condition != NULL, ZAP_FAIL, "Condition is null!\n");
+#ifdef WIN32
+       res = WaitForSingleObject(condition->condition, ms > 0 ? ms : INFINITE);
        switch (res) {
        case WAIT_ABANDONED:
        case WAIT_TIMEOUT:
                return ZAP_TIMEOUT;
        case WAIT_FAILED:
                return ZAP_FAIL;
-       defaul:
-               zap_log(ZAP_LOG_ERROR, "Error waiting for openzap condition event\n");
-                       return ZAP_FAIL;
+       default:
+               zap_log(ZAP_LOG_ERROR, "Error waiting for openzap condition event (WaitForSingleObject returned %d)\n", res);
        }
 #else
        int res = 0;