Skip to content

Commit f76382d

Browse files
committed
Fixing various warnings in bluetooth
1 parent 9407bdf commit f76382d

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

Source/bluetooth/audio/AVDTPProfile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ namespace AVDTP {
455455
}
456456

457457
return (code);
458-
};
458+
}
459459

460460
} // namespace AVDTP
461461

Source/bluetooth/audio/SDPSocket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ namespace SDP {
326326
uuid = Bluetooth::UUID((_buffer[_readerOffset] << 24) | (_buffer[_readerOffset + 1] << 16)
327327
| (_buffer[_readerOffset + 2] << 8) | _buffer[_readerOffset + 3]);
328328
} else {
329-
uint8_t buffer[size];
329+
uint8_t* buffer = static_cast<uint8_t*>(ALLOCA(size));
330330
uint8_t i = size;
331331
while (i-- > 0) {
332332
buffer[i] = _buffer[_readerOffset++];

Source/bluetooth/audio/codecs/SBC.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ ENUM_CONVERSION_BEGIN(Bluetooth::A2DP::SBC::preset)
3131
{ Bluetooth::A2DP::SBC::MQ, _TXT("MQ") },
3232
{ Bluetooth::A2DP::SBC::HQ, _TXT("HQ") },
3333
{ Bluetooth::A2DP::SBC::XQ, _TXT("XQ") },
34-
ENUM_CONVERSION_END(Bluetooth::A2DP::SBC::preset);
34+
ENUM_CONVERSION_END(Bluetooth::A2DP::SBC::preset)
3535

3636
ENUM_CONVERSION_BEGIN(Bluetooth::A2DP::SBC::Config::channelmode)
3737
{ Bluetooth::A2DP::SBC::Config::MONO, _TXT("Mono") },
3838
{ Bluetooth::A2DP::SBC::Config::STEREO, _TXT("Stereo") },
3939
{ Bluetooth::A2DP::SBC::Config::JOINT_STEREO, _TXT("JointSstereo") },
4040
{ Bluetooth::A2DP::SBC::Config::DUAL_CHANNEL, _TXT("DualChannel") },
41-
ENUM_CONVERSION_END(Bluetooth::A2DP::SBC::Config::channelmode);
41+
ENUM_CONVERSION_END(Bluetooth::A2DP::SBC::Config::channelmode)
4242

4343
namespace Bluetooth {
4444

Source/bluetooth/gatt/GATTSocket.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,9 @@ bool GATTSocket::Security(const uint8_t level)
324324
}
325325

326326
if (result == true) {
327-
struct bt_security btSecurity = { .level = level, 0 };
327+
struct bt_security btSecurity;
328+
btSecurity.level = level;
329+
btSecurity.key_size = 0;
328330
if (::setsockopt(Handle(), SOL_BLUETOOTH, BT_SECURITY, &btSecurity, sizeof(btSecurity)) != 0) {
329331
TRACE_L1("Failed to set Bluetooth Security level for device [%s], error: %d, try L2CAP Security", RemoteId().c_str(), errno);
330332
if (::setsockopt(Handle(), SOL_L2CAP, L2CAP_LM, &lm, sizeof(lm)) != 0) {

0 commit comments

Comments
 (0)