On Thu, 2010-09-30 at 14:22 +0200, Sebastian Spaeth wrote:
On 2010-09-30, nthiebaud@gmail.com wrote:
if(rSel.A() == rSel.B() &&
- !rSel.A() || rSel.A() == nTextLen )
+ (!rSel.A() || rSel.A() == nTextLen ))
While we change such code, would it be acceptable to also specify the
purpose of the conditions in prose as to be able to understand what it
actually happening?
Sure. With those && || warnings of course it's possible in some
circumstances that the true precedence actually being used by the
compiler *isn't* what the original developer thought he was doing, hence
the purpose of these gcc 4.[4|5] warnings. In doubt though, sticking
with the current logic clearly doesn't make things worse. Converting
them to prose and sanity checking the result to make sure its meaningful
is probably worthwhile, but comments always have to be taken with a
grain of salt :-)
Worth noting is that there's a list at
http://qa.openoffice.org/issues/showdependencytree.cgi?id=96084 of a lot
of the previous && || warnings. Some of the fixes there which are
integrated for OOo, are only fixed on the OOo 3.4 branch. So if you're
looking at && || warnings, have a look through that list to see if
there's already a fix available there to pull in.
C.
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.