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/12 21:58:33 UTC

[mynewt-core] branch master updated: 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-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 0fc4943  service/ans: don't depent on libm for creating bitmask (#903)
0fc4943 is described below

commit 0fc4943638290b121b92bc87266860802ee91258
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)
---
 net/nimble/host/services/ans/src/ble_svc_ans.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/net/nimble/host/services/ans/src/ble_svc_ans.c b/net/nimble/host/services/ans/src/ble_svc_ans.c
index 507d795..ec58bd5 100644
--- a/net/nimble/host/services/ans/src/ble_svc_ans.c
+++ b/net/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.