[Libreoffice-bugs] [Bug 137670] Simplify uses of sal_math_Double

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Thu Oct 22 09:39:11 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=137670

--- Comment #3 from Stephan Bergmann <sbergman at redhat.com> ---
(In reply to Mike Kaganski from comment #2)
> (In reply to Stephan Bergmann from comment #1)
> > I tend to disagree with adding such a function (esp. to
> > include/sal/mathconf.h, which is part of the stable URE interface; esp. with
> > adding it not conditional on LIBO_INTERNAL_ONLY):
> 
> The "esp". bits seem like "it's OK to do that *if* it is guarded by
> LIBO_INTERNAL_ONLY, *or if* it's outside of include/sal/mathconf.h"? ;-) It
> would be nice if you provided a positive set of conditions :-) (I CCed you
> exactly because you are the expert who can tell if this is a bad idea after
> all - just please be verbose why it's bad.)

If it were functionality that would indeed provide widespread benefit, I would
consider it OK to either add it as LIBO_INTERNAL_ONLY to a stable URE interface
file, or to a file outside the stable URE interface (e.g., somewhere in
include/o3tl/).

> >  I think the very few
> > cases that now use
> > 
> >   reinterpret_cast<sal_math_Double *>(X)->E
> > 
> > could just as well use something like
> > 
> >   sal_math_Double d;
> >   d.value = X;
> >   d.E
> > 
> > instead.
> 
> Yes, but this is awkward, and I don't see a benefit in using this form. Do
> you? :-)

It avoids the reinterpret_cast that you were after.  And I don't consider it
awkward, let alone awkward enough to not use it in the ca. three places where
it is needed across the code base.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20201022/60952910/attachment.htm>


More information about the Libreoffice-bugs mailing list