2004-03-01 08:29:23

by Amit S. Kale

[permalink] [raw]
Subject: Re: [Kgdb-bugreport] [PATCH][3/3] Update CVS KGDB's wrt connect / detach

On Friday 27 Feb 2004 3:15 am, Pavel Machek wrote:
> Hi!
>
> > > 3. putpacket writes the packet and waits for a '+'
> > > 4. new gdb sends a protocol initialization packet
> > > 5. putpacket reads characters in that packet hoping for an incoming '+'
> > > sending out console message packet on each incoming character
> > > 6. gdb receives and rejects each console message packet
> > >
> > > > - Remove ok_packet(), excessive, IMHO.
> > >
> > > ok_packet is better than littering "OK" all over the place.
> >
> > I disagree. If ok_packet was anything more than
> > strcpy(remcom_out_buffer, "OK") you'd be right.
>
> Amit, he's right, having function just for one strcpy only makes code
> harder to read. And it does not even save much typing...

OK. I agree that strcpy is better.

-Amit

>
> ok_packet(foo);
> strcpy(foo,"OK");
>
> ...we are talking 2 or 3 characters here....
> Pavel