mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 01:05:40 +01:00
Fix possible portability issue
The & 0xFF should not be necessary on platforms with 8-bit chars, but one user reported having problems with his compiler on such a platform.
This commit is contained in:
parent
e89163c0a8
commit
ceedb8292e
@ -69,12 +69,12 @@ static void polarssl_zeroize( void *v, size_t n ) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PUT_UINT32_LE
|
#ifndef PUT_UINT32_LE
|
||||||
#define PUT_UINT32_LE(n,b,i) \
|
#define PUT_UINT32_LE(n,b,i) \
|
||||||
{ \
|
{ \
|
||||||
(b)[(i) ] = (unsigned char) ( (n) ); \
|
(b)[(i) ] = (unsigned char) ( ( (n) ) & 0xFF ); \
|
||||||
(b)[(i) + 1] = (unsigned char) ( (n) >> 8 ); \
|
(b)[(i) + 1] = (unsigned char) ( ( (n) >> 8 ) & 0xFF ); \
|
||||||
(b)[(i) + 2] = (unsigned char) ( (n) >> 16 ); \
|
(b)[(i) + 2] = (unsigned char) ( ( (n) >> 16 ) & 0xFF ); \
|
||||||
(b)[(i) + 3] = (unsigned char) ( (n) >> 24 ); \
|
(b)[(i) + 3] = (unsigned char) ( ( (n) >> 24 ) & 0xFF ); \
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -67,12 +67,12 @@ static void polarssl_zeroize( void *v, size_t n ) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PUT_UINT32_LE
|
#ifndef PUT_UINT32_LE
|
||||||
#define PUT_UINT32_LE(n,b,i) \
|
#define PUT_UINT32_LE(n,b,i) \
|
||||||
{ \
|
{ \
|
||||||
(b)[(i) ] = (unsigned char) ( (n) ); \
|
(b)[(i) ] = (unsigned char) ( ( (n) ) & 0xFF ); \
|
||||||
(b)[(i) + 1] = (unsigned char) ( (n) >> 8 ); \
|
(b)[(i) + 1] = (unsigned char) ( ( (n) >> 8 ) & 0xFF ); \
|
||||||
(b)[(i) + 2] = (unsigned char) ( (n) >> 16 ); \
|
(b)[(i) + 2] = (unsigned char) ( ( (n) >> 16 ) & 0xFF ); \
|
||||||
(b)[(i) + 3] = (unsigned char) ( (n) >> 24 ); \
|
(b)[(i) + 3] = (unsigned char) ( ( (n) >> 24 ) & 0xFF ); \
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -66,12 +66,12 @@ static void polarssl_zeroize( void *v, size_t n ) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PUT_UINT32_LE
|
#ifndef PUT_UINT32_LE
|
||||||
#define PUT_UINT32_LE(n,b,i) \
|
#define PUT_UINT32_LE(n,b,i) \
|
||||||
{ \
|
{ \
|
||||||
(b)[(i) ] = (unsigned char) ( (n) ); \
|
(b)[(i) ] = (unsigned char) ( ( (n) ) & 0xFF ); \
|
||||||
(b)[(i) + 1] = (unsigned char) ( (n) >> 8 ); \
|
(b)[(i) + 1] = (unsigned char) ( ( (n) >> 8 ) & 0xFF ); \
|
||||||
(b)[(i) + 2] = (unsigned char) ( (n) >> 16 ); \
|
(b)[(i) + 2] = (unsigned char) ( ( (n) >> 16 ) & 0xFF ); \
|
||||||
(b)[(i) + 3] = (unsigned char) ( (n) >> 24 ); \
|
(b)[(i) + 3] = (unsigned char) ( ( (n) >> 24 ) & 0xFF ); \
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -64,12 +64,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PUT_UINT32_LE
|
#ifndef PUT_UINT32_LE
|
||||||
#define PUT_UINT32_LE(n,b,i) \
|
#define PUT_UINT32_LE(n,b,i) \
|
||||||
{ \
|
{ \
|
||||||
(b)[(i) ] = (unsigned char) ( (n) ); \
|
(b)[(i) ] = (unsigned char) ( ( (n) ) & 0xFF ); \
|
||||||
(b)[(i) + 1] = (unsigned char) ( (n) >> 8 ); \
|
(b)[(i) + 1] = (unsigned char) ( ( (n) >> 8 ) & 0xFF ); \
|
||||||
(b)[(i) + 2] = (unsigned char) ( (n) >> 16 ); \
|
(b)[(i) + 2] = (unsigned char) ( ( (n) >> 16 ) & 0xFF ); \
|
||||||
(b)[(i) + 3] = (unsigned char) ( (n) >> 24 ); \
|
(b)[(i) + 3] = (unsigned char) ( ( (n) >> 24 ) & 0xFF ); \
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user