Skip to content

Commit

Permalink
Merge pull request #107 from KurtE/meaningless_compiler_warnings
Browse files Browse the repository at this point in the history
Some may be unitialized ... warnings
  • Loading branch information
PaulStoffregen authored Jan 11, 2023
2 parents 57609d5 + 9b52a49 commit 69b9072
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions BluetoothConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ int BluetoothConnection::extract_next_SDP_Token(uint8_t *pbElement, int cb_left,
sdpe.element_size = element & 7;
sdpe.data.luw = 0; // start off 0

int size_of_element;
int size_of_element = -1; // should never use this initialized value
switch (sdpe.element_size) {
case 0: size_of_element = 2; break;
case 1: size_of_element = 3; break;
Expand Down Expand Up @@ -1855,7 +1855,7 @@ void BluetoothConnection::parse()
p += *p + 3;
continue;
}
uint32_t val;
uint32_t val = 0;
switch (tag & 0x03) { // Short Item data
case 0: val = 0;
p++;
Expand Down Expand Up @@ -1959,7 +1959,7 @@ void BluetoothConnection::parse(uint16_t type_and_report_id, const uint8_t *data
p += p[1] + 3;
continue;
}
uint32_t val;
uint32_t val = 0;
switch (tag & 0x03) { // Short Item data
case 0: val = 0;
p++;
Expand Down
2 changes: 1 addition & 1 deletion bluetooth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2328,7 +2328,7 @@ void BluetoothController::sendHCISimplePairingMode() {
}

void BluetoothController::sendHCIReadSimplePairingMode() {
uint8_t hcibuf[2];
static const uint8_t hcibuf[2] = {0, 0} ; // could probably toss and pass nullptr
DBGPrintf("HCI_Read Simple Pairing Mode\n");
sendHCICommand(HCI_READ_SIMPLE_PAIRING_MODE, 0, hcibuf);
}
Expand Down
4 changes: 2 additions & 2 deletions hid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ void USBHIDParser::parse()
p += *p + 3;
continue;
}
uint32_t val;
uint32_t val = 0;
switch (tag & 0x03) { // Short Item data
case 0: val = 0;
p++;
Expand Down Expand Up @@ -500,7 +500,7 @@ void USBHIDParser::parse(uint16_t type_and_report_id, const uint8_t *data, uint3
p += p[1] + 3;
continue;
}
uint32_t val;
uint32_t val = 0;
switch (tag & 0x03) { // Short Item data
case 0: val = 0;
p++;
Expand Down

0 comments on commit 69b9072

Please sign in to comment.