Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


oops, forgot to reply-all


---------- Forwarded message ----------
From: Norbert Thiebaud <nthiebaud@gmail.com>
Date: 2010/11/23
Subject: Re: [Libreoffice] [patch] binfilter: cleanup and compilation
warnings removal.
To: Pierre-André Jacquod <pjacquod@alumni.ethz.ch>


2010/11/23 Pierre-André Jacquod <pjacquod@alumni.ethz.ch>:
On 11/23/2010 09:23 AM, Joachim Trémouroux wrote:

Hi Michael,
I will work on this. I see two possible ways:


Ok Michael, then I will continue within binfilter... ::-))

But a additional question:

From Norbert Thiebaud:

To be consistent, I rather see them commented out
i.e

foo(int bar)
->
foo(int /*bar*/)
rather than
foo(int)

To have a better code, would it not be better to change the prototyping
of the function from foo (int) to foo() ?? Or did I miss a point?

No you usually can't do that. these function are often virtual, so if
you change the prototype you need to change it in the whole
inheritance. furthermore even if not virtual you would still need to
cahnge all the caller.
The reasons for all the 'unused' parameter is that binfilter is
essentially a gutted version of the old product that is there only to
convert old format...
In some case the parameter are 'unused' even in 'normal' code, because
a virtual function was designed with the idea thaty you 'might' need a
give info, but practically in that sub-class you really don't care
about it... just because you don;t care for that sub-class doesn't
mean that any sub-class won't... and leaving the name in, allow the
reader to actually understand what information is available - yet
unnecessary for now.

So no, you can't practically remove the parameter... and leaving the
parameter name, ableit inside /* */, is nicer because then you know
what that parameter is ... imagine foo(int,int,int,int) compared to
foo(int /* x_pos*/, int /* y_pos */, int /* legnth */, int /* width
*/)
which one would you prefer reading ? (from the point of view: I don't
know anything about foo() )

Norbert


So would the code be cleaner.... or do you intend to drop the binfilter
components very soon ?
regards




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.