2011-07-17 18:01:29 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
void uint32touint8p(uint32_t v, uint8_t *p)
|
|
|
|
{
|
|
|
|
*p++ = (v>>24)&0xFF;
|
|
|
|
*p++ = (v>>16)&0xFF;
|
|
|
|
*p++ = (v>> 8)&0xFF;
|
|
|
|
*p++ = (v>> 0)&0xFF;
|
|
|
|
}
|
2011-07-17 18:32:17 +00:00
|
|
|
|
|
|
|
uint32_t uint8ptouint32(uint8_t *p)
|
|
|
|
{
|
2011-07-18 16:24:34 +00:00
|
|
|
uint32_t v=0;
|
2011-07-17 18:32:17 +00:00
|
|
|
v |= *p++; v<<=8;
|
|
|
|
v |= *p++; v<<=8;
|
|
|
|
v |= *p++; v<<=8;
|
|
|
|
v |= *p;
|
|
|
|
return v;
|
|
|
|
}
|