summaryrefslogtreecommitdiff
path: root/plugins/CryptoPP/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-08-11 13:52:01 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-08-11 13:52:01 +0000
commita15cd68f0412e1b211e746a2e4d5682e96f5a113 (patch)
treed09d41832621cfc07957dbbcd60077fdf96b7e66 /plugins/CryptoPP/src
parent85bd008c039eb1d93894e94fba9d158a42a71a12 (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@14911 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CryptoPP/src')
-rw-r--r--plugins/CryptoPP/src/GPGw/gpg_main.cpp10
-rw-r--r--plugins/CryptoPP/src/cpp_rsau.cpp6
-rw-r--r--plugins/CryptoPP/src/cpp_rsau.h6
-rw-r--r--plugins/CryptoPP/src/utf8.cpp4
4 files changed, 12 insertions, 14 deletions
diff --git a/plugins/CryptoPP/src/GPGw/gpg_main.cpp b/plugins/CryptoPP/src/GPGw/gpg_main.cpp
index fc544ffa52..5bbbc9f5e3 100644
--- a/plugins/CryptoPP/src/GPGw/gpg_main.cpp
+++ b/plugins/CryptoPP/src/GPGw/gpg_main.cpp
@@ -163,7 +163,6 @@ LPSTR __cdecl _gpg_encrypt(LPCSTR message, LPCSTR keyid)
{
char buffer[ciphertextsize];
char *encmessage = 0;
- int encmessagelen;
gpgResult gpgresult;
if(strlen(keyid))
@@ -174,7 +173,7 @@ LPSTR __cdecl _gpg_encrypt(LPCSTR message, LPCSTR keyid)
if(gpgresult!=gpgSuccess)
return 0;
- encmessagelen = strlen(buffer)+1;
+ size_t encmessagelen = strlen(buffer)+1;
encmessage = (char *) LocalAlloc(LPTR,encmessagelen);
memcpy(encmessage, buffer, encmessagelen);
}
@@ -192,7 +191,6 @@ LPSTR __cdecl _gpg_decrypt(LPCSTR message)
char *storedpassphrase;
char passphrase[passphrasesize];
char *decmessage = 0;
- int decmessagelen;
gpgResult gpgresult;
const char *begin = strstr(message, txtbeginpgpmessage);
@@ -254,7 +252,7 @@ LPSTR __cdecl _gpg_decrypt(LPCSTR message)
memset(passphrase, 0, sizeof(passphrase));
- decmessagelen = strlen(buffer)+1;
+ size_t decmessagelen = strlen(buffer)+1;
decmessage = (char *) LocalAlloc(LPTR,decmessagelen);
memcpy(decmessage, buffer, decmessagelen);
}
@@ -356,7 +354,6 @@ BOOL ShowSelectExecDlg(LPSTR path)
BOOL ShowSelectHomeDlg(LPSTR path)
{
- int i;
OPENFILENAME ofn;
ofn.lpstrFile = GetEnvValue("GNUPGHOME");
@@ -387,7 +384,8 @@ BOOL ShowSelectHomeDlg(LPSTR path)
ofn.lpstrTitle = "Open Public Keyring";
if (!GetOpenFileName(&ofn)) return FALSE;
- for(i=strlen(path);i && path[i]!='\\';i--);
+ int i;
+ for(i = (int)strlen(path);i && path[i]!='\\';i--);
path[i] = 0;
return TRUE;
diff --git a/plugins/CryptoPP/src/cpp_rsau.cpp b/plugins/CryptoPP/src/cpp_rsau.cpp
index b0913219fa..b2bc42d302 100644
--- a/plugins/CryptoPP/src/cpp_rsau.cpp
+++ b/plugins/CryptoPP/src/cpp_rsau.cpp
@@ -111,7 +111,7 @@ string hash(string& b)
return ::hash((PBYTE)b.data(), b.length());
}
-string hash(PBYTE b, int l)
+string hash(PBYTE b, size_t l)
{
BYTE h[RSA_KEYSIZE];
RSA_CalculateDigest(h, b, l);
@@ -129,7 +129,7 @@ string hash128(LPSTR b)
return hash128((PBYTE)b, strlen(b));
}
-string hash128(PBYTE b, int l)
+string hash128(PBYTE b, size_t l)
{
BYTE h[RIPEMD128::DIGESTSIZE];
RIPEMD128().CalculateDigest(h, b, l);
@@ -147,7 +147,7 @@ string hash256(LPSTR b)
return hash256((PBYTE)b, strlen(b));
}
-string hash256(PBYTE b, int l)
+string hash256(PBYTE b, size_t l)
{
BYTE h[RIPEMD256::DIGESTSIZE];
RIPEMD256().CalculateDigest(h, b, l);
diff --git a/plugins/CryptoPP/src/cpp_rsau.h b/plugins/CryptoPP/src/cpp_rsau.h
index bc45a248c5..38ba656f9d 100644
--- a/plugins/CryptoPP/src/cpp_rsau.h
+++ b/plugins/CryptoPP/src/cpp_rsau.h
@@ -77,15 +77,15 @@ string& un_tlv(string&,int&,int&);
int str2int(string&);
string hash(string&);
-string hash(PBYTE,int);
+string hash(PBYTE, size_t);
string hash128(string&);
string hash128(LPSTR);
-string hash128(PBYTE,int);
+string hash128(PBYTE, size_t);
string hash256(string&);
string hash256(LPSTR);
-string hash256(PBYTE,int);
+string hash256(PBYTE, size_t);
Integer BinaryToInteger(const string&);
string IntegerToBinary(const Integer&);
diff --git a/plugins/CryptoPP/src/utf8.cpp b/plugins/CryptoPP/src/utf8.cpp
index e6b9602161..77c13fa3bc 100644
--- a/plugins/CryptoPP/src/utf8.cpp
+++ b/plugins/CryptoPP/src/utf8.cpp
@@ -45,13 +45,13 @@ LPSTR __cdecl utf8encode(LPCWSTR str)
LPWSTR __cdecl utf8decode(LPCSTR str)
{
- int i, len;
+ int i;
LPSTR p;
// LPWSTR wszOut;
if (str == NULL) return NULL;
- len = strlen(str) + 1;
+ size_t len = strlen(str) + 1;
SAFE_FREE(wszOut);
if ((wszOut = (LPWSTR)malloc(len*sizeof(WCHAR))) == NULL)