forked from wolfSSL/wolfssl
Fix issues building with inline disabled.
This commit is contained in:
@ -240,7 +240,7 @@ STATIC INLINE int ConstantCompare(const byte* a, const byte* b, int length)
|
|||||||
#endif /* !WOLFSSL_HAVE_MAX */
|
#endif /* !WOLFSSL_HAVE_MAX */
|
||||||
|
|
||||||
/* converts a 32 bit integer to 24 bit */
|
/* converts a 32 bit integer to 24 bit */
|
||||||
static INLINE void c32to24(word32 in, word24 out)
|
STATIC INLINE void c32to24(word32 in, word24 out)
|
||||||
{
|
{
|
||||||
out[0] = (in >> 16) & 0xff;
|
out[0] = (in >> 16) & 0xff;
|
||||||
out[1] = (in >> 8) & 0xff;
|
out[1] = (in >> 8) & 0xff;
|
||||||
@ -248,14 +248,14 @@ static INLINE void c32to24(word32 in, word24 out)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* convert 16 bit integer to opaque */
|
/* convert 16 bit integer to opaque */
|
||||||
static INLINE void c16toa(word16 u16, byte* c)
|
STATIC INLINE void c16toa(word16 u16, byte* c)
|
||||||
{
|
{
|
||||||
c[0] = (u16 >> 8) & 0xff;
|
c[0] = (u16 >> 8) & 0xff;
|
||||||
c[1] = u16 & 0xff;
|
c[1] = u16 & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* convert 32 bit integer to opaque */
|
/* convert 32 bit integer to opaque */
|
||||||
static INLINE void c32toa(word32 u32, byte* c)
|
STATIC INLINE void c32toa(word32 u32, byte* c)
|
||||||
{
|
{
|
||||||
c[0] = (u32 >> 24) & 0xff;
|
c[0] = (u32 >> 24) & 0xff;
|
||||||
c[1] = (u32 >> 16) & 0xff;
|
c[1] = (u32 >> 16) & 0xff;
|
||||||
@ -264,32 +264,32 @@ static INLINE void c32toa(word32 u32, byte* c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* convert a 24 bit integer into a 32 bit one */
|
/* convert a 24 bit integer into a 32 bit one */
|
||||||
static INLINE void c24to32(const word24 u24, word32* u32)
|
STATIC INLINE void c24to32(const word24 u24, word32* u32)
|
||||||
{
|
{
|
||||||
*u32 = (u24[0] << 16) | (u24[1] << 8) | u24[2];
|
*u32 = (u24[0] << 16) | (u24[1] << 8) | u24[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* convert opaque to 24 bit integer */
|
/* convert opaque to 24 bit integer */
|
||||||
static INLINE void ato24(const byte* c, word32* u24)
|
STATIC INLINE void ato24(const byte* c, word32* u24)
|
||||||
{
|
{
|
||||||
*u24 = (c[0] << 16) | (c[1] << 8) | c[2];
|
*u24 = (c[0] << 16) | (c[1] << 8) | c[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* convert opaque to 16 bit integer */
|
/* convert opaque to 16 bit integer */
|
||||||
static INLINE void ato16(const byte* c, word16* u16)
|
STATIC INLINE void ato16(const byte* c, word16* u16)
|
||||||
{
|
{
|
||||||
*u16 = (word16) ((c[0] << 8) | (c[1]));
|
*u16 = (word16) ((c[0] << 8) | (c[1]));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* convert opaque to 32 bit integer */
|
/* convert opaque to 32 bit integer */
|
||||||
static INLINE void ato32(const byte* c, word32* u32)
|
STATIC INLINE void ato32(const byte* c, word32* u32)
|
||||||
{
|
{
|
||||||
*u32 = (c[0] << 24) | (c[1] << 16) | (c[2] << 8) | c[3];
|
*u32 = (c[0] << 24) | (c[1] << 16) | (c[2] << 8) | c[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static INLINE word32 btoi(byte b)
|
STATIC INLINE word32 btoi(byte b)
|
||||||
{
|
{
|
||||||
return (word32)(b - 0x30);
|
return (word32)(b - 0x30);
|
||||||
}
|
}
|
||||||
|
@ -87,6 +87,7 @@ void c16toa(word16 u16, byte* c);
|
|||||||
void c32toa(word32 u32, byte* c);
|
void c32toa(word32 u32, byte* c);
|
||||||
void c24to32(const word24 u24, word32* u32);
|
void c24to32(const word24 u24, word32* u32);
|
||||||
void ato16(const byte* c, word16* u16);
|
void ato16(const byte* c, word16* u16);
|
||||||
|
void ato24(const byte* c, word32* u24);
|
||||||
void ato32(const byte* c, word32* u32);
|
void ato32(const byte* c, word32* u32);
|
||||||
word32 btoi(byte b);
|
word32 btoi(byte b);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user