[haiku-commits] r38213 - in haiku/trunk: build/jam headers/os/bluetooth headers/private/bluetooth src/add-ons/kernel/bluetooth/btCoreData src/add-ons/kernel/bluetooth/hci ...

  • From: zooey@xxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 17 Aug 2010 23:46:33 +0200 (CEST)

Author: zooey
Date: 2010-08-17 23:46:32 +0200 (Tue, 17 Aug 2010)
New Revision: 38213
Changeset: http://dev.haiku-os.org/changeset/38213
Ticket: http://dev.haiku-os.org/ticket/6373

Modified:
   haiku/trunk/build/jam/BuildSetup
   haiku/trunk/headers/os/bluetooth/bluetooth.h
   haiku/trunk/headers/private/bluetooth/btCoreData.h
   haiku/trunk/src/add-ons/kernel/bluetooth/btCoreData/ConnectionInterface.cpp
   haiku/trunk/src/add-ons/kernel/bluetooth/btCoreData/ConnectionInterface.h
   haiku/trunk/src/add-ons/kernel/bluetooth/hci/bluetooth.cpp
   haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap_address.cpp
   haiku/trunk/src/kits/bluetooth/KitSupport.cpp
Log:
* fix #6373 by switching the BD... macros to take the address of corresponding 
  constants, which had to be defined in several places in order to be available
  in the kernel addons, network protocols and the server/kit.
* enable -Werror for all servers

Modified: haiku/trunk/build/jam/BuildSetup
===================================================================
--- haiku/trunk/build/jam/BuildSetup    2010-08-17 21:35:16 UTC (rev 38212)
+++ haiku/trunk/build/jam/BuildSetup    2010-08-17 21:46:32 UTC (rev 38213)
@@ -1198,6 +1198,7 @@
        EnableWerror src add-ons input_server devices ;
 #      EnableWerror src add-ons input_server filters ;
 #      EnableWerror src add-ons input_server methods ;
+       EnableWerror src add-ons kernel bluetooth ;
 #      EnableWerror src add-ons kernel bus_managers acpi ;
        EnableWerror src add-ons kernel bus_managers agp_gart ;
        EnableWerror src add-ons kernel bus_managers ata ;
@@ -1391,23 +1392,7 @@
 #      EnableWerror src kits tracker ;
        EnableWerror src kits translation ;
        EnableWerror src preferences ;
-       EnableWerror src servers app ;
-#      EnableWerror src servers bluetooth ;
-       EnableWerror src servers cddb_daemon ;
-       EnableWerror src servers debug ;
-       EnableWerror src servers input ;
-       EnableWerror src servers mail ;
-       EnableWerror src servers media ;
-       EnableWerror src servers media_addon ;
-       EnableWerror src servers midi ;
-       EnableWerror src servers mount ;
-       EnableWerror src servers net ;
-       EnableWerror src servers notification ;
-       EnableWerror src servers power ;
-       EnableWerror src servers print ;
-       EnableWerror src servers registrar ;
-       EnableWerror src servers services_daemon ;
-       EnableWerror src servers syslog_daemon ;
+       EnableWerror src servers ;
        EnableWerror src system kernel ;
        EnableWerror src system runtime_loader ;
 }

Modified: haiku/trunk/headers/os/bluetooth/bluetooth.h
===================================================================
--- haiku/trunk/headers/os/bluetooth/bluetooth.h        2010-08-17 21:35:16 UTC 
(rev 38212)
+++ haiku/trunk/headers/os/bluetooth/bluetooth.h        2010-08-17 21:46:32 UTC 
(rev 38213)
@@ -24,10 +24,17 @@
        uint8 b[6];
 } __attribute__((packed)) bdaddr_t;
 
+namespace BPrivate {
 
-#define BDADDR_NULL                    (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}})
-#define BDADDR_LOCAL           (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}})
-#define BDADDR_BROADCAST       (&(bdaddr_t) {{0xff, 0xff, 0xff, 0xff, 0xff, 
0xff}})
+extern const bdaddr_t kBdNullAddress;
+extern const bdaddr_t kBdLocalAddress;
+extern const bdaddr_t kBdBroadcastAddress;
+
+}
+
+#define BDADDR_NULL                    (&BPrivate::kBdNullAddress)
+#define BDADDR_LOCAL           (&BPrivate::kBdLocalAddress)
+#define BDADDR_BROADCAST       (&BPrivate::kBdBroadcastAddress)
 #define BDADDR_ANY                     BDADDR_BROADCAST
 
 

Modified: haiku/trunk/headers/private/bluetooth/btCoreData.h
===================================================================
--- haiku/trunk/headers/private/bluetooth/btCoreData.h  2010-08-17 21:35:16 UTC 
(rev 38212)
+++ haiku/trunk/headers/private/bluetooth/btCoreData.h  2010-08-17 21:46:32 UTC 
(rev 38213)
@@ -138,7 +138,7 @@
        status_t                                (*PostEvent)(bluetooth_device* 
ndev, void* event,
                                                                size_t size);
        struct HciConnection*   (*AddConnection)(uint16 handle, int type,
-                                                               bdaddr_t* dst, 
hci_id hid);
+                                                               const bdaddr_t* 
dst, hci_id hid);
 
        // status_t                             (*RemoveConnection)(bdaddr_t 
