[Asterisk-code-review] json: Add a object create with vars method and integer access macro (asterisk[16])

George Joseph asteriskteam at digium.com
Fri Oct 22 07:15:19 CDT 2021


Attention is currently required from: Kevin Harwell.
George Joseph has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/16642 )

Change subject: json: Add a object create with vars method and integer access macro
......................................................................


Patch Set 1: Code-Review-1

(3 comments)

File include/asterisk/json.h:

https://gerrit.asterisk.org/c/asterisk/+/16642/comment/bb18ea13_66d16a5a 
PS1, Line 544: \param excludes Variable names to exclude (optional)
Comma separated?  Space separated?, etc?


File main/json.c:

https://gerrit.asterisk.org/c/asterisk/+/16642/comment/0bc90181_ed7a6d58 
PS1, Line 867: strstr(excludes, i->name)
If you exclude ABC, than all variables that have ABC somewhere in the name will be excluded.   I.E. ABC, MYABC, ABCMY, YOURABCMY will all be excluded.

You could use ast_strsep with the AST_STRSEP_TRIM flag and just iterate over the excludes string.  Actually, I'm surprised we don't have a macro that does just that give how often we do this.


File tests/test_json.c:

https://gerrit.asterisk.org/c/asterisk/+/16642/comment/9923702b_3f82e93c 
PS1, Line 1112: 	/* NULL case */
You should probably also test that "ABC" doesn't match "MYABC2" in the excludes string.



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

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I5f34f18e102126aef3997f19a553a266d70d6226
Gerrit-Change-Number: 16642
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Attention: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Fri, 22 Oct 2021 12:15:19 +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/20211022/83553f49/attachment-0001.html>


More information about the asterisk-code-review mailing list