[Asterisk-code-review] cel.c: Fix mismatch in ast cel track event() return type. (asterisk[master])

Richard Mudgett asteriskteam at digium.com
Wed Feb 17 14:07:00 CST 2016


Richard Mudgett has uploaded a new change for review.

  https://gerrit.asterisk.org/2267

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(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/67/2267/1

diff --git a/main/cel.c b/main/cel.c
index f2d5168..a0d0ad7 100644
--- a/main/cel.c
+++ b/main/cel.c
@@ -541,7 +541,7 @@
 		return 0;
 	}
 
-	return (cfg->general->events & ((int64_t) 1 << et));
+	return (cfg->general->events & ((int64_t) 1 << et)) ? 1 : 0;
 }
 
 static int events_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I783d932320db11a95c7bf7636a72b6fe2566904c
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list