[Asterisk-code-review] func_groupcount.c: Adding Group Variables + additional Group functions (asterisk[18])

N A asteriskteam at digium.com
Sat Jan 14 14:42:50 CST 2023


Attention is currently required from: Mark Murawski.

N A has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/17655 )

Change subject: func_groupcount.c: Adding Group Variables + additional Group functions
......................................................................


Patch Set 21: Code-Review-1

(8 comments)

File funcs/func_groupcount.c:

https://gerrit.asterisk.org/c/asterisk/+/17655/comment/e8ba56c5_9297dca4 
PS21, Line 1186:         buf[1] = '\0';
whitespace issue


https://gerrit.asterisk.org/c/asterisk/+/17655/comment/f76c9965_37698c35 
PS21, Line 1253: 	snprintf(groups_ret, sizeof(groups_ret), "%d", groups);
Couldn't you just snprintf into buf directly? Why the intermediate buffer?


https://gerrit.asterisk.org/c/asterisk/+/17655/comment/7051e55d_a9982fa5 
PS21, Line 1419: 		return 0;
This should return -1


File main/app.c:

https://gerrit.asterisk.org/c/asterisk/+/17655/comment/87880186_763f294f 
PS21, Line 2423: int ast_app_group_set_var(struct ast_channel *chan, const char *group, const char *category, const char *name, const char *value) {
Opening brace should be on a separate line


https://gerrit.asterisk.org/c/asterisk/+/17655/comment/39023dee_7d6862a9 
PS21, Line 2431: 		return 0;
I see in the documentation we return 0 on failure and 1 on success, but why is that?


https://gerrit.asterisk.org/c/asterisk/+/17655/comment/f0795020_a7e3a253 
PS21, Line 2444: 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&groups_meta, gmi, group_meta_list) {
!= 0 is unnecessary here


https://gerrit.asterisk.org/c/asterisk/+/17655/comment/00cf3831_611f2210 
PS21, Line 2479: 	if (newvariable == NULL) {
Could just do !newvariable


https://gerrit.asterisk.org/c/asterisk/+/17655/comment/9dccac02_7ce47c38 
PS21, Line 2854: int ast_app_group_meta_wrlock(void)
I must be missing something, but why are these functions here? I see them in the header file, and here, why are they needed?



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/17655
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: I23e48d1cdfc8adaffdfec2e936e56143603914f2
Gerrit-Change-Number: 17655
Gerrit-PatchSet: 21
Gerrit-Owner: Mark Murawski <markm at intellasoft.net>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: N A <asterisk at phreaknet.org>
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-CC: George Joseph <gjoseph at digium.com>
Gerrit-Attention: Mark Murawski <markm at intellasoft.net>
Gerrit-Comment-Date: Sat, 14 Jan 2023 20:42:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20230114/74eebf51/attachment-0001.html>


More information about the asterisk-code-review mailing list