\param new pointer for the return value
\return SWITCH_STATUS_SUCCESS if the operation was a success
*/
-SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_new(switch_port_t start, switch_port_t end, uint32_t inc, switch_core_port_allocator_t **new);
+SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_new(switch_port_t start, switch_port_t end, uint8_t inc, switch_core_port_allocator_t **new_allocator);
/*!
\brief Get a port from the port allocator
BEGIN_EXTERN_C
-static const switch_state_handler_table_t noop_state_handler = {};
+static const switch_state_handler_table_t noop_state_handler = {0};
/**
* @defgroup switch_ivr IVR Library
switch_port_t start;
switch_port_t end;
switch_port_t next;
- uint32_t inc;
+ uint8_t inc;
switch_mutex_t *mutex;
switch_memory_pool_t *pool;
};
-SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_new(switch_port_t start, switch_port_t end, uint32_t inc, switch_core_port_allocator_t **new)
+SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_new(switch_port_t start, switch_port_t end, uint8_t inc, switch_core_port_allocator_t **new_allocator)
{
switch_status_t status;
switch_memory_pool_t *pool;
}
switch_mutex_init(&alloc->mutex, SWITCH_MUTEX_NESTED, pool);
alloc->pool = pool;
- *new = alloc;
+ *new_allocator = alloc;
return SWITCH_STATUS_SUCCESS;
}
switch_mutex_lock(alloc->mutex);
port = alloc->next;
- alloc->next += alloc->inc;
+ alloc->next = alloc->next + alloc->inc;
if (alloc->next > alloc->end) {
alloc->next = alloc->start;
}