From 617831dfc953a5bba630163c01fbeda11445ee78 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 11 Dec 2017 21:36:29 +0300 Subject: mir_base64_* => parameters type fix --- plugins/CloudFile/src/http_request.h | 2 +- plugins/CrashDumper/src/upload.cpp | 2 +- plugins/CryptoPP/src/base16.cpp | 6 +++--- plugins/CryptoPP/src/base16.h | 6 +++--- plugins/CryptoPP/src/base64.cpp | 6 +++--- plugins/CryptoPP/src/cpp_keys.cpp | 2 +- plugins/CryptoPP/src/cpp_svcs.cpp | 4 ++-- plugins/FileAsMessage/src/dialog.cpp | 2 +- plugins/GmailNotifier/src/check.cpp | 2 +- plugins/NewsAggregator/Src/Authentication.cpp | 2 +- plugins/Quotes/src/ImportExport.cpp | 2 +- plugins/SmileyAdd/src/customsmiley.cpp | 2 +- plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp | 8 ++++---- 13 files changed, 23 insertions(+), 23 deletions(-) (limited to 'plugins') diff --git a/plugins/CloudFile/src/http_request.h b/plugins/CloudFile/src/http_request.h index 39d0d98b57..aed8167b98 100644 --- a/plugins/CloudFile/src/http_request.h +++ b/plugins/CloudFile/src/http_request.h @@ -60,7 +60,7 @@ protected: szLogin, szPassword); - ptrA ePair(mir_base64_encode((BYTE*)(char*)cPair, length)); + ptrA ePair(mir_base64_encode(cPair, length)); length = mir_strlen(ePair) + 7; char *value = (char*)mir_calloc(length + 1); diff --git a/plugins/CrashDumper/src/upload.cpp b/plugins/CrashDumper/src/upload.cpp index 9b3b501b89..62baee1071 100644 --- a/plugins/CrashDumper/src/upload.cpp +++ b/plugins/CrashDumper/src/upload.cpp @@ -83,7 +83,7 @@ void CreateAuthString(char* auth) char str[110]; int len = mir_snprintf(str, "%s:%s", user, pass); - mir_snprintf(auth, 250, "Basic %s", ptrA(mir_base64_encode((PBYTE)str, len))); + mir_snprintf(auth, 250, "Basic %s", ptrA(mir_base64_encode(str, len))); } 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); diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp index 36fbd38780..f2339ba63c 100644 --- a/plugins/FileAsMessage/src/dialog.cpp +++ b/plugins/FileAsMessage/src/dialog.cpp @@ -680,7 +680,7 @@ void FILEECHO::cmdDATA(char *param) } else { - unsigned bufLen; + size_t bufLen; mir_ptr buf((BYTE*)mir_base64_decode(param, &bufLen)); memcpy(data, buf, min(bufLen, unsigned(data_end - data))); data += bufLen; diff --git a/plugins/GmailNotifier/src/check.cpp b/plugins/GmailNotifier/src/check.cpp index 6bf60cd2c7..0d642a8a42 100644 --- a/plugins/GmailNotifier/src/check.cpp +++ b/plugins/GmailNotifier/src/check.cpp @@ -98,7 +98,7 @@ void CheckMailInbox(Account *curAcc) // go! CMStringA loginPass(FORMAT, "%s:%s", curAcc->name, curAcc->pass); - ptrA loginPassEncoded(mir_base64_encode((BYTE*)loginPass.c_str(), loginPass.GetLength())); + ptrA loginPassEncoded(mir_base64_encode(loginPass.c_str(), loginPass.GetLength())); CMStringA szUrl("https://mail.google.com"), szAuth(FORMAT, "Basic %s", loginPassEncoded.get()); if (curAcc->hosted[0]) diff --git a/plugins/NewsAggregator/Src/Authentication.cpp b/plugins/NewsAggregator/Src/Authentication.cpp index 4d01851929..e53c4791a0 100644 --- a/plugins/NewsAggregator/Src/Authentication.cpp +++ b/plugins/NewsAggregator/Src/Authentication.cpp @@ -42,7 +42,7 @@ void CreateAuthString(char *auth, MCONTACT hContact, HWND hwndDlg) mir_free(tlogin); mir_free(tpass); - mir_snprintf(auth, 250, "Basic %s", ptrA(mir_base64_encode((PBYTE)str, len))); + mir_snprintf(auth, 250, "Basic %s", ptrA(mir_base64_encode(str, len))); } INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) diff --git a/plugins/Quotes/src/ImportExport.cpp b/plugins/Quotes/src/ImportExport.cpp index b2c15faa0d..6836c11520 100644 --- a/plugins/Quotes/src/ImportExport.cpp +++ b/plugins/Quotes/src/ImportExport.cpp @@ -331,7 +331,7 @@ bool handle_module(MCONTACT hContact, const IXMLNode::TXMLNodePtr& pXmlModule) mir_free(dbs.value.pwszVal); } else if (0 == mir_wstrcmpi(g_pszXmlTypeBlob, sType.c_str())) { - unsigned bufLen; + size_t bufLen; mir_ptr buf((PBYTE)mir_base64_decode(_T2A(sValue.c_str()), &bufLen)); if (buf) { dbs.value.pbVal = buf; diff --git a/plugins/SmileyAdd/src/customsmiley.cpp b/plugins/SmileyAdd/src/customsmiley.cpp index aa631e3b2e..72690198d3 100644 --- a/plugins/SmileyAdd/src/customsmiley.cpp +++ b/plugins/SmileyAdd/src/customsmiley.cpp @@ -72,7 +72,7 @@ bool SmileyCType::CreateTriggerText(char *text) int len = (int)mir_strlen(text); if (len == 0) return false; - unsigned reslen; + size_t reslen; ptrA res((char*)mir_base64_decode(text, &reslen)); if (res == NULL) return false; diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp index 1eb4404029..1dec35ecbf 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -355,7 +355,7 @@ int CExImContactXML::ExportSetting(TiXmlElement *xmlModule, LPCSTR pszModule, LP str = (LPSTR)mir_alloc(baselen + 6); assert(str != nullptr); // encode data - if ( mir_base64_encodebuf(dbv.pbVal, dbv.cpbVal, str+1, baselen)) { + if (mir_base64_encodebuf(dbv.pbVal, dbv.cpbVal, str+1, baselen)) { str[baselen+1] = 0; str[0] = 'n'; xmlValue = new TiXmlText(str); @@ -537,7 +537,7 @@ int CExImContactXML::LoadXmlElemnt(TiXmlElement *xContact) LPCSTR pUID = xContact->Attribute("uidv"); if (pUID != nullptr) { - unsigned valLen; + size_t valLen; PBYTE pbVal = nullptr; switch (*(pUID++)) { @@ -866,7 +866,7 @@ int CExImContactXML::ImportSetting(LPCSTR pszModule, TiXmlElement *xmlEntry) DBVARIANT dbv = { 0 }; // convert data - unsigned baselen; + size_t baselen; switch (value[0]) { case 'b': //'b' bVal and cVal are valid @@ -952,7 +952,7 @@ int CExImContactXML::ImportEvent(LPCSTR pszModule, TiXmlElement *xmlEvent) if (!tmp || tmp[0] == 0) return ERROR_INVALID_VALUE; - unsigned baselen; + size_t baselen; mir_ptr tmpVal((PBYTE)mir_base64_decode(tmp, &baselen)); if (tmpVal != NULL) { // event owning module -- cgit v1.2.3