[Asterisk-code-review] sorcery: Add ability to insert a wizard in an object type's ... (asterisk[13])

George Joseph asteriskteam at digium.com
Fri May 8 11:23:40 CDT 2015


George Joseph has posted comments on this change.

Change subject: sorcery: Add ability to insert a wizard in an object type's list
......................................................................


Patch Set 1:

(8 comments)

https://gerrit.asterisk.org/#/c/394/1/include/asterisk/sorcery.h
File include/asterisk/sorcery.h:

Line 447: /*! \brief Interface for a sorcery object type wizards */
        : AST_VECTOR_RW(ast_sorcery_object_wizards, struct ast_sorcery_object_wizard *);
> Why is this vector exposed in the header? I would think that we'd want the 
Done


Line 509: 	ast_sorcery_wizard_position_last = -1,
        : 	ast_sorcery_wizard_position_first = 0,
> enums like this are traditionally uppercased
Done


Line 513: /*!
        :  * \brief Insert an additional object wizard mapping at a specific position
        :  * in the wizard list
        :  *
        :  * \param sorcery Pointer to a sorcery structure
        :  * \param type Type of object to apply to
        :  * \param module The name of the module, typically AST_MODULE
        :  * \param name Name of the wizard to use
        :  * \param data Data to be passed to wizard
        :  * \param caching Wizard should cache
        :  * \param position An index to inser to or one of ast_sorcery_wizard_position
        :  *
        :  * \return What occurred when applying the mapping
        :  *
        :  * \note This should be called *after* applying default mappings
        :  */
> Since this is going into 13, having a \since tag on these new functions wou
Done


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
Done


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.
Done


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 
Done


Line 1794: 		wizard = AST_VECTOR_GET(&object_type->wizards, i);
> Same here.
Done


Line 1837: 		wizard = AST_VECTOR_GET(&object_type->wizards, i);
> Same here.
Done


-- 
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: 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