Fix "use of unitialized variable" in xxtea.c and byteorder.c
This commit is contained in:
parent
628b88ce73
commit
f90c995053
|
@ -10,7 +10,7 @@ void uint32touint8p(uint32_t v, uint8_t *p)
|
||||||
|
|
||||||
uint32_t uint8ptouint32(uint8_t *p)
|
uint32_t uint8ptouint32(uint8_t *p)
|
||||||
{
|
{
|
||||||
uint32_t v;
|
uint32_t v=0;
|
||||||
v |= *p++; v<<=8;
|
v |= *p++; v<<=8;
|
||||||
v |= *p++; v<<=8;
|
v |= *p++; v<<=8;
|
||||||
v |= *p++; v<<=8;
|
v |= *p++; v<<=8;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
uint32_t htonl(uint32_t v)
|
uint32_t htonl(uint32_t v)
|
||||||
{
|
{
|
||||||
uint32_t r;
|
uint32_t r=0;
|
||||||
r |= (v>> 0)&0xFF; r<<=8;
|
r |= (v>> 0)&0xFF; r<<=8;
|
||||||
r |= (v>> 8)&0xFF; r<<=8;
|
r |= (v>> 8)&0xFF; r<<=8;
|
||||||
r |= (v>>16)&0xFF; r<<=8;
|
r |= (v>>16)&0xFF; r<<=8;
|
||||||
|
|
Loading…
Reference in New Issue