[asterisk-commits] cel.c: Fix mismatch in ast cel track event() return type. (asterisk[11])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 18 12:16:06 CST 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: cel.c: Fix mismatch in ast_cel_track_event() return type.
......................................................................


cel.c: Fix mismatch in ast_cel_track_event() return type.

The return type of ast_cel_track_event() is not large enough to return all
64 potential bits of the event enable mask.  Fortunately, the defined CEL
events do not really need all 64 bits and the return value is only used to
determine if the requested CEL event is enabled.

* Made the ast_cel_track_event() return 0 or 1 only so the return value
can fit inside an int type instead of zero or a truncated 64 bit non-zero
value.

Change-Id: I783d932320db11a95c7bf7636a72b6fe2566904c
---
M main/cel.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved
  George Joseph: Looks good to me, but someone else must approve



diff --git a/main/cel.c b/main/cel.c
index 59a5b7f..8531b59 100644
--- a/main/cel.c
+++ b/main/cel.c
@@ -267,7 +267,7 @@
 
 static int ast_cel_track_event(enum ast_cel_event_type et)
 {
-	return (eventset & ((int64_t) 1 << et));
+	return (eventset & ((int64_t) 1 << et)) ? 1 : 0;
 }
 
 static void parse_events(const char *val)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I783d932320db11a95c7bf7636a72b6fe2566904c
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-commits mailing list