Re: [Libreoffice] message construction bloat ...

2011-11-25 Thread Lubos Lunak
On Thursday 24 of November 2011, Marc-André Laverdière wrote: > Can we get the c++ equivalent of logback/slf4j? I don't know what that actually means. > Avoiding string concat most of the time is the better option. Not sure what you're trying to say here, but if the original data is split, th

Re: [Libreoffice] message construction bloat ...

2011-11-24 Thread Marc-André Laverdière
Can we get the c++ equivalent of logback/slf4j? Avoiding string concat most of the time is the better option. Marc-André Laverdière Sent from a mobile device, please excuse the brevity On 23 Nov 2011 11:56, "Lubos Lunak" wrote: On Wednesday 23 of November 2011, Michael Meeks wrote: > On Wed,

Re: [Libreoffice] message construction bloat ...

2011-11-24 Thread Lubos Lunak
On Wednesday 23 of November 2011, Lubos Lunak wrote: > I expect it would be even possible to achieve such single in-place call > even for the LOG( "P is " << p << " and b is " << b ) case, or even do this > for string+string operation, which would turn it into the even > better-looking LOG( "P is

Re: [Libreoffice] message construction bloat ...

2011-11-23 Thread Lubos Lunak
On Wednesday 23 of November 2011, Michael Meeks wrote: > On Wed, 2011-11-23 at 14:56 +0100, Lubos Lunak wrote: > > And some of the arguments are rather weak as well, I can get you easy to > > use and read, better to translate and similarly space efficient without > > var-args. Wanna bet :) ? > >

Re: [Libreoffice] message construction bloat ...

2011-11-23 Thread Michael Meeks
On Wed, 2011-11-23 at 14:56 +0100, Lubos Lunak wrote: > ... and they abort at runtime with anything that's not a plain type, most > notably C++ strings. :-) > And some of the arguments are rather weak as well, I can get you easy to use > and read, better to translate and similarly sp

Re: [Libreoffice] message construction bloat ...

2011-11-23 Thread Stephan Bergmann
On 11/23/2011 02:53 PM, Lionel Elie Mamane wrote: Also, more generally, in the face of platform-dependent typedefs of integer types, *I*, for one, never really know which length modifier to use in the format string :-( %d? %ld? Look at how glibc had to solve this issue with an extension length mo

Re: [Libreoffice] message construction bloat ...

2011-11-23 Thread Stephan Bergmann
On 11/23/2011 02:52 PM, Tor Lillqvist wrote: On all those that use typedef signed long sal_Int32; Ah, but it still *works*, doesn't it? int is *also* 32 bits on these platforms, isn't it? But yeah, I guess you do get a warning from gcc. Yes you do. For real-life problems with printf-style

Re: [Libreoffice] message construction bloat ...

2011-11-23 Thread Lubos Lunak
On Wednesday 23 of November 2011, Michael Meeks wrote: > I know C++ doesn't like var-args, and I know var-args is type-unsafe, > and thus per-se 'evil' :-) but it also happens to be really easy to use > & read, better to translate, very familiar to most developers, and ... ... and they abor

Re: [Libreoffice] message construction bloat ...

2011-11-23 Thread Lionel Elie Mamane
On Wed, Nov 23, 2011 at 12:59:00PM +, Michael Meeks wrote: > The attached test contrasts: > fprintf (stderr, "P is %s and b is %d\n", p, b); > vs. > std::cout << "P is " << p << " and b is " << b << "\n"; > Given that the real per-site difference is larger. Add to thi

Re: [Libreoffice] message construction bloat ...

2011-11-23 Thread Tor Lillqvist
> On all those that use >  typedef signed long sal_Int32; Ah, but it still *works*, doesn't it? int is *also* 32 bits on these platforms, isn't it? But yeah, I guess you do get a warning from gcc. --tml ___ LibreOffice mailing list LibreOffice@lists.fr

Re: [Libreoffice] message construction bloat ...

2011-11-23 Thread Stephan Bergmann
On 11/23/2011 02:36 PM, Tor Lillqvist wrote: On which of the platforms that we support is %d not a proper format for sal_Int32? On all those that use typedef signed long sal_Int32; Stephan ___ LibreOffice mailing list LibreOffice@lists.freedesktop

Re: [Libreoffice] message construction bloat ...

2011-11-23 Thread Tor Lillqvist
>  "Value is %" SAL_PRIdINT32, n (presumably n here is then sal_Int32?) On which of the platforms that we support is %d not a proper format for sal_Int32? Even in the unlikely case that on some platform int indeed is larger (for instance 64 bits) than sal_Int32, won't the usual conversions take

Re: [Libreoffice] message construction bloat ...

2011-11-23 Thread Stephan Bergmann
On 11/23/2011 01:59 PM, Michael Meeks wrote: Given that the real per-site difference is larger. Add to this the issue that there are real translation problems with the 2nd approach (that it cannot be appropriately re-ordered), and IMHO the argument here is overwhelmingly against 'cute' op

Re: [Libreoffice] message construction bloat ...

2011-11-23 Thread Noel Grandin
Michael Meeks wrote: > and I know var-args is type-unsafe, Don't all of the major compilers have extensions for compile-time checking of printf-style strings? Disclaimer: http://www.peralex.com/disclaimer.html ___ LibreOffice mailing list LibreOff

[Libreoffice] message construction bloat ...

2011-11-23 Thread Michael Meeks
So, While the discussion on logging goes on; I knocked up a little test to compare the difference between a couple of styles of string creation, orthogonally for eg. exception message construction. One of LibreOffice's -big- problems is size: we're too big. There are lots of reaso