destination, hci_id hid);
        status_t                                (*RemoveConnection)(uint16 
handle, hci_id hid);

Modified: 
haiku/trunk/src/add-ons/kernel/bluetooth/btCoreData/ConnectionInterface.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/bluetooth/btCoreData/ConnectionInterface.cpp 
2010-08-17 21:35:16 UTC (rev 38212)
+++ haiku/trunk/src/add-ons/kernel/bluetooth/btCoreData/ConnectionInterface.cpp 
2010-08-17 21:46:32 UTC (rev 38213)
@@ -37,7 +37,7 @@
 
 
 HciConnection*
-AddConnection(uint16 handle, int type, bdaddr_t* dst, hci_id hid)
+AddConnection(uint16 handle, int type, const bdaddr_t* dst, hci_id hid)
 {
        // Create connection descriptor
 

Modified: 
haiku/trunk/src/add-ons/kernel/bluetooth/btCoreData/ConnectionInterface.h
===================================================================
--- haiku/trunk/src/add-ons/kernel/bluetooth/btCoreData/ConnectionInterface.h   
2010-08-17 21:35:16 UTC (rev 38212)
+++ haiku/trunk/src/add-ons/kernel/bluetooth/btCoreData/ConnectionInterface.h   
2010-08-17 21:46:32 UTC (rev 38213)
@@ -19,7 +19,7 @@
        hci_id hid);
 
 
-HciConnection* AddConnection(uint16 handle, int type, bdaddr_t* dst,
+HciConnection* AddConnection(uint16 handle, int type, const bdaddr_t* dst,
        hci_id hid);
 status_t RemoveConnection(bdaddr_t* destination, hci_id hid);
 status_t RemoveConnection(uint16 handle, hci_id hid);

Modified: haiku/trunk/src/add-ons/kernel/bluetooth/hci/bluetooth.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/bluetooth/hci/bluetooth.cpp  2010-08-17 
21:35:16 UTC (rev 38212)
+++ haiku/trunk/src/add-ons/kernel/bluetooth/hci/bluetooth.cpp  2010-08-17 
21:46:32 UTC (rev 38213)
@@ -44,6 +44,15 @@
 #include "acl.h"
 
 
+namespace BPrivate {
+
+const bdaddr_t kBdNullAddress          = {{0, 0, 0, 0, 0, 0}};
+const bdaddr_t kBdLocalAddress                 = {{0, 0, 0, 0xff, 0xff, 0xff}};
+const bdaddr_t kBdBroadcastAddress     = {{0xff, 0xff, 0xff, 0xff, 0xff, 
0xff}};
+
+}
+
+
 typedef PortListener<void,
        HCI_MAX_FRAME_SIZE, // Event Body can hold max 255 + 2 header
        24                                      // Some devices have sent 
chunks of 24 events(inquiry result)

Modified: 
haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap_address.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap_address.cpp    
2010-08-17 21:35:16 UTC (rev 38212)
+++ haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap_address.cpp    
2010-08-17 21:46:32 UTC (rev 38213)
@@ -22,6 +22,15 @@
 #include <bluetooth/L2CAP/btL2CAP.h>
 
 
+namespace BPrivate {
+
+const bdaddr_t kBdNullAddress          = {{0, 0, 0, 0, 0, 0}};
+const bdaddr_t kBdLocalAddress                 = {{0, 0, 0, 0xff, 0xff, 0xff}};
+const bdaddr_t kBdBroadcastAddress     = {{0xff, 0xff, 0xff, 0xff, 0xff, 
0xff}};
+
+}
+
+
 #define L2CAP_CHECKSUM(address) \
        (address.b[0] + address.b[1] + address.b[2] + address.b[3] \
                + address.b[4] + address.b[5])

Modified: haiku/trunk/src/kits/bluetooth/KitSupport.cpp
===================================================================
--- haiku/trunk/src/kits/bluetooth/KitSupport.cpp       2010-08-17 21:35:16 UTC 
(rev 38212)
+++ haiku/trunk/src/kits/bluetooth/KitSupport.cpp       2010-08-17 21:46:32 UTC 
(rev 38213)
@@ -11,6 +11,16 @@
 
 #include "KitSupport.h"
 
+
+namespace BPrivate {
+
+const bdaddr_t kBdNullAddress          = {{0, 0, 0, 0, 0, 0}};
+const bdaddr_t kBdLocalAddress                 = {{0, 0, 0, 0xff, 0xff, 0xff}};
+const bdaddr_t kBdBroadcastAddress     = {{0xff, 0xff, 0xff, 0xff, 0xff, 
0xff}};
+
+}
+
+
 BMessenger* _RetrieveBluetoothMessenger(void)
 {
        // Fix/review: leaking memory here


Other related posts:

  • » [haiku-commits] r38213 - in haiku/trunk: build/jam headers/os/bluetooth headers/private/bluetooth src/add-ons/kernel/bluetooth/btCoreData src/add-ons/kernel/bluetooth/hci ... - zooey