]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix FSCORE-188
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 12 Sep 2008 18:04:58 +0000 (18:04 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 12 Sep 2008 18:04:58 +0000 (18:04 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9545 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_event.c

index 33597373f6af1ac9bf1861a43d1b35da34024e38..3c14aa02822ebc47a4afbe40c66548db6edecee7 100644 (file)
@@ -34,7 +34,7 @@
 
 #include <switch.h>
 #include <switch_event.h>
-#define MAX_DISPATCH 20
+
 #define DISPATCH_QUEUE_LEN 5000
 //#define DEBUG_DISPATCH_QUEUES
 
@@ -61,7 +61,9 @@ struct switch_event_subclass {
        char *name;
 };
 
-static int SOFT_MAX_DISPATCH = 0;
+#define MAX_DISPATCH_VAL 20
+static unsigned int MAX_DISPATCH = MAX_DISPATCH_VAL;
+static unsigned int SOFT_MAX_DISPATCH = 0;
 static char hostname[128] = "";
 static char guess_ip_v4[80] = "";
 static char guess_ip_v6[80] = "";
@@ -73,7 +75,7 @@ static switch_memory_pool_t *RUNTIME_POOL = NULL;
 static switch_memory_pool_t *THRUNTIME_POOL = NULL;
 #define NUMBER_OF_QUEUES 3
 static switch_queue_t *EVENT_QUEUE[NUMBER_OF_QUEUES] = { 0 };
-static switch_queue_t *EVENT_DISPATCH_QUEUE[MAX_DISPATCH] = { 0 };
+static switch_queue_t *EVENT_DISPATCH_QUEUE[MAX_DISPATCH_VAL] = { 0 };
 static int POOL_COUNT_MAX = SWITCH_CORE_QUEUE_LEN;
 static switch_mutex_t *EVENT_QUEUE_MUTEX = NULL;
 static switch_hash_t *CUSTOM_HASH = NULL;
@@ -416,7 +418,8 @@ SWITCH_DECLARE(void) switch_core_memory_reclaim_events(void)
 
 SWITCH_DECLARE(switch_status_t) switch_event_shutdown(void)
 {
-       int x = 0, last = 0;
+       uint32_t x = 0;
+       int last = 0;
        switch_hash_index_t *hi;
        const void *var;
     void *val;
@@ -463,7 +466,7 @@ static void launch_dispatch_threads(int max, int len, switch_memory_pool_t *pool
 {
        switch_thread_t *thread;
        switch_threadattr_t *thd_attr;
-       int index = 0;
+       uint32_t index = 0;
 
        if (max > MAX_DISPATCH) {
                return;