Bitwise operations promote the cast to uint16_t to int. So to be consistent, first cast to uint to keep unsignedness and prevent implicit promotion. Then cast back to uint16_t after all bitwise operations are completed.
This prevents compiler warnings, unneccessary casts and in the case of right shifting (not the case here) unexpected behaviour.
This patch makes the BLAKE2 reference implementation compatible with C89
compilers and MSVC.
1) Use C comments (/* */) instead of C++ comments.
2) No declarations after statements. All variables are declared on the
top of a block.
3) Optional inline with BLAKE2_LOCAL_INLINE() macro.
Signed-off-by: Christian Heimes <christian@python.org>