From 85ce6904751e2f8e29190ab8e19e9a79ea0c854a Mon Sep 17 00:00:00 2001 From: Oliver Ruiz Dorantes Date: Fri, 15 Aug 2008 19:08:48 +0000 Subject: [PATCH] Remove warning, use the common util function for the bdaddr utils class git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26983 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/bluetooth/bdaddrUtils.h | 13 +++++++------ headers/os/bluetooth/bluetooth_util.h | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/headers/os/bluetooth/bdaddrUtils.h b/headers/os/bluetooth/bdaddrUtils.h index ea5a63297e..9fcb3f6bb6 100644 --- a/headers/os/bluetooth/bdaddrUtils.h +++ b/headers/os/bluetooth/bdaddrUtils.h @@ -9,25 +9,26 @@ #include #include +#include namespace Bluetooth { class bdaddrUtils { public: - static inline bdaddr_t NullAddress() + static inline bdaddr_t NullAddress() { return ((bdaddr_t) {{0, 0, 0, 0, 0, 0}}); } - static inline bdaddr_t LocalAddress() + static inline bdaddr_t LocalAddress() { return ((bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}}); } - static inline bdaddr_t BroadcastAddress() + static inline bdaddr_t BroadcastAddress() { return ((bdaddr_t) {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}}); } @@ -35,11 +36,11 @@ public: static bool Compare(bdaddr_t *ba1, bdaddr_t *ba2) { - return (memcmp(ba1, ba2, sizeof(bdaddr_t)) == 0); + return (bacmp(ba1, ba2) == 0); } - static char* ToString(const bdaddr_t bdaddr) + static char* ToString(const bdaddr_t bdaddr) { // TODO: not safe static char str[18]; @@ -64,7 +65,7 @@ public: } return NullAddress(); - } + } }; diff --git a/headers/os/bluetooth/bluetooth_util.h b/headers/os/bluetooth/bluetooth_util.h index 4eba4d688d..874418057b 100644 --- a/headers/os/bluetooth/bluetooth_util.h +++ b/headers/os/bluetooth/bluetooth_util.h @@ -6,6 +6,7 @@ #define _BLUETOOTH_UTIL_H #include +#include /* BD Address management */ static inline int bacmp(bdaddr_t* ba1, bdaddr_t* ba2)