[Asterisk-code-review] vector: multiple evaluation of elem in AST VECTOR ADD SORTED. (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Fri Oct 6 10:46:56 CDT 2017


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/6664 )

Change subject: vector: multiple evaluation of elem in AST_VECTOR_ADD_SORTED.
......................................................................


Patch Set 2: Code-Review-1

(2 comments)

Ah the classic shortcoming of macros.

Minor nit about terminology.

https://gerrit.asterisk.org/#/c/6664/2/include/asterisk/vector.h
File include/asterisk/vector.h:

https://gerrit.asterisk.org/#/c/6664/2/include/asterisk/vector.h@307
PS2, Line 307:  * \param elem Element to insert. MUST BE SCALAR or cast to a scalar.
A struct works but is not a scalar.  The Element type must be assignable which arrays are not.

Remember vector members don't have to be integers or pointers.  They can be structs.  Some vectors have actually used structs in v15.


https://gerrit.asterisk.org/#/c/6664/2/include/asterisk/vector.h@314
PS2, Line 314:  * \warning 'elem' must be scalar so passing 'x' where 'x' is defined as 'char x[4]'
same



-- 
To view, visit https://gerrit.asterisk.org/6664
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib960d7f5576f9e1a3c478ecb48995582a574e06d
Gerrit-Change-Number: 6664
Gerrit-PatchSet: 2
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Fri, 06 Oct 2017 15:46:56 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171006/654e692e/attachment.html>


More information about the asterisk-code-review mailing list