D14524: Fix compiler warning -Wimplicit-fallthrough

2018-08-01 Thread Dominik Haumann
dhaumann added a comment.


  Thanks for the info - I will look into this again later.
  
  I can see that it's code duplication, but strictly speaking the case 
statement of StartElement and EndElement are now more "symmetric".

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D14524

To: dhaumann, vkrause
Cc: winterz, aacid, kwrite-devel, kde-frameworks-devel, michaelh, kevinapavew, 
ngraham, bruns, demsking, cullmann, sars, dhaumann


D14524: Fix compiler warning -Wimplicit-fallthrough

2018-07-31 Thread Allen Winter
winterz added a comment.


  agree that Q_FALLTHROUGH(); is a better idea.
  it doesn't duplicate code and it informs the reader that the fallthrough is 
intentional

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D14524

To: dhaumann, vkrause
Cc: winterz, aacid, kwrite-devel, kde-frameworks-devel, michaelh, kevinapavew, 
ngraham, bruns, demsking, cullmann, sars, dhaumann


D14524: Fix compiler warning -Wimplicit-fallthrough

2018-07-31 Thread Albert Astals Cid
aacid added a comment.


  Maybe it makes more sense to replace it with the magic words?
  
  // fall-through

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D14524

To: dhaumann, vkrause
Cc: aacid, kwrite-devel, kde-frameworks-devel, michaelh, kevinapavew, ngraham, 
bruns, demsking, cullmann, sars, dhaumann


D14524: Fix compiler warning -Wimplicit-fallthrough

2018-07-31 Thread Dominik Haumann
This revision was automatically updated to reflect the committed changes.
Closed by commit R216:7312f52e2753: Fix compiler warning -Wimplicit-fallthrough 
(authored by dhaumann).

REPOSITORY
  R216 Syntax Highlighting

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D14524?vs=38873=38874

REVISION DETAIL
  https://phabricator.kde.org/D14524

AFFECTED FILES
  src/lib/definition.cpp

To: dhaumann, vkrause
Cc: kwrite-devel, kde-frameworks-devel, michaelh, kevinapavew, ngraham, bruns, 
demsking, cullmann, sars, dhaumann


D14524: Fix compiler warning -Wimplicit-fallthrough

2018-07-31 Thread Volker Krause
vkrause accepted this revision.
This revision is now accepted and ready to land.

REPOSITORY
  R216 Syntax Highlighting

BRANCH
  removeWarnings (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D14524

To: dhaumann, vkrause
Cc: kwrite-devel, kde-frameworks-devel, michaelh, kevinapavew, ngraham, bruns, 
demsking, cullmann, sars, dhaumann


D14524: Fix compiler warning -Wimplicit-fallthrough

2018-07-31 Thread Dominik Haumann
dhaumann added a comment.


  If there is a better / more readable fix, please let me know.

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D14524

To: dhaumann, vkrause
Cc: kwrite-devel, kde-frameworks-devel, michaelh, kevinapavew, ngraham, bruns, 
demsking, cullmann, sars, dhaumann


D14524: Fix compiler warning -Wimplicit-fallthrough

2018-07-31 Thread Dominik Haumann
dhaumann created this revision.
dhaumann added a reviewer: vkrause.
Restricted Application added projects: Kate, Frameworks.
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel.
dhaumann requested review of this revision.

REVISION SUMMARY
  syntax-highlighting/src/lib/definition.cpp: In member function ‘void 
KSyntaxHighlighting::DefinitionData::loadGeneral(QXmlStreamReader&)’:
  syntax-highlighting/src/lib/definition.cpp:523:17: warning: this statement 
may fall through [-Wimplicit-fallthrough=]
  
if (elementRefCounter == 0)
^~
  
  syntax-highlighting/src/lib/definition.cpp:525:13: note: here
  
default:
^~~
  
  syntax-highlighting/src/lib/definition.cpp: In member function ‘void 
KSyntaxHighlighting::DefinitionData::loadFoldingIgnoreList(QXmlStreamReader&)’:
  syntax-highlighting/src/lib/definition.cpp:552:17: warning: this statement 
may fall through [-Wimplicit-fallthrough=]
  
if (elementRefCounter == 0)
^~
  
  syntax-highlighting/src/lib/definition.cpp:554:13: note: here
  
default:
^~~

TEST PLAN
  make && make test

REPOSITORY
  R216 Syntax Highlighting

BRANCH
  removeWarnings (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D14524

AFFECTED FILES
  src/lib/definition.cpp

To: dhaumann, vkrause
Cc: kwrite-devel, kde-frameworks-devel, michaelh, kevinapavew, ngraham, bruns, 
demsking, cullmann, sars, dhaumann