Bug 1146923: Rename |BluetoothDeviceType| to |BluetoothTypeOfDevice|, r=btian

This commit is contained in:
Thomas Zimmermann 2015-03-25 10:38:00 +01:00
Родитель e2b89e08a8
Коммит 16c8547911
5 изменённых файлов: 29 добавлений и 29 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -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<BluetoothDeviceType>(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<BluetoothTypeOfDevice>(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<size_t>(aIn) >= MOZ_ARRAY_LENGTH(sDeviceType))) {
NS_WARN_IF(static_cast<size_t>(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<int32_t, BluetoothDeviceType>(aOut));
aPDU, UnpackConversion<int32_t, BluetoothTypeOfDevice>(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);

Просмотреть файл

@ -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);

Просмотреть файл

@ -290,7 +290,7 @@ Convert(const bt_property_t& aIn, BluetoothProperty& aOut)
break;
case PROPERTY_TYPE_OF_DEVICE:
rv = Convert(*static_cast<bt_device_type_t*>(aIn.val),
aOut.mDeviceType);
aOut.mTypeOfDevice);
break;
case PROPERTY_SERVICE_RECORD:
rv = Convert(*static_cast<bt_service_record_t*>(aIn.val),

Просмотреть файл

@ -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<BluetoothDeviceType>(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<BluetoothTypeOfDevice>(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;
}