You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2018/03/15 21:27:01 UTC
[mynewt-nimble] 06/14: service/ans: don't depent on libm for
creating bitmask (#903)
This is an automated email from the ASF dual-hosted git repository.
andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit 10cc2118264db6864eaba872bfccecd421e755fc
Author: Stéphane D'Alu <sd...@sdalu.com>
AuthorDate: Mon Mar 12 22:58:31 2018 +0100
service/ans: don't depent on libm for creating bitmask (#903)
X-Original-Commit: 0fc4943638290b121b92bc87266860802ee91258
---
nimble/host/services/ans/src/ble_svc_ans.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/nimble/host/services/ans/src/ble_svc_ans.c b/nimble/host/services/ans/src/ble_svc_ans.c
index 507d795..ec58bd5 100644
--- a/nimble/host/services/ans/src/ble_svc_ans.c
+++ b/nimble/host/services/ans/src/ble_svc_ans.c
@@ -19,12 +19,6 @@
#include <assert.h>
#include <string.h>
-#include <math.h>
-
-/* Some ambiq SDK headers use `OVERFLOW` as an identifier. This is a macro
- * that is leaked by some versions of math.h.
- */
-#undef OVERFLOW
#include "sysinit/sysinit.h"
#include "syscfg/syscfg.h"
@@ -32,7 +26,6 @@
#include "host/ble_gap.h"
#include "services/ans/ble_svc_ans.h"
-
/* Max length of new alert info string */
#define BLE_SVC_ANS_INFO_STR_MAX_LEN 18
/* Max length of a new alert notification, max string length + 2 bytes
@@ -349,7 +342,7 @@ ble_svc_ans_unr_alert_add(uint8_t cat_id)
uint8_t cat_bit_mask;
if (cat_id < BLE_SVC_ANS_CAT_NUM) {
- cat_bit_mask = pow(2, cat_id);
+ cat_bit_mask = 1 << cat_id;
} else {
return BLE_HS_EINVAL;
}
--
To stop receiving notification emails like this one, please contact
andk@apache.org.