On Monday 16 November 2009, Zach Welch wrote:
>
> > Fine with me. If I can persuade you to do those
> > three cleanups, I'd be happier. ;)
>
> I've posted my series to do this, now it's your turn. :)
OK; I committed a minor doxygen fix for your series of five ... ;)
> Remove the 'extern' in
On Sun, 2009-11-15 at 16:11 -0700, David Brownell wrote:
> On Sunday 15 November 2009, Zach Welch wrote:
> > >
> > > I'd be happier if it were called DIV_ROUND_UP() like a
> > > certain OS kernel I could mention ... not as cryptic.
> >
> > I agree that the current name stands to be improved.
> >
On Sun, 2009-11-15 at 16:12 -0700, David Brownell wrote:
> On Sunday 15 November 2009, Zach Welch wrote:
> > >
> > > Or maybe I was. Given that it copies everything, why
> > > is there code *after* the copy mangling the last byte?
> > > Wouldn't that only be correct when the code copied
> > > all
On Sunday 15 November 2009, Zach Welch wrote:
> >
> > Or maybe I was. Given that it copies everything, why
> > is there code *after* the copy mangling the last byte?
> > Wouldn't that only be correct when the code copied
> > all but the trailing partial byte?
>
> It masks the last byte, ensuring
On Sunday 15 November 2009, Zach Welch wrote:
> >
> > I'd be happier if it were called DIV_ROUND_UP() like a
> > certain OS kernel I could mention ... not as cryptic.
>
> I agree that the current name stands to be improved.
>
> > (Likewise, there's a DIM which is used for ARRAY_SIZE.
> > And lot
On Sat, 2009-11-14 at 19:59 -0700, David Brownell wrote:
> On Saturday 14 November 2009, Zach Welch wrote:
> > On Sat, 2009-11-14 at 12:56 -0700, David Brownell wrote:
> > > On Saturday 14 November 2009, Zachary T Welch wrote:
> > > > - for (unsigned i = 0, num_bytes = CEIL(size, 8); i < num_
On Saturday 14 November 2009, Zach Welch wrote:
> On Sat, 2009-11-14 at 12:56 -0700, David Brownell wrote:
> > On Saturday 14 November 2009, Zachary T Welch wrote:
> > > - for (unsigned i = 0, num_bytes = CEIL(size, 8); i < num_bytes;
> > > i++)
> > > - to[i] = from[i];
> > > +
On Sat, 2009-11-14 at 12:56 -0700, David Brownell wrote:
> On Saturday 14 November 2009, Zachary T Welch wrote:
> > - for (unsigned i = 0, num_bytes = CEIL(size, 8); i < num_bytes; i++)
> > - to[i] = from[i];
> > + // copy entire buffer
> > + memcpy(_to, from, CEIL(s
On Saturday 14 November 2009, Zachary T Welch wrote:
> - for (unsigned i = 0, num_bytes = CEIL(size, 8); i < num_bytes; i++)
> - to[i] = from[i];
> + // copy entire buffer
> + memcpy(_to, from, CEIL(size, 8));
Comment is wrong: copies all but trailing partial byte.
Use memcpy for bulk of copy, improve final byte handling.
Improve types by using void * for buffers and unsigned for size.
Signed-off-by: Zachary T Welch
---
src/helper/binarybuffer.c | 17 +
src/helper/binarybuffer.h |3 ++-
2 files changed, 11 insertions(+), 9 deletions(-
10 matches
Mail list logo