[Asterisk-code-review] Clang: Fix some more tautological-compare warnings. (asterisk[13])
Mark Michelson
asteriskteam at digium.com
Mon Apr 20 16:03:42 CDT 2015
Mark Michelson has posted comments on this change.
Change subject: Clang: Fix some more tautological-compare warnings.
......................................................................
Patch Set 4: Code-Review-1
(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.
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 can contain a negative value, and so ensuring that we don't attempt to pass a negative value to functions like ast_security_event_get_name() is important.
--
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