mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
Compiler fixes for gcc 10
This patch fixes a few compile warnings/errors that now occur when using gcc 10+. Also, the Makefile.rules check to turn off partial inlining in gcc versions greater or equal to 8.2.1 had a bug where it only it only checked against versions with at least 3 numbers (ex: 8.2.1 vs 10). This patch now ensures any version above the specified version is correctly compared. Change-Id: I54718496eb0c3ce5bd6d427cd279a29e8d2825f9
This commit is contained in:
committed by
Friendly Automation
parent
559fa0e89c
commit
3d1bf3c537
@@ -6519,6 +6519,8 @@ void ast_merge_contexts_and_delete(struct ast_context **extcontexts, struct ast_
|
||||
i = ao2_iterator_init(hints, AO2_ITERATOR_DONTLOCK);
|
||||
for (; (hint = ao2_iterator_next(&i)); ao2_ref(hint, -1)) {
|
||||
if (ao2_container_count(hint->callbacks)) {
|
||||
size_t exten_len;
|
||||
|
||||
ao2_lock(hint);
|
||||
if (!hint->exten) {
|
||||
/* The extension has already been destroyed. (Should never happen here) */
|
||||
@@ -6526,7 +6528,8 @@ void ast_merge_contexts_and_delete(struct ast_context **extcontexts, struct ast_
|
||||
continue;
|
||||
}
|
||||
|
||||
length = strlen(hint->exten->exten) + strlen(hint->exten->parent->name) + 2
|
||||
exten_len = strlen(hint->exten->exten) + 1;
|
||||
length = exten_len + strlen(hint->exten->parent->name) + 1
|
||||
+ sizeof(*saved_hint);
|
||||
if (!(saved_hint = ast_calloc(1, length))) {
|
||||
ao2_unlock(hint);
|
||||
@@ -6546,7 +6549,7 @@ void ast_merge_contexts_and_delete(struct ast_context **extcontexts, struct ast_
|
||||
saved_hint->context = saved_hint->data;
|
||||
strcpy(saved_hint->data, hint->exten->parent->name);
|
||||
saved_hint->exten = saved_hint->data + strlen(saved_hint->context) + 1;
|
||||
strcpy(saved_hint->exten, hint->exten->exten);
|
||||
ast_copy_string(saved_hint->exten, hint->exten->exten, exten_len);
|
||||
if (hint->last_presence_subtype) {
|
||||
saved_hint->last_presence_subtype = ast_strdup(hint->last_presence_subtype);
|
||||
}
|
||||
|
Reference in New Issue
Block a user