D15605: kdev-astyle : upgrade libastyle to v3.1
René J.V. Bertin
noreply at phabricator.kde.org
Fri Sep 21 13:36:35 BST 2018
rjvbb added a comment.
> "If you have inherited this class to access the formatter, you will need to add a method similar to getPeekStart() in the ASStreamIterator class in astyle_main.h." from http://astyle.sourceforge.net/news.html is the only info I have, which leaves lots of room.
> Have you seen any docs for that method?
No, but AStreamIterator::getPeekStart() just returns AStreamIterator::peekStart (hence my version returning m_peekStart).
Looking at astyle_main.cpp we see that peekStart initialised to 0, and elsewhere updated as
peekStart = inStream->tellg();
IOW, their code uses 0 as the invalid value, with the border case inStream->tellg()==0 (which presumable happens only once *if* peekStart is ever changed at the beginning).
> Based on that a fix could also be to always return `0` ;)
Which would be fine as long as we use our own copy (in which case we could also get rid of the assert because it is rather pointless), or even of the entire missing method.
> Your proposed fix might work or not, from what I understood on the quick look at astyle code
I can confirm that it does prevent the assert from triggering.
You're right that a comment would be in order.
To: rjvbb, #kdevelop, kfunk
Cc: kossebau, kfunk, pino, apol, kdevelop-devel, glebaccon, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the KDevelop-devel