Renamed function for compacting the data in the rimebuf: rimebuf_compact

This commit is contained in:
adamdunkels 2007-03-14 00:30:11 +00:00
parent 91f8c4b8e4
commit 674f373f76
2 changed files with 19 additions and 9 deletions

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: rimebuf.c,v 1.2 2007/03/13 10:28:16 adamdunkels Exp $
* $Id: rimebuf.c,v 1.3 2007/03/14 00:30:11 adamdunkels Exp $
*/
/**
@ -76,11 +76,15 @@ rimebuf_copyfrom(u8_t *from, u16_t len)
}
/*---------------------------------------------------------------------------*/
void
rimebuf_copy_reference(void)
rimebuf_compact(void)
{
if(rimebuf_is_reference()) {
memcpy(&rimebuf[RIMEBUF_HDR_SIZE], rimebuf_reference_ptr(),
rimebuf_datalen());
} else {
memcpy(&rimebuf[RIMEBUF_HDR_SIZE], &rimebuf[bufptr + RIMEBUF_HDR_SIZE],
rimebuf_datalen());
bufptr = 0;
}
}
/*---------------------------------------------------------------------------*/