Re: [Flightgear-devel] SGFile::readline

2010-03-02 Thread Tim Moore
I see we're talking past each other on some points and are in violent agreement on others, probably because the discussion overheated. On Tue, Mar 2, 2010 at 11:20 AM, John Denker wrote: > On 03/02/2010 01:08 AM, Tim Moore wrote: > > > Furthermore, I can't parse the "suspend development" comment

Re: [Flightgear-devel] SGFile::readline

2010-03-02 Thread John Denker
On 03/02/2010 01:08 AM, Tim Moore wrote: > Furthermore, I can't parse the "suspend development" comment. It is coming > from some alternate reality of git usage. We are definitely talking about two different realities. > First off, I did identify the > commit id where you made changes to use g

Re: [Flightgear-devel] SGFile::readline

2010-03-02 Thread Tim Moore
On Tue, Mar 2, 2010 at 12:47 AM, John Denker wrote: > On 03/01/2010 04:13 PM, Tim Moore wrote: > > > I'm looking at io/sg_file.cxx in the sport branch. I see the old > > implementation of readline inside an > > "execrable_readline" #ifdef. I don't see any other implementation of > > readline. > >

Re: [Flightgear-devel] SGFile::readline

2010-03-01 Thread John Denker
On 03/01/2010 04:13 PM, Tim Moore wrote: > I'm looking at io/sg_file.cxx in the sport branch. I see the old > implementation of readline inside an > "execrable_readline" #ifdef. I don't see any other implementation of > readline. > Perhaps my question would go away if I fetched your sport flightg

Re: [Flightgear-devel] SGFile::readline

2010-03-01 Thread Tim Moore
On Tue, Mar 2, 2010 at 12:01 AM, John Denker wrote: > On 03/01/2010 03:56 PM, Tim Moore wrote: > > > getline looks fine. > > :-) > > > Instead of getting steamed about readline, why not > > implement it in terms of getline? > > I did. > > If this is really a question, please clarify the question.

Re: [Flightgear-devel] SGFile::readline

2010-03-01 Thread John Denker
On 03/01/2010 03:56 PM, Tim Moore wrote: > getline looks fine. :-) > Instead of getting steamed about readline, why not > implement it in terms of getline? I did. If this is really a question, please clarify the question. --

Re: [Flightgear-devel] SGFile::readline

2010-03-01 Thread Tim Moore
On Tue, Feb 23, 2010 at 11:36 PM, John Denker wrote: > On 02/15/2010 03:19 AM, Tim Moore in part wrote: > > > readline() is pretty gross; > > The best way to remove the grossness is to extirpate > readline and replace it with something that has a > nicer interface ... such as returning a std::str

Re: [Flightgear-devel] SGFile::readline

2010-02-23 Thread Tim Moore
On Tue, Feb 23, 2010 at 11:36 PM, John Denker wrote: > > I tried asking for suggestions and/or review off-list, > but it appears that mail to timoor...@gmail.com never > goes through. Is it a list-mail address only? > No. Sometimes I'm busier and/or lamer than other times. I did get your mail on

Re: [Flightgear-devel] SGFile::readline

2010-02-23 Thread John Denker
On 02/15/2010 03:19 AM, Tim Moore in part wrote: > readline() is pretty gross; The best way to remove the grossness is to extirpate readline and replace it with something that has a nicer interface ... such as returning a std::string. I wrote a getline function to do this. Much cleaner. No nee

Re: [Flightgear-devel] SGFile::readline

2010-02-17 Thread Tim Moore
Thanks John, I'll check this out. Tim On Wed, Feb 17, 2010 at 4:09 PM, John Denker wrote: > On Mon, Feb 15, 2010 at 5:43 PM, I wrote: > > >> 2) It would be even less of a problem to do the following > >> the specified number of times: > >> -- detect the EoF > >> -- close the file > >> -- reop

Re: [Flightgear-devel] SGFile::readline

2010-02-17 Thread John Denker
On Mon, Feb 15, 2010 at 5:43 PM, I wrote: >> 2) It would be even less of a problem to do the following >> the specified number of times: >> -- detect the EoF >> -- close the file >> -- reopen the file and start reading again. >> >> This has the advantage that it works the same as lseek >> for r

Re: [Flightgear-devel] SGFile::readline

2010-02-15 Thread Tim Moore
On Mon, Feb 15, 2010 at 5:43 PM, John Denker wrote: > On 02/15/2010 09:22 AM, Tim Moore wrote: > > >> Hint: The sleep statement ensures that the reader (fgfs) > >> will not see an EoF at the point where one cat of bytes > >> ends and the next begins. > > > I'd probably do without the "sleep" and

Re: [Flightgear-devel] SGFile::readline

2010-02-15 Thread John Denker
On 02/15/2010 09:22 AM, Tim Moore wrote: >> Hint: The sleep statement ensures that the reader (fgfs) >> will not see an EoF at the point where one cat of bytes >> ends and the next begins. > I'd probably do without the "sleep" and write while true; do cat bytes; > done >/tmp/pipe.flog & instead.

Re: [Flightgear-devel] SGFile::readline

2010-02-15 Thread Tim Moore
On Mon, Feb 15, 2010 at 2:41 PM, John Denker wrote: > On 02/15/2010 03:19 AM, Tim Moore wrote: > > > Some of > > the grossness is due to a hack which lets a file be treated as an > infinitely > > repeating stream of bytes, very convenient for demos at SIGGRAPH. Your > patch > > breaks that hack.

Re: [Flightgear-devel] SGFile::readline

2010-02-15 Thread John Denker
On 02/15/2010 03:19 AM, Tim Moore wrote: > Some of > the grossness is due to a hack which lets a file be treated as an infinitely > repeating stream of bytes, very convenient for demos at SIGGRAPH. Your patch > breaks that hack. I won't argue too strongly that the hack belongs in > SGFile, but I w

Re: [Flightgear-devel] SGFile::readline

2010-02-15 Thread Tim Moore
On Sun, Feb 14, 2010 at 10:47 PM, John Denker wrote: > The following commit message should be self-explanatory: > > commit 224ce694fa8ba7dede0e413b81e5dd52e5e65f15 > Author: John Denker > Date: Thu Feb 11 21:13:19 2010 -0700 > >Problem was: readline writes out-of-bounds, corrupts memory. >