[Asterisk-code-review] sorcery: Add ability to insert a wizard in an object type's ... (asterisk[13])
Joshua Colp
asteriskteam at digium.com
Fri May 8 10:03:08 CDT 2015
Joshua Colp has posted comments on this change.
Change subject: sorcery: Add ability to insert a wizard in an object type's list
......................................................................
Patch Set 1: Code-Review-1
(6 comments)
Feel free to disregard my pedanticism.
https://gerrit.asterisk.org/#/c/394/1/include/asterisk/sorcery.h
File include/asterisk/sorcery.h:
Line 509: ast_sorcery_wizard_position_last = -1,
: ast_sorcery_wizard_position_first = 0,
enums like this are traditionally uppercased
Line 567: struct ast_sorcery_object_wizards *ast_sorcery_get_wizard_mappings(struct ast_sorcery *sorcery,
: const char *type);
I don't like exposing implementation details like this. I'd opt instead for a get and get size, which allows you to traverse.
https://gerrit.asterisk.org/#/c/394/1/main/sorcery.c
File main/sorcery.c:
Line 821: if (AST_VECTOR_RW_INIT(&object_type->wizards, 5) != 0) {
Magic value, make this a define.
Line 1753: for (i = 0; i < AST_VECTOR_SIZE(&object_type->wizards); i++) {
Pedantic: struct ast_sorcery_object_wizard *wizard can be declared in here now.
Line 1794: wizard = AST_VECTOR_GET(&object_type->wizards, i);
Same here.
Line 1837: wizard = AST_VECTOR_GET(&object_type->wizards, i);
Same here.
--
To view, visit https://gerrit.asterisk.org/394
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I9d2469a9296b2698082c0989e25e6848dc403b57
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-HasComments: Yes
More information about the asterisk-code-review
mailing list