[Asterisk-code-review] pbx_variables: Use const char if possible. (asterisk[master])
George Joseph
asteriskteam at digium.com
Sun Sep 11 08:32:40 CDT 2022
George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/19055 )
Change subject: pbx_variables: Use const char if possible.
......................................................................
pbx_variables: Use const char if possible.
Use const char for char arguments to
pbx_substitute_variables_helper_full_location
that can do so (context and exten).
ASTERISK-30209 #close
Change-Id: I001357177e9c3dca2b2b4eebc5650c1095b3da6f
---
M include/asterisk/pbx.h
M main/pbx_variables.c
2 files changed, 17 insertions(+), 2 deletions(-)
Approvals:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved; Approved for Submit
diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h
index 9cc7f0b..593b186 100644
--- a/include/asterisk/pbx.h
+++ b/include/asterisk/pbx.h
@@ -1432,7 +1432,7 @@
/*!
* \brief Substitutes variables, similar to pbx_substitute_variables_helper_full, but allows passing the context, extension, and priority in.
*/
-void pbx_substitute_variables_helper_full_location(struct ast_channel *c, struct varshead *headp, const char *cp1, char *cp2, int cp2_size, size_t *used, char *context, char *exten, int pri);
+void pbx_substitute_variables_helper_full_location(struct ast_channel *c, struct varshead *headp, const char *cp1, char *cp2, int cp2_size, size_t *used, const char *context, const char *exten, int pri);
/*! @} */
/*! @name Substitution routines, using dynamic string buffers
diff --git a/main/pbx_variables.c b/main/pbx_variables.c
index f589b6b..b05a9d1 100644
--- a/main/pbx_variables.c
+++ b/main/pbx_variables.c
@@ -662,7 +662,7 @@
pbx_substitute_variables_helper_full_location(c, headp, cp1, cp2, count, used, NULL, NULL, 0);
}
-void pbx_substitute_variables_helper_full_location(struct ast_channel *c, struct varshead *headp, const char *cp1, char *cp2, int count, size_t *used, char *context, char *exten, int pri)
+void pbx_substitute_variables_helper_full_location(struct ast_channel *c, struct varshead *headp, const char *cp1, char *cp2, int count, size_t *used, const char *context, const char *exten, int pri)
{
/* Substitutes variables into cp2, based on string cp1, cp2 NO LONGER NEEDS TO BE ZEROED OUT!!!! */
const char *whereweare;
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19055
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I001357177e9c3dca2b2b4eebc5650c1095b3da6f
Gerrit-Change-Number: 19055
Gerrit-PatchSet: 2
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220911/8fba88d2/attachment.html>
More information about the asterisk-code-review
mailing list