You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/03/12 21:58:33 UTC

[GitHub] andrzej-kaczmarek closed pull request #903: service/ans: don't depent on libm for creating bitmask

andrzej-kaczmarek closed pull request #903: service/ans: don't depent on libm for creating bitmask
URL: https://github.com/apache/mynewt-core/pull/903
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 507d79574..ec58bd58c 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;
     }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services