fix a few benign compiler warnings
gcc complains "-Wmisleading-indention" due to the manner in which this block of code form PR #2544 is indented:
if (e->isMarker()) if (toMarker(e)->markerType() == Marker::Type::FINE) continue; //added above^ rez = QString("%1 %2").arg(rez).arg(e->screenReaderInfo());
That first if statement is a single line if, which contains that second if statement, which contains the continue. But that final "rez = " is not part of that first if block. So it should have one less indentation. An alternative fix would be to combine the first two if statements into one:
if (e->isMarker() && toMarker(e)->markerType() == Marker::Type::FINE)
Comments
But if the author intended that second if and the "rez =" to belong inside the same block of the first block of the first if statement, then should enclose them both in braces.
I'm guessing from the title of the function, "BarLine::accessibleExtraInfo()", that this is probably not important, so doesn't seem to be be a bug. Anyway, I would say need to include both in braces since I would guess only want to add to the rez string if e is a marker. I'm making that conclusiong based on the earlier comment "//markers" above that block...
I'll submit a simple PR with added braces. I know not a biggie, but these warnings always annoy me.
I'm noticing some other compiler warnings...Maybe these can all be fixed in the same PR.
For the error:
I'm fixing by adding having default case be the same as NO_BRACKET:
similarly for:
I'm adding default case:
similarly for
I'm doing:
Ideally, compiler should be smart enough to figure out that sid is always assigned to something, since _dividerType is an enum which can only be LEFT or RIGHT. But since compiler isn't smart enough and since I don't like these warnings, I'm making these default cases.
-Wmisleading-indentation in 3rd party ofqf:
Since this is 3rd party code, I'm wondering that making changes to this might not be the best, incase the 3rd party updates the code, then making comparisons will be difficult. But what I have done is use the auto indent feature in qtcreator, using musescore's coding rules .xml file, which will make comparisons easy against any new changes, provided that the new changes also use musescore's indentation rules.
I rebased and changed a couple things in response to what jojo wrote on the github pr.
https://github.com/musescore/MuseScore/pull/2629
Fixed in branch master, commit 4ace61ee64
fix #112736 a few benign compiler warnings
Fixed in branch master, commit 80cac043f3
Merge pull request #2629 from ericfont/112736-warnings
fix #112736 a few benign compiler warnings
Automatically closed -- issue fixed for 2 weeks with no activity.