Fix warning about implicit conversion
This commit is contained in:
parent
53c3d72833
commit
6a1280ba8a
|
@ -270,6 +270,7 @@ const char base64Pad = '=';
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Encodes the specified \a data to Base64.
|
* \brief Encodes the specified \a data to Base64.
|
||||||
|
* \sa [RFC 4648](http://www.ietf.org/rfc/rfc4648.txt)
|
||||||
*/
|
*/
|
||||||
string encodeBase64(const byte *data, uint32 dataSize)
|
string encodeBase64(const byte *data, uint32 dataSize)
|
||||||
{
|
{
|
||||||
|
@ -309,6 +310,7 @@ string encodeBase64(const byte *data, uint32 dataSize)
|
||||||
/*!
|
/*!
|
||||||
* \brief Decodes the specified Base64 encoded string.
|
* \brief Decodes the specified Base64 encoded string.
|
||||||
* \throw Throws a ConversionException if the specified string is no valid Base64.
|
* \throw Throws a ConversionException if the specified string is no valid Base64.
|
||||||
|
* \sa [RFC 4648](http://www.ietf.org/rfc/rfc4648.txt)
|
||||||
*/
|
*/
|
||||||
pair<unique_ptr<byte[]>, uint32> decodeBase64(const char *encodedStr, const uint32 strSize)
|
pair<unique_ptr<byte[]>, uint32> decodeBase64(const char *encodedStr, const uint32 strSize)
|
||||||
{
|
{
|
||||||
|
@ -328,7 +330,7 @@ pair<unique_ptr<byte[]>, uint32> decodeBase64(const char *encodedStr, const uint
|
||||||
auto buffer = make_unique<byte[]>(decodedSize);
|
auto buffer = make_unique<byte[]>(decodedSize);
|
||||||
auto *iter = buffer.get() - 1;
|
auto *iter = buffer.get() - 1;
|
||||||
while (encodedStr < end) {
|
while (encodedStr < end) {
|
||||||
uint32 temp = 0;
|
int32 temp = 0;
|
||||||
for (byte quantumPos = 0; quantumPos < 4; ++quantumPos, ++encodedStr) {
|
for (byte quantumPos = 0; quantumPos < 4; ++quantumPos, ++encodedStr) {
|
||||||
temp <<= 6;
|
temp <<= 6;
|
||||||
if (*encodedStr >= 'A' && *encodedStr <= 'Z') {
|
if (*encodedStr >= 'A' && *encodedStr <= 'Z') {
|
||||||
|
|
Loading…
Reference in New Issue