From 16c8547911e8938d9aa5a8b5617121799785fb81 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Wed, 25 Mar 2015 10:38:00 +0100 Subject: [PATCH] Bug 1146923: Rename |BluetoothDeviceType| to |BluetoothTypeOfDevice|, r=btian --- dom/bluetooth/BluetoothCommon.h | 12 +++++----- .../bluedroid/BluetoothDaemonHelpers.cpp | 22 +++++++++---------- .../bluedroid/BluetoothDaemonHelpers.h | 6 ++--- .../bluedroid/BluetoothHALHelpers.cpp | 2 +- dom/bluetooth/bluedroid/BluetoothHALHelpers.h | 16 +++++++------- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/dom/bluetooth/BluetoothCommon.h b/dom/bluetooth/BluetoothCommon.h index 3c95d88a88c7..f4570364bc7e 100644 --- a/dom/bluetooth/BluetoothCommon.h +++ b/dom/bluetooth/BluetoothCommon.h @@ -165,10 +165,10 @@ enum BluetoothBondState { BOND_STATE_BONDED }; -enum BluetoothDeviceType { - DEVICE_TYPE_BREDR, - DEVICE_TYPE_BLE, - DEVICE_TYPE_DUAL +enum BluetoothTypeOfDevice { + TYPE_OF_DEVICE_BREDR, + TYPE_OF_DEVICE_BLE, + TYPE_OF_DEVICE_DUAL }; enum BluetoothPropertyType { @@ -235,8 +235,8 @@ struct BluetoothProperty { /* PROPERTY_RSSI_VALUE */ int32_t mInt32; - /* PROPERTY_DEVICE_TYPE */ - BluetoothDeviceType mDeviceType; + /* PROPERTY_TYPE_OF_DEVICE */ + BluetoothTypeOfDevice mTypeOfDevice; /* PROPERTY_SERVICE_RECORD */ BluetoothServiceRecord mServiceRecord; diff --git a/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp b/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp index 50fce64cd6d3..dfbe2ccd2283 100644 --- a/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp +++ b/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp @@ -82,19 +82,19 @@ Convert(int aIn, int32_t& aOut) } nsresult -Convert(int32_t aIn, BluetoothDeviceType& aOut) +Convert(int32_t aIn, BluetoothTypeOfDevice& aOut) { - static const BluetoothDeviceType sDeviceType[] = { - CONVERT(0x00, static_cast(0)), // invalid, required by gcc - CONVERT(0x01, DEVICE_TYPE_BREDR), - CONVERT(0x02, DEVICE_TYPE_BLE), - CONVERT(0x03, DEVICE_TYPE_DUAL) + static const BluetoothTypeOfDevice sTypeOfDevice[] = { + CONVERT(0x00, static_cast(0)), // invalid, required by gcc + CONVERT(0x01, TYPE_OF_DEVICE_BREDR), + CONVERT(0x02, TYPE_OF_DEVICE_BLE), + CONVERT(0x03, TYPE_OF_DEVICE_DUAL) }; if (NS_WARN_IF(!aIn) || - NS_WARN_IF(static_cast(aIn) >= MOZ_ARRAY_LENGTH(sDeviceType))) { + NS_WARN_IF(static_cast(aIn) >= MOZ_ARRAY_LENGTH(sTypeOfDevice))) { return NS_ERROR_ILLEGAL_VALUE; } - aOut = sDeviceType[aIn]; + aOut = sTypeOfDevice[aIn]; return NS_OK; } @@ -1460,10 +1460,10 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothBondState& aOut) } nsresult -UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothDeviceType& aOut) +UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothTypeOfDevice& aOut) { return UnpackPDU( - aPDU, UnpackConversion(aOut)); + aPDU, UnpackConversion(aOut)); } nsresult @@ -1553,7 +1553,7 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothProperty& aOut) rv = UnpackPDU(aPDU, aOut.mUint32); break; case PROPERTY_TYPE_OF_DEVICE: - rv = UnpackPDU(aPDU, aOut.mDeviceType); + rv = UnpackPDU(aPDU, aOut.mTypeOfDevice); break; case PROPERTY_SERVICE_RECORD: rv = UnpackPDU(aPDU, aOut.mServiceRecord); diff --git a/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h b/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h index 8c604334f1c2..0a9c0d4ff2c6 100644 --- a/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h +++ b/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h @@ -170,7 +170,7 @@ nsresult Convert(int aIn, int32_t& aOut); nsresult -Convert(int32_t aIn, BluetoothDeviceType& aOut); +Convert(int32_t aIn, BluetoothTypeOfDevice& aOut); nsresult Convert(int32_t aIn, BluetoothScanMode& aOut); @@ -233,7 +233,7 @@ nsresult Convert(uint8_t aIn, BluetoothBondState& aOut); nsresult -Convert(uint8_t aIn, BluetoothDeviceType& aOut); +Convert(uint8_t aIn, BluetoothTypeOfDevice& aOut); nsresult Convert(uint8_t aIn, BluetoothPropertyType& aOut); @@ -800,7 +800,7 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothDaemonPDUHeader& aOut) } nsresult -UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothDeviceType& aOut); +UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothTypeOfDevice& aOut); nsresult UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeAudioState& aOut); diff --git a/dom/bluetooth/bluedroid/BluetoothHALHelpers.cpp b/dom/bluetooth/bluedroid/BluetoothHALHelpers.cpp index f53897742354..81f1c232ffd6 100644 --- a/dom/bluetooth/bluedroid/BluetoothHALHelpers.cpp +++ b/dom/bluetooth/bluedroid/BluetoothHALHelpers.cpp @@ -290,7 +290,7 @@ Convert(const bt_property_t& aIn, BluetoothProperty& aOut) break; case PROPERTY_TYPE_OF_DEVICE: rv = Convert(*static_cast(aIn.val), - aOut.mDeviceType); + aOut.mTypeOfDevice); break; case PROPERTY_SERVICE_RECORD: rv = Convert(*static_cast(aIn.val), diff --git a/dom/bluetooth/bluedroid/BluetoothHALHelpers.h b/dom/bluetooth/bluedroid/BluetoothHALHelpers.h index 22ed1d41bb9e..ac19b7b83076 100644 --- a/dom/bluetooth/bluedroid/BluetoothHALHelpers.h +++ b/dom/bluetooth/bluedroid/BluetoothHALHelpers.h @@ -284,18 +284,18 @@ Convert(bt_acl_state_t aIn, bool& aOut) } inline nsresult -Convert(bt_device_type_t aIn, BluetoothDeviceType& aOut) +Convert(bt_device_type_t aIn, BluetoothTypeOfDevice& aOut) { - static const BluetoothDeviceType sDeviceType[] = { - CONVERT(0, static_cast(0)), // invalid, required by gcc - CONVERT(BT_DEVICE_DEVTYPE_BREDR, DEVICE_TYPE_BREDR), - CONVERT(BT_DEVICE_DEVTYPE_BLE, DEVICE_TYPE_BLE), - CONVERT(BT_DEVICE_DEVTYPE_DUAL, DEVICE_TYPE_DUAL) + static const BluetoothTypeOfDevice sTypeOfDevice[] = { + CONVERT(0, static_cast(0)), // invalid, required by gcc + CONVERT(BT_DEVICE_DEVTYPE_BREDR, TYPE_OF_DEVICE_BREDR), + CONVERT(BT_DEVICE_DEVTYPE_BLE, TYPE_OF_DEVICE_BLE), + CONVERT(BT_DEVICE_DEVTYPE_DUAL, TYPE_OF_DEVICE_DUAL) }; - if (aIn >= MOZ_ARRAY_LENGTH(sDeviceType)) { + if (aIn >= MOZ_ARRAY_LENGTH(sTypeOfDevice)) { return NS_ERROR_ILLEGAL_VALUE; } - aOut = sDeviceType[aIn]; + aOut = sTypeOfDevice[aIn]; return NS_OK; }