summaryrefslogtreecommitdiff
path: root/plugins/FingerPrintModPlus/src/utilities.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-02 20:55:18 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-02 20:55:18 +0000
commit78c0815c4118fe24ab78cce2dc48a6232dcd824a (patch)
tree8512c50df70b8dd80c919e88ade3419207c95956 /plugins/FingerPrintModPlus/src/utilities.cpp
parentce816d83a8c75808e0eb06832592bffefe4a8dc4 (diff)
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/FingerPrintModPlus/src/utilities.cpp')
-rw-r--r--plugins/FingerPrintModPlus/src/utilities.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/plugins/FingerPrintModPlus/src/utilities.cpp b/plugins/FingerPrintModPlus/src/utilities.cpp
index 9998d056d1..35a5bf0647 100644
--- a/plugins/FingerPrintModPlus/src/utilities.cpp
+++ b/plugins/FingerPrintModPlus/src/utilities.cpp
@@ -118,7 +118,7 @@ LPSTR make_utf8_string(LPCWSTR unicode)
LPSTR out;
WORD c;
- if(!unicode) return NULL;
+ if (!unicode) return NULL;
/* first calculate the size of the target string */
c = (WORD)unicode[index++];
@@ -151,11 +151,11 @@ LPWSTR make_unicode_string_static(LPCSTR utf8, LPWSTR unicode, size_t unicode_le
while(c)
{
if(out_index + 1 >= unicode_len) break;
- if((c & 0x80) == 0)
+ if ((c & 0x80) == 0)
{
unicode[out_index++] = c;
}
- else if((c & 0xe0) == 0xe0)
+ else if ((c & 0xe0) == 0xe0)
{
unicode[out_index] = (c & 0x1F) << 12;
c = (BYTE)utf8[index++];
@@ -182,17 +182,17 @@ LPWSTR make_unicode_string(LPCSTR utf8)
LPWSTR out;
BYTE c;
- if(!utf8) return NULL;
+ if (!utf8) return NULL;
/* first calculate the size of the target string */
c = (BYTE)utf8[index++];
while(c)
{
- if((c & 0x80) == 0)
+ if ((c & 0x80) == 0)
{
index += 0;
}
- else if((c & 0xe0) == 0xe0)
+ else if ((c & 0xe0) == 0xe0)
{
index += 2;
}
@@ -216,20 +216,20 @@ int UTF8_IsValid(LPCSTR pszInput)
int nb, i;
LPCSTR c = pszInput;
- if(!pszInput) return 0;
+ if (!pszInput) return 0;
for(c = pszInput; *c; c += (nb + 1))
{
- if(!(*c & 0x80)) nb = 0;
- else if((*c & 0xc0) == 0x80) return 0;
- else if((*c & 0xe0) == 0xc0) nb = 1;
- else if((*c & 0xf0) == 0xe0) nb = 2;
+ if (!(*c & 0x80)) nb = 0;
+ else if ((*c & 0xc0) == 0x80) return 0;
+ else if ((*c & 0xe0) == 0xc0) nb = 1;
+ else if ((*c & 0xf0) == 0xe0) nb = 2;
else if ((*c & 0xf8) == 0xf0) nb = 3;
else if ((*c & 0xfc) == 0xf8) nb = 4;
else if ((*c & 0xfe) == 0xfc) nb = 5;
for(i = 1; i <= nb; i++) // we this forward, do not cross end of string
- if((*(c + i) & 0xc0) != 0x80)
+ if ((*(c + i) & 0xc0) != 0x80)
return 0;
}
@@ -241,7 +241,7 @@ int utf8_decode_static(LPCSTR from, LPSTR to, int to_size)
{
int nResult = 0;
// Validate the string
- if(!UTF8_IsValid(from))
+ if (!UTF8_IsValid(from))
return 0;
// Use the native conversion routines when available