diff options
author | George Hazan <ghazan@miranda.im> | 2017-12-11 21:36:29 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-12-11 21:36:29 +0300 |
commit | 617831dfc953a5bba630163c01fbeda11445ee78 (patch) | |
tree | be3eb09d61f5652989dcc134f89bab6aab70955e /plugins/CryptoPP | |
parent | e57cdb681cb10993f4bd08c594a27278af478b1a (diff) |
mir_base64_* => parameters type fix
Diffstat (limited to 'plugins/CryptoPP')
-rw-r--r-- | plugins/CryptoPP/src/base16.cpp | 6 | ||||
-rw-r--r-- | plugins/CryptoPP/src/base16.h | 6 | ||||
-rw-r--r-- | plugins/CryptoPP/src/base64.cpp | 6 | ||||
-rw-r--r-- | plugins/CryptoPP/src/cpp_keys.cpp | 2 | ||||
-rw-r--r-- | plugins/CryptoPP/src/cpp_svcs.cpp | 4 |
5 files changed, 12 insertions, 12 deletions
diff --git a/plugins/CryptoPP/src/base16.cpp b/plugins/CryptoPP/src/base16.cpp index e716b4be4f..f75ebe1d1b 100644 --- a/plugins/CryptoPP/src/base16.cpp +++ b/plugins/CryptoPP/src/base16.cpp @@ -1,6 +1,6 @@ #include "commonheaders.h"
-char *base16encode(const char *inBuffer, int count)
+char* base16encode(const char *inBuffer, size_t count)
{
char *outBuffer = (char *)malloc(count * 2 + 1);
char *outBufferPtr = outBuffer;
@@ -16,7 +16,7 @@ char *base16encode(const char *inBuffer, int count) return outBuffer;
}
-char *base16decode(const char *inBuffer, unsigned int *count)
+char* base16decode(const char *inBuffer, size_t *count)
{
char *outBuffer = (char *)mir_alloc(*count);
BYTE *outBufferPtr = (BYTE *)outBuffer;
@@ -53,6 +53,6 @@ char *base16decode(const char *inBuffer, unsigned int *count) char *base16decode(const char *inBuffer)
{
- unsigned count = (unsigned)strlen(inBuffer);
+ size_t count = strlen(inBuffer);
return base16decode(inBuffer, &count);
}
diff --git a/plugins/CryptoPP/src/base16.h b/plugins/CryptoPP/src/base16.h index 871bca3fbd..0146428abc 100644 --- a/plugins/CryptoPP/src/base16.h +++ b/plugins/CryptoPP/src/base16.h @@ -43,9 +43,9 @@ static const byte asciiToBin16[] = static const byte binToAscii16[] = "0123456789ABCDEF";
-char *base16encode(const char *, const int);
-char *base16decode(const char *, unsigned*);
-char *base16decode(const char *);
+char* base16encode(const char*, size_t);
+char* base16decode(const char*, size_t*);
+char* base16decode(const char*);
#define encode16(data) binToAscii16[data]
#define decode16(data) asciiToBin16[data]
diff --git a/plugins/CryptoPP/src/base64.cpp b/plugins/CryptoPP/src/base64.cpp index 9a855cdb8d..779e33e5b1 100644 --- a/plugins/CryptoPP/src/base64.cpp +++ b/plugins/CryptoPP/src/base64.cpp @@ -2,19 +2,19 @@ string base64encode(const string& buf)
{
- return (char*)ptrA(mir_base64_encode((PBYTE)buf.data(), (unsigned)buf.length()));
+ return (char*)ptrA(mir_base64_encode(buf.data(), buf.length()));
}
string base64decode(const string& buf)
{
- unsigned len;
+ size_t len;
ptrA plain((char*)mir_base64_decode(buf.data(), &len));
return (plain == NULL) ? string() : string(plain, len);
}
string base64decode(const char *buf)
{
- unsigned len;
+ size_t len;
ptrA plain((char*)mir_base64_decode(buf, &len));
return (plain == NULL) ? string() : string(plain, len);
}
diff --git a/plugins/CryptoPP/src/cpp_keys.cpp b/plugins/CryptoPP/src/cpp_keys.cpp index 8cfea1c040..ffcf0645a0 100644 --- a/plugins/CryptoPP/src/cpp_keys.cpp +++ b/plugins/CryptoPP/src/cpp_keys.cpp @@ -74,7 +74,7 @@ int __cdecl cpp_init_keyb(HANDLE context, LPCSTR key) pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pSIMDATA p = (pSIMDATA)cpp_alloc_pdata(ptr);
- unsigned clen = (unsigned)rtrim(key);
+ size_t clen = rtrim(key);
ptr->features = 0;
LPSTR pub_binary;
diff --git a/plugins/CryptoPP/src/cpp_svcs.cpp b/plugins/CryptoPP/src/cpp_svcs.cpp index 089d535a8f..00f8b19d8a 100644 --- a/plugins/CryptoPP/src/cpp_svcs.cpp +++ b/plugins/CryptoPP/src/cpp_svcs.cpp @@ -50,7 +50,7 @@ LPSTR __cdecl cpp_encrypt(pCNTX ptr, LPCSTR szPlainMsg) clen = (unsigned)ciphered.length();
mir_free(ptr->tmp);
if (ptr->features & FEATURES_BASE64)
- ptr->tmp = mir_base64_encode((PBYTE)ciphered.data(), clen);
+ ptr->tmp = mir_base64_encode(ciphered.data(), clen);
else {
char *base16 = base16encode(ciphered.data(), clen);
ptr->tmp = mir_strdup(base16);
@@ -70,7 +70,7 @@ LPSTR __cdecl cpp_decrypt(pCNTX ptr, LPCSTR szEncMsg) ptr->error = ERROR_SEH;
pSIMDATA p = (pSIMDATA)ptr->pdata;
- unsigned clen = (unsigned)strlen(szEncMsg);
+ size_t clen = strlen(szEncMsg);
if (ptr->features & FEATURES_BASE64)
ciphered = (LPSTR)mir_base64_decode(szEncMsg, &clen);
|