This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [OB] comment fix, corelow.c


> From: Michael Snyder <msnyder@specifix.com>
> Date: Wed, 16 Jan 2008 14:11:42 -0800
> 
> On Wed, 2008-01-16 at 09:04 -0500, Daniel Jacobowitz wrote:
> > On Tue, Jan 15, 2008 at 05:16:58PM -0800, Michael Snyder wrote:
> > > cut and paste botch...
> > 
> > FYI, no objection, but I think it was right the way it was too...
> > 
> > >  	return (*ops->deprecated_xfer_memory) (offset, readbuf,
> > > -					       len, 0/*write*/, NULL, ops);
> > > +					       len, 0/*read*/, NULL, ops);
> > 
> > The value of the parameter is 0, and its name was write.
> 
> I don't think the comment refers to the name of the parameter.
> 
> If you look, there are two adjacent calls to xfer_memory:
> 
> if (readbuf)
>   return (*ops->deprecated_xfer_memory) (offset, readbuf,
>                                          len, 0/*read*/, NULL, ops);
> if (writebuf)
>   return (*ops->deprecated_xfer_memory) (offset, (gdb_byte *) writebuf,
>                                          len, 1/*write*/, NULL, ops);
> 
> One call is a read, the other is a write.
> 
> None of the other parameters have their names in a comment.

And if you ask me having those comments is silly in the first place.
It's much better to have appropriate #defines and use those instead.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]