Renamed function for compacting the data in the rimebuf: rimebuf_compact
This commit is contained in:
parent
91f8c4b8e4
commit
674f373f76
2 changed files with 19 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue