1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-20 10:37:24 -07:00

Avoid pointer casting when using Emscripten

This commit is contained in:
Frank Denis 2015-11-26 17:07:57 +01:00
parent a5b4926a19
commit a2540cb103

View File

@ -170,7 +170,7 @@ void
sodium_increment(unsigned char *n, const size_t nlen) sodium_increment(unsigned char *n, const size_t nlen)
{ {
size_t i = 0U; size_t i = 0U;
#if !defined(CPU_UNALIGNED_ACCESS) || !defined(NATIVE_LITTLE_ENDIAN) #if !defined(CPU_UNALIGNED_ACCESS) || !defined(NATIVE_LITTLE_ENDIAN) || defined(__EMSCRIPTEN__)
uint_fast16_t c = 1U; uint_fast16_t c = 1U;
#else #else
uint_fast64_t c = 1U; uint_fast64_t c = 1U;
@ -191,7 +191,7 @@ void
sodium_add(unsigned char *a, const unsigned char *b, const size_t len) sodium_add(unsigned char *a, const unsigned char *b, const size_t len)
{ {
size_t i = 0U; size_t i = 0U;
#if !defined(CPU_UNALIGNED_ACCESS) || !defined(NATIVE_LITTLE_ENDIAN) #if !defined(CPU_UNALIGNED_ACCESS) || !defined(NATIVE_LITTLE_ENDIAN) || defined(__EMSCRIPTEN__)
uint_fast16_t c = 0U; uint_fast16_t c = 0U;
#else #else
uint_fast64_t c = 0U; uint_fast64_t c = 0U;