OSDN Git Service

Make STREAM_TO_UINT64 globally available
authorJakub Pawlowski <jpawlowski@google.com>
Thu, 15 Feb 2018 18:18:29 +0000 (10:18 -0800)
committerAndre Eisenbach <eisenbach@google.com>
Thu, 15 Feb 2018 20:25:09 +0000 (20:25 +0000)
Bug: 69623109
Change-Id: I38958dc16d42ab2396d3acd7605b63ec6a6c2dd8

stack/include/bt_types.h
stack/srvc/srvc_dis.cc

index 8ff767d..0f93f8c 100644 (file)
@@ -352,6 +352,17 @@ typedef struct {
              ((((uint32_t)(*((p) + 3)))) << 24));                     \
     (p) += 4;                                                         \
   }
+#define STREAM_TO_UINT64(u64, p)                                      \
+  {                                                                   \
+    (u64) = (((uint64_t)(*(p))) + ((((uint64_t)(*((p) + 1)))) << 8) + \
+             ((((uint64_t)(*((p) + 2)))) << 16) +                     \
+             ((((uint64_t)(*((p) + 3)))) << 24) +                     \
+             ((((uint64_t)(*((p) + 4)))) << 32) +                     \
+             ((((uint64_t)(*((p) + 5)))) << 40) +                     \
+             ((((uint64_t)(*((p) + 6)))) << 48) +                     \
+             ((((uint64_t)(*((p) + 7)))) << 56));                     \
+    (p) += 8;                                                         \
+  }
 #define STREAM_TO_ARRAY32(a, p)                     \
   {                                                 \
     int ijk;                                        \
index 7414f02..3ca2e33 100644 (file)
@@ -49,18 +49,6 @@ using base::StringPrintf;
     *(p)++ = (uint8_t)((u64) >> 56); \
   }
 
-#define STREAM_TO_UINT64(u64, p)                                      \
-  {                                                                   \
-    (u64) = (((uint64_t)(*(p))) + ((((uint64_t)(*((p) + 1)))) << 8) + \
-             ((((uint64_t)(*((p) + 2)))) << 16) +                     \
-             ((((uint64_t)(*((p) + 3)))) << 24) +                     \
-             ((((uint64_t)(*((p) + 4)))) << 32) +                     \
-             ((((uint64_t)(*((p) + 5)))) << 40) +                     \
-             ((((uint64_t)(*((p) + 6)))) << 48) +                     \
-             ((((uint64_t)(*((p) + 7)))) << 56));                     \
-    (p) += 8;                                                         \
-  }
-
 static const uint16_t dis_attr_uuid[DIS_MAX_CHAR_NUM] = {
     GATT_UUID_SYSTEM_ID,
     GATT_UUID_MODEL_NUMBER_STR,