[Asterisk-code-review] Clang: Fix some more tautological-compare warnings. (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Mon Apr 20 16:24:03 CDT 2015


Richard Mudgett has posted comments on this change.

Change subject: Clang: Fix some more tautological-compare warnings.
......................................................................


Patch Set 4:

(2 comments)

https://gerrit.asterisk.org/#/c/160/4/channels/chan_skinny.c
File channels/chan_skinny.c:

Line 7548: 			eventmessage = letohl(req->e);
         : 			if (eventmessage < 0) {
> I don't understand how this is any different from what was here before.
The letohl() is defined several different ways in chan_skinny.c.  Some return a signed value some return unsigned.  This change guarantees the type to be signed.


https://gerrit.asterisk.org/#/c/160/4/main/security_events.c
File main/security_events.c:

Line 424: 	RAII_VAR(struct ast_str *, str, NULL, ast_free);
        : 	struct ast_json *event_type_json;
        : 	enum ast_security_event_type event_type;
        : 
        : 	event_type_json = ast_json_object_get(json, "SecurityEvent");
        : 	event_type = ast_json_integer_get(event_type_json);
        : 
        : 	ast_assert(event_type < AST_SECURITY_EVENT_NUM_TYPES);
> I disagree with this change and the one in res_security_log.c. An enum type
Clang apparently considers any enum that is defined with *no* negative values to be an unsigned int and not an int.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ief23ef68916192b9b72dabe702b543ecfeca0b62
Gerrit-PatchSet: 4
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Diederik de Groot <dkgroot at talon.nl>
Gerrit-Reviewer: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list