summaryrefslogtreecommitdiff
path: root/plugins/CryptoPP
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-03 21:47:03 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-03 21:47:03 +0000
commite412759d7e551e3fc4dc4be6e1fae1cd4f308868 (patch)
tree00ed12238ba8b3735ddf95cf9e79c48d7c411c78 /plugins/CryptoPP
parent0f95cbb4a9f1c9a613dccb9d53f5ddb50a8cadd7 (diff)
no more PLUGININFOEX::replacesDefaultModule, that old & nasty clutch
since now all Myranda plugins are binary incompatible with Miranda's git-svn-id: http://svn.miranda-ng.org/main/trunk@743 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CryptoPP')
-rw-r--r--plugins/CryptoPP/base16.cpp8
-rw-r--r--plugins/CryptoPP/base16.h2
-rw-r--r--plugins/CryptoPP/base64.cpp11
-rw-r--r--plugins/CryptoPP/base64.h2
-rw-r--r--plugins/CryptoPP/commonheaders.cpp6
-rw-r--r--plugins/CryptoPP/commonheaders.h2
-rw-r--r--plugins/CryptoPP/cpp_gpgw.cpp4
-rw-r--r--plugins/CryptoPP/cpp_gzip.cpp4
-rw-r--r--plugins/CryptoPP/cpp_keys.cpp2
-rw-r--r--plugins/CryptoPP/cpp_pgpw.cpp2
-rw-r--r--plugins/CryptoPP/cpp_rsau.h2
-rw-r--r--plugins/CryptoPP/cpp_svcs.cpp5
-rw-r--r--plugins/CryptoPP/cryptopp.h4
13 files changed, 27 insertions, 27 deletions
diff --git a/plugins/CryptoPP/base16.cpp b/plugins/CryptoPP/base16.cpp
index 110eea0a9c..ace113ff76 100644
--- a/plugins/CryptoPP/base16.cpp
+++ b/plugins/CryptoPP/base16.cpp
@@ -18,7 +18,7 @@ char *base16encode(const char *inBuffer, int count) {
}
-char *base16decode(const char *inBuffer, int *count) {
+char *base16decode(const char *inBuffer, size_t *count) {
char *outBuffer = (char *) malloc(*count);
BYTE *outBufferPtr = (BYTE *) outBuffer;
@@ -54,9 +54,9 @@ char *base16decode(const char *inBuffer, int *count) {
}
-char *base16decode(const char *inBuffer) {
-
- int count = (int)strlen(inBuffer);
+char *base16decode(const char *inBuffer)
+{
+ size_t count = strlen(inBuffer);
return base16decode(inBuffer, &count);
}
diff --git a/plugins/CryptoPP/base16.h b/plugins/CryptoPP/base16.h
index f5f368ebaa..2a2c18c42a 100644
--- a/plugins/CryptoPP/base16.h
+++ b/plugins/CryptoPP/base16.h
@@ -44,7 +44,7 @@ static const byte asciiToBin16[] =
static const byte binToAscii16[] = "0123456789ABCDEF";
char *base16encode(const char *, const int);
-char *base16decode(const char *, int *);
+char *base16decode(const char *, size_t *);
char *base16decode(const char *);
#define encode16(data) binToAscii16[data]
diff --git a/plugins/CryptoPP/base64.cpp b/plugins/CryptoPP/base64.cpp
index 1a752bc507..7495dd234f 100644
--- a/plugins/CryptoPP/base64.cpp
+++ b/plugins/CryptoPP/base64.cpp
@@ -1,7 +1,8 @@
#include "commonheaders.h"
-string base64encode(const string buf) {
+string base64encode(const string buf)
+{
string out;
char *base64 = base64encode(buf.data(), buf.length());
out.assign(base64);
@@ -42,7 +43,7 @@ char *base64encode(const char *inBuffer, const int count) {
string base64decode(const string buf) {
string out;
- int len = buf.length();
+ size_t len = buf.length();
char *plain = base64decode(buf.data(), &len);
out.assign(plain,len);
free(plain);
@@ -52,7 +53,7 @@ string base64decode(const string buf) {
string base64decode(const char *buf) {
string out;
- int len = strlen(buf);
+ size_t len = strlen(buf);
char *plain = base64decode(buf, &len);
out.assign(plain,len);
free(plain);
@@ -60,14 +61,14 @@ string base64decode(const char *buf) {
}
-char *base64decode(const char *inBuffer, int *count) {
+char *base64decode(const char *inBuffer, size_t *count) {
int srcIndex = 0, destIndex = 0;
char *outBuffer = (char *) malloc(*count);
while(srcIndex < *count) {
BYTE c0, c1, c2 = 0, c3 = 0;
- const int delta = *count - srcIndex;
+ const size_t delta = *count - srcIndex;
c0 = decode64(inBuffer[srcIndex++]);
c1 = decode64(inBuffer[srcIndex++]);
if (delta > 2) {
diff --git a/plugins/CryptoPP/base64.h b/plugins/CryptoPP/base64.h
index b0756276a3..1024ecbbd7 100644
--- a/plugins/CryptoPP/base64.h
+++ b/plugins/CryptoPP/base64.h
@@ -45,7 +45,7 @@ static const byte asciiToBin64[] =
static const byte binToAscii64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
char *base64encode(const char *, const int);
-char *base64decode(const char *, int *);
+char *base64decode(const char *, size_t *);
string base64encode(const string);
string base64decode(const string);
diff --git a/plugins/CryptoPP/commonheaders.cpp b/plugins/CryptoPP/commonheaders.cpp
index 426b7ada54..395da89d5f 100644
--- a/plugins/CryptoPP/commonheaders.cpp
+++ b/plugins/CryptoPP/commonheaders.cpp
@@ -24,7 +24,7 @@ PLUGININFOEX pluginInfoEx = {
"baloo@bk.ru",
"© 2006-09 Baloo",
"http://miranda-im.org/download/details.php?action=viewfile&id=2669",
- 0, 0,
+ 0,
MIID_CRYPTOPP
};
@@ -58,8 +58,8 @@ void ExtractFile( char *FileName, int ResType, int ResId )
}
-int rtrim(LPCSTR str) {
- int len = strlen(str);
+size_t rtrim(LPCSTR str) {
+ size_t len = strlen(str);
LPSTR ptr = (LPSTR)str+len-1;
while( len ) {
diff --git a/plugins/CryptoPP/commonheaders.h b/plugins/CryptoPP/commonheaders.h
index 5e2215ea3c..fee4216694 100644
--- a/plugins/CryptoPP/commonheaders.h
+++ b/plugins/CryptoPP/commonheaders.h
@@ -89,7 +89,7 @@ extern CRITICAL_SECTION localQueueMutex;
extern CRITICAL_SECTION localContextMutex;
void ExtractFile(char*,int,int);
-int rtrim(LPCSTR);
+size_t rtrim(LPCSTR);
#if defined(_DEBUG) || defined(NETLIB_LOG)
extern HANDLE hNetlibUser;
diff --git a/plugins/CryptoPP/cpp_gpgw.cpp b/plugins/CryptoPP/cpp_gpgw.cpp
index 5107b27ac7..0ef3d77626 100644
--- a/plugins/CryptoPP/cpp_gpgw.cpp
+++ b/plugins/CryptoPP/cpp_gpgw.cpp
@@ -240,7 +240,7 @@ LPSTR __cdecl gpg_encode(HANDLE context, LPCSTR szPlainMsg)
LPSTR szUtfMsg;
if ( ptr->mode & MODE_GPG_ANSI ) {
LPWSTR wszMsg = utf8decode(szPlainMsg);
- int wlen = wcslen(wszMsg)+1;
+ size_t wlen = wcslen(wszMsg)+1;
szUtfMsg = (LPSTR) alloca(wlen);
WideCharToMultiByte(CP_ACP, 0, wszMsg, -1, szUtfMsg, wlen, 0, 0);
}
@@ -261,7 +261,7 @@ LPSTR __cdecl gpg_decode(HANDLE context, LPCSTR szEncMsg)
if (szOldMsg) {
if ( !is_7bit_string(szOldMsg) && !is_utf8_string(szOldMsg) ) {
- int slen = strlen(szOldMsg)+1;
+ size_t slen = strlen(szOldMsg)+1;
LPWSTR wszMsg = (LPWSTR) alloca(slen*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, szOldMsg, -1, wszMsg, slen*sizeof(WCHAR));
szNewMsg = _strdup(utf8encode(wszMsg));
diff --git a/plugins/CryptoPP/cpp_gzip.cpp b/plugins/CryptoPP/cpp_gzip.cpp
index c819779677..36a4ae7e20 100644
--- a/plugins/CryptoPP/cpp_gzip.cpp
+++ b/plugins/CryptoPP/cpp_gzip.cpp
@@ -1,7 +1,7 @@
#include "commonheaders.h"
// gzip data
-BYTE *cpp_gzip(BYTE *pData, int nLen, int& nCompressedLen) {
+BYTE *cpp_gzip(BYTE *pData, size_t nLen, size_t& nCompressedLen) {
string zipped;
Gzip gzip(new StringSink(zipped),5); // 1 is fast, 9 is slow
@@ -16,7 +16,7 @@ BYTE *cpp_gzip(BYTE *pData, int nLen, int& nCompressedLen) {
}
// gunzip data
-BYTE *cpp_gunzip(BYTE *pCompressedData, int nCompressedLen, int& nLen) {
+BYTE *cpp_gunzip(BYTE *pCompressedData, size_t nCompressedLen, size_t& nLen) {
string unzipped;
Gunzip gunzip(new StringSink(unzipped));
diff --git a/plugins/CryptoPP/cpp_keys.cpp b/plugins/CryptoPP/cpp_keys.cpp
index b21da13ada..b216eb6a2f 100644
--- a/plugins/CryptoPP/cpp_keys.cpp
+++ b/plugins/CryptoPP/cpp_keys.cpp
@@ -73,7 +73,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);
- int clen = rtrim(key);
+ size_t clen = rtrim(key);
ptr->features = 0;
LPSTR pub_binary;
diff --git a/plugins/CryptoPP/cpp_pgpw.cpp b/plugins/CryptoPP/cpp_pgpw.cpp
index a42e84c366..8633690009 100644
--- a/plugins/CryptoPP/cpp_pgpw.cpp
+++ b/plugins/CryptoPP/cpp_pgpw.cpp
@@ -258,7 +258,7 @@ LPSTR __cdecl pgp_decode(HANDLE context, LPCSTR szEncMsg)
if (szOldMsg) {
if ( !is_7bit_string(szOldMsg) && !is_utf8_string(szOldMsg) ) {
- int slen = strlen(szOldMsg)+1;
+ size_t slen = strlen(szOldMsg)+1;
LPWSTR wszMsg = (LPWSTR) alloca(slen*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, szOldMsg, -1, wszMsg, slen*sizeof(WCHAR));
szNewMsg = _strdup(utf8encode(wszMsg));
diff --git a/plugins/CryptoPP/cpp_rsau.h b/plugins/CryptoPP/cpp_rsau.h
index 0e30629079..bc45a248c5 100644
--- a/plugins/CryptoPP/cpp_rsau.h
+++ b/plugins/CryptoPP/cpp_rsau.h
@@ -30,7 +30,7 @@ public:
}
};
- u_int count() { return data.size(); };
+ size_t count() { return data.size(); };
bool exist(u_char t) { return (data.find(t) != data.end()); };
string get(u_char t) { return data[t]; };
void put(u_char t, string& v) { data[t]=v; };
diff --git a/plugins/CryptoPP/cpp_svcs.cpp b/plugins/CryptoPP/cpp_svcs.cpp
index 2b99003a2a..e2a1dd9053 100644
--- a/plugins/CryptoPP/cpp_svcs.cpp
+++ b/plugins/CryptoPP/cpp_svcs.cpp
@@ -10,8 +10,7 @@ LPSTR __cdecl cpp_encrypt(pCNTX ptr, LPCSTR szPlainMsg)
pSIMDATA p = (pSIMDATA) ptr->pdata;
BYTE dataflag = 0;
- int clen,slen;
- slen = strlen(szPlainMsg);
+ size_t clen, slen = strlen(szPlainMsg);
LPSTR szMsg;
if (ptr->features & FEATURES_GZIP) {
@@ -69,7 +68,7 @@ LPSTR __cdecl cpp_decrypt(pCNTX ptr, LPCSTR szEncMsg)
ptr->error = ERROR_SEH;
pSIMDATA p = (pSIMDATA) ptr->pdata;
- int clen = strlen(szEncMsg);
+ size_t clen = strlen(szEncMsg);
if (ptr->features & FEATURES_BASE64)
ciphered = base64decode(szEncMsg,&clen);
diff --git a/plugins/CryptoPP/cryptopp.h b/plugins/CryptoPP/cryptopp.h
index 8648d7ba31..b2d3867f2c 100644
--- a/plugins/CryptoPP/cryptopp.h
+++ b/plugins/CryptoPP/cryptopp.h
@@ -168,8 +168,8 @@ extern HINSTANCE g_hInst;
pCNTX get_context_on_id(int);
pCNTX get_context_on_id(HANDLE);
void cpp_free_keys(pCNTX);
-BYTE *cpp_gzip(BYTE*,int,int&);
-BYTE *cpp_gunzip(BYTE*,int,int&);
+BYTE *cpp_gzip(BYTE*,size_t,size_t&);
+BYTE *cpp_gunzip(BYTE*,size_t,size_t&);
string cpp_zlibc(string&);
string cpp_zlibd(string&);