Permalink
Browse files

Fix uint32_t errors (VS 2013)

Thanks to Foereaper for testing.
  • Loading branch information...
1 parent a3b20b2 commit 08b22dd5bbb3a1f90d036ec99a0128041d60bb82 @Rochet2 Rochet2 committed Feb 8, 2016
Showing with 9 additions and 9 deletions.
  1. +9 −9 ElunaUtility.cpp
View
@@ -134,11 +134,11 @@ void ElunaUtil::EncodeData(const unsigned char* data, size_t input_length, std::
for (size_t i = 0, j = 0; i < input_length;)
{
- uint32_t octet_a = i < input_length ? (unsigned char)data[i++] : 0;
- uint32_t octet_b = i < input_length ? (unsigned char)data[i++] : 0;
- uint32_t octet_c = i < input_length ? (unsigned char)data[i++] : 0;
+ uint32 octet_a = i < input_length ? (unsigned char)data[i++] : 0;
+ uint32 octet_b = i < input_length ? (unsigned char)data[i++] : 0;
+ uint32 octet_c = i < input_length ? (unsigned char)data[i++] : 0;
- uint32_t triple = (octet_a << 0x10) + (octet_b << 0x08) + octet_c;
+ uint32 triple = (octet_a << 0x10) + (octet_b << 0x08) + octet_c;
buffer[j++] = encoding_table[(triple >> (3 * 6)) & 0x3F];
buffer[j++] = encoding_table[(triple >> (2 * 6)) & 0x3F];
@@ -186,12 +186,12 @@ unsigned char* ElunaUtil::DecodeData(const char *data, size_t *output_length)
for (size_t i = 0, j = 0; i < input_length;)
{
- uint32_t sextet_a = data[i] == '=' ? 0 & i++ : decoding_table[(unsigned char)data[i++]];
- uint32_t sextet_b = data[i] == '=' ? 0 & i++ : decoding_table[(unsigned char)data[i++]];
- uint32_t sextet_c = data[i] == '=' ? 0 & i++ : decoding_table[(unsigned char)data[i++]];
- uint32_t sextet_d = data[i] == '=' ? 0 & i++ : decoding_table[(unsigned char)data[i++]];
+ uint32 sextet_a = data[i] == '=' ? 0 & i++ : decoding_table[(unsigned char)data[i++]];
+ uint32 sextet_b = data[i] == '=' ? 0 & i++ : decoding_table[(unsigned char)data[i++]];
+ uint32 sextet_c = data[i] == '=' ? 0 & i++ : decoding_table[(unsigned char)data[i++]];
+ uint32 sextet_d = data[i] == '=' ? 0 & i++ : decoding_table[(unsigned char)data[i++]];
- uint32_t triple = (sextet_a << (3 * 6))
+ uint32 triple = (sextet_a << (3 * 6))
+ (sextet_b << (2 * 6))
+ (sextet_c << (1 * 6))
+ (sextet_d << (0 * 6));

0 comments on commit 08b22dd

Please sign in to comment.