Skip to content

Commit

Permalink
Fix MSVC compiler warning
Browse files Browse the repository at this point in the history
reg. unreachable code (C4702)

Fixed by removing the offending and apparently unused code, along with another bunch of unused code.
  • Loading branch information
Jojo-Schmitz committed Nov 22, 2023
1 parent fe6fff5 commit 6b0208a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 133 deletions.
125 changes: 0 additions & 125 deletions src/braille/internal/braillecode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1021,129 +1021,4 @@ std::vector<std::string> splitCodes(std::string code)
}
return lst;
}

braille_code* findBrailleCode(std::vector<braille_code*> code_lst, std::string code, bool partial_match)
{
if (partial_match) {
std::vector<std::string> codes = splitCodes(code);

for (braille_code* br : code_lst) {
std::vector<std::string> lst = splitCodes(br->code);

if (codes.size() > lst.size()) {
return nullptr;
}

for (size_t i=0; i < codes.size(); i++) {
if (codes[i] != lst[i]) {
return nullptr;
}
}
return br;
}
} else {
for (braille_code* br : code_lst) {
if (br->code == code) {
return br;
}
}
}
return nullptr;
}

braille_code* findRest(const std::string braille)
{
for (int i=3; i <= 6; i++) {
if (braille == Braille_Rests[i]->code) {
return Braille_Rests[i];
}
}
return NULL;
}

braille_code* findNote(const std::string braille)
{
for (int i=3; i <= 6; i++) {
if (braille == Braille_aNotes[i]->code) {
return Braille_aNotes[i];
}
}

for (int i=3; i <= 6; i++) {
if (braille == Braille_bNotes[i]->code) {
return Braille_bNotes[i];
}
}

for (int i=3; i <= 6; i++) {
if (braille == Braille_cNotes[i]->code) {
return Braille_cNotes[i];
}
}

for (int i=3; i <= 6; i++) {
if (braille == Braille_dNotes[i]->code) {
return Braille_dNotes[i];
}
}

for (int i=3; i <= 6; i++) {
if (braille == Braille_eNotes[i]->code) {
return Braille_eNotes[i];
}
}

for (int i=3; i <= 6; i++) {
if (braille == Braille_fNotes[i]->code) {
return Braille_fNotes[i];
}
}

for (int i=3; i <= 6; i++) {
if (braille == Braille_gNotes[i]->code) {
return Braille_gNotes[i];
}
}
return NULL;
}

braille_code* findOctave(const std::string braille)
{
for (int i=0; i <= 8; i++) {
if (braille == Braille_Octaves[i]->code) {
return Braille_Octaves[i];
}
}
return NULL;
}

braille_code* findAccidental(const std::string braille)
{
for (int i=0; i <= 6; i++) {
if (braille == Braille_Accidentals[i]->code) {
return Braille_Accidentals[i];
}
}
return NULL;
}

braille_code* findFinger(const std::string braille)
{
for (int i=0; i < 6; i++) {
if (braille == Braille_Fingers[i]->code) {
return Braille_Fingers[i];
}
}
return NULL;
}

braille_code* findInterval(const std::string braille)
{
for (int i=0; i <= 6; i++) {
if (braille == Braille_Intervals[i]->code) {
return Braille_Intervals[i];
}
}
return NULL;
}
}
8 changes: 0 additions & 8 deletions src/braille/internal/braillecode.h
Original file line number Diff line number Diff line change
Expand Up @@ -773,13 +773,5 @@ std::string getBraillePattern(std::string dots);
std::string translate2Braille(std::string codes);
std::string intToBrailleUpperNumbers(std::string txt, bool indicator);
std::string intToBrailleLowerNumbers(std::string txt, bool indicator);

braille_code* findBrailleCode(std::string code, bool partial_match = false);
braille_code* findNote(const std::string braille);
braille_code* findRest(const std::string braille);
braille_code* findOctave(const std::string braille);
braille_code* findAccidental(const std::string braille);
braille_code* findFinger(const std::string braille);
braille_code* findInterval(const std::string braille);
}
#endif // MU_BRAILLE_BRAILLEDOTS_H

0 comments on commit 6b0208a

Please sign in to comment.