Counter-productive UNUSED macro in connectivity/source/drivers/postgresql

Lubos Lunak l.lunak at suse.cz
Thu Feb 9 02:38:18 PST 2012


On Thursday 09 of February 2012, Michael Meeks wrote:
> On Thu, 2012-02-09 at 09:20 +0000, Caolán McNamara wrote:
> > Yeah, see commentary around SAL_UNUSED_PARAMETER in sal/inc/sal/types.h,
> > can replace it with that if necessary.
>
> 	If we can choose - why do we add such over-long macros ? :-)
...
> 	Personally, I'd -love- someone to rename ~all of these
> RTL_USTR() or RTL_STR() or somesuch - we have enough pointlessly hard to
> read and indent coding around the place. Hey - we could even have an:
>
> 	RTL_USTRING("foo")
>
> 	that hid all the:
>
> 	rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("foo"))
>
> 	madness from sight ;-)

 It'd be probably almost the same amount of work to get rid of the macro 
completely and add a special ctor to handle string literals (can you arrange 
a HackWeek for me soon ;) ? ).

> 	(though there is perhaps at least some merit in 
> typing all that stuff to remind you how inefficient the Ascii -> UTC2
> conversion is I guess).

 That's meant to be UCS-2, right? How is that supposed to be inefficient, it's 
just plain 1-byte -> 2-bytes extension.

> 	Anyhow - on this topic:
>
> 	Any chance of SAL_UNUSED ? ;-) At worse, SAL_UNUSED_PARAM.

 SAL_UNUSED_PARAM? And that's how the Writer codebase came around ... . Unlike 
RTL_CONSTASCII_USTRINGPARAM(), this one is unlikely to be used often, so I 
see no special need to strive for brevity here. That said, SAL_UNUSED seems 
ok.

-- 
 Lubos Lunak
 l.lunak at suse.cz


More information about the LibreOffice mailing list