[Asterisk-code-review] force inline: remove all force inline from asterisk. (asterisk[master])

Kevin Harwell asteriskteam at digium.com
Wed Feb 20 16:31:33 CST 2019


Kevin Harwell has posted comments on this change. ( https://gerrit.asterisk.org/10936 )

Change subject: force_inline: remove all force_inline from asterisk.
......................................................................


Patch Set 4: Code-Review-1

(4 comments)

https://gerrit.asterisk.org/#/c/10936/4//COMMIT_MSG
Commit Message:

https://gerrit.asterisk.org/#/c/10936/4//COMMIT_MSG@13
PS4, Line 13: 3. Fedora and Ubuntu
Remove this as it's not really a dependency of the problem. It's more that there is a bug in GCC 8.2.1


https://gerrit.asterisk.org/#/c/10936/4/include/asterisk/sem.h
File include/asterisk/sem.h:

https://gerrit.asterisk.org/#/c/10936/4/include/asterisk/sem.h@a42
PS4, Line 42: 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
            : 
I agree with Corey to a certain extent that some of these are very simple and _should_ be inlined. For instance these here. I'd probably leave these alone, and change to "inline" instead of "force_inline"


https://gerrit.asterisk.org/#/c/10936/4/include/asterisk/utils.h
File include/asterisk/utils.h:

https://gerrit.asterisk.org/#/c/10936/4/include/asterisk/utils.h@a588
PS4, Line 588: 
             : 
             : 
             : 
             : 
             : 
I wonder if this could be turned into a macro instead defined by ast_assert?


https://gerrit.asterisk.org/#/c/10936/4/main/audiohook.c
File main/audiohook.c:

https://gerrit.asterisk.org/#/c/10936/4/main/audiohook.c@1431
PS4, Line 1431: void ast_slinear_saturated_add(short *input, short *value)
              : {
              : 	int res;
              : 
              : 	res = (int) *input + *value;
              : 	if (res > 32767)
              : 		*input = 32767;
              : 	else if (res < -32768)
              : 		*input = -32768;
              : 	else
              : 		*input = (short) res;
              : }
              : 
              : void ast_slinear_saturated_subtract(short *input, short *value)
              : {
              : 	int res;
              : 
              : 	res = (int) *input - *value;
              : 	if (res > 32767)
              : 		*input = 32767;
              : 	else if (res < -32768)
              : 		*input = -32768;
              : 	else
              : 		*input = (short) res;
              : }
              : 
              : void ast_slinear_saturated_multiply(short *input, short *value)
              : {
              : 	int res;
              : 
              : 	res = (int) *input * *value;
              : 	if (res > 32767)
              : 		*input = 32767;
              : 	else if (res < -32768)
              : 		*input = -32768;
              : 	else
              : 		*input = (short) res;
              : }
I agree with Walter. While here, we should bring this code up to par with the coding guidelines. Please add the necessary braces for each if/else statement.



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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2a90249763a7139fd12c54ad4e0e8d5cbbed14f9
Gerrit-Change-Number: 10936
Gerrit-PatchSet: 4
Gerrit-Owner: Chris Savinovich <csavinovich at digium.com>
Gerrit-Reviewer: Chris Savinovich <csavinovich at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Friendly Automation (1000185)
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua C. Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Matthew Fredrickson <creslin at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Walter Doekes <walter+asterisk at wjd.nu>
Gerrit-Comment-Date: Wed, 20 Feb 2019 22:31:33 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190220/deea9be2/attachment.html>


More information about the asterisk-code-review mailing list