mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-21 04:03:28 +00:00
various files - fix some alerts raised by lgtm code analysis
This patch fixes several issues reported by the lgtm code analysis tool: https://lgtm.com/projects/g/asterisk/asterisk Not all reported issues were addressed in this patch. This patch mostly fixes confirmed reported errors, potential problematic code points, and a few other "low hanging" warnings or recommendations found in core supported modules. These include, but are not limited to the following: * innapropriate stack allocation in loops * buffer overflows * variable declaration "hiding" another variable declaration * comparisons results that are always the same * ambiguously signed bit-field members * missing header guards Change-Id: Id4a881686605d26c94ab5409bc70fcc21efacc25
This commit is contained in:
committed by
George Joseph
parent
990a91b44a
commit
bdd785d31c
@@ -301,7 +301,7 @@
|
||||
#define TOPIC_POOL_BUCKETS 57
|
||||
|
||||
/*! Thread pool for topics that don't want a dedicated taskprocessor */
|
||||
static struct ast_threadpool *pool;
|
||||
static struct ast_threadpool *threadpool;
|
||||
|
||||
STASIS_MESSAGE_TYPE_DEFN(stasis_subscription_change_type);
|
||||
|
||||
@@ -900,7 +900,7 @@ struct stasis_subscription *internal_stasis_subscribe(
|
||||
* pool should be used.
|
||||
*/
|
||||
if (use_thread_pool) {
|
||||
sub->mailbox = ast_threadpool_serializer(tps_name, pool);
|
||||
sub->mailbox = ast_threadpool_serializer(tps_name, threadpool);
|
||||
} else {
|
||||
sub->mailbox = ast_taskprocessor_get(tps_name, TPS_REF_DEFAULT);
|
||||
}
|
||||
@@ -3027,8 +3027,8 @@ static void stasis_cleanup(void)
|
||||
ast_cli_unregister_multiple(cli_stasis, ARRAY_LEN(cli_stasis));
|
||||
ao2_cleanup(topic_all);
|
||||
topic_all = NULL;
|
||||
ast_threadpool_shutdown(pool);
|
||||
pool = NULL;
|
||||
ast_threadpool_shutdown(threadpool);
|
||||
threadpool = NULL;
|
||||
STASIS_MESSAGE_TYPE_CLEANUP(stasis_subscription_change_type);
|
||||
STASIS_MESSAGE_TYPE_CLEANUP(ast_multi_user_event_type);
|
||||
aco_info_destroy(&cfg_info);
|
||||
@@ -3105,9 +3105,9 @@ int stasis_init(void)
|
||||
threadpool_opts.auto_increment = 1;
|
||||
threadpool_opts.max_size = cfg->threadpool_options->max_size;
|
||||
threadpool_opts.idle_timeout = cfg->threadpool_options->idle_timeout_sec;
|
||||
pool = ast_threadpool_create("stasis", NULL, &threadpool_opts);
|
||||
threadpool = ast_threadpool_create("stasis", NULL, &threadpool_opts);
|
||||
ao2_ref(cfg, -1);
|
||||
if (!pool) {
|
||||
if (!threadpool) {
|
||||
ast_log(LOG_ERROR, "Failed to create 'stasis-core' threadpool\n");
|
||||
|
||||
return -1;
|
||||
|
Reference in New Issue
Block a user