[setup and gcc3] Revised patches - now with ChangeLog!

Jason Tishler jason@tishler.net
Tue Nov 5 05:30:00 GMT 2002


Pavel,

On Tue, Nov 05, 2002 at 10:55:36AM +0100, Pavel Tsekov wrote:
> On Mon, 4 Nov 2002, Max Bowsher wrote:
> > >> Jason Tishler <jason@tishler.net> wrote:
> > >>> What about the attached?
> > >>> Note that I only tested setup.exe under Cygwin gcc 2.95.3-5 but
> > >>> I also tried something similar under Linux gcc 3.x.
> >
> > > On Mon, Nov 04, 2002 at 08:05:08PM -0000, Max Bowsher wrote:
> > >> Inlined:
> > >> -LogSingleton::LogSingleton(){}
> > >> +LogSingleton::LogSingleton() : ostream(rdbuf()){}
> > >>
> > >> Certainly looks less hackish than mine.
> 
> But doesn't make any sense. Why call rdbuf() when it just returns the
> internal streambuf pointer i.e. the one which you want to set.

I was concerned about the semantics myself, but I tried it out and it
seemed to work.  However, I just realized one of my mistakes.  I thought
that ostream contained a streambuf via inheritance from ios.  Upon
rereading basic_ios.h, I just noticed that the "streambuf" is really a
"streambuf*".

> IMO, it is good to use ostream (NULL) here and in each of the
> LogSingleton heirs' constructors to do rdbuf (new somestreambuf).

My second mistake was not reading LogFile.cc yesterday.  So, I agree
that the above is the way to go if one wants to minimize changes.
However, it would be nice if LogSingleton could maintain a streambuf
that all derived classes could reuse.

Sorry for the noise.

Jason

-- 
GPG key available on key servers or http://www.tishler.net/jason/gpg.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20021105/4be9d13c/attachment.sig>


More information about the Cygwin-apps mailing list