From 3f23417a1099f73dc28ec1b7d6ec2a1a7fc2b7a2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 18 Jun 2012 20:53:59 +0000 Subject: - PLUGININFO structure removed at all; - Options_AddPage & UserInfo_AddPage replaced MS_OPT_ADDPAGE & MS_USERINFO_ADDPAGE services respectively - total internal redesign of options' translation - code reformatting git-svn-id: http://svn.miranda-ng.org/main/trunk@477 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/helpers/gen_helpers.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'plugins/helpers') diff --git a/plugins/helpers/gen_helpers.cpp b/plugins/helpers/gen_helpers.cpp index 817f1d9f48..084be88139 100644 --- a/plugins/helpers/gen_helpers.cpp +++ b/plugins/helpers/gen_helpers.cpp @@ -272,13 +272,10 @@ TCHAR *itot(int num) { void Utf8Decode( char* str, wchar_t** ucs2 ) { - int len; - wchar_t* tempBuf; - if ( str == NULL ) return; - len = strlen( str ); + size_t len = strlen( str ); if ( len < 2 ) { if ( ucs2 != NULL ) { *ucs2 = ( wchar_t* )malloc(( len+1 )*sizeof( wchar_t )); @@ -288,7 +285,7 @@ void Utf8Decode( char* str, wchar_t** ucs2 ) return; } - tempBuf = ( wchar_t* )alloca(( len+1 )*sizeof( wchar_t )); + wchar_t* tempBuf = ( wchar_t* )alloca(( len+1 )*sizeof( wchar_t )); { wchar_t* d = tempBuf; BYTE* s = ( BYTE* )str; @@ -332,19 +329,15 @@ void Utf8Decode( char* str, wchar_t** ucs2 ) char* Utf8Encode( const char* src ) { - int len; - char* result; - wchar_t* tempBuf; - if ( src == NULL ) return NULL; - len = strlen( src ); - result = ( char* )malloc( len*3 + 1 ); + size_t len = strlen( src ); + char* result = ( char* )malloc( len*3 + 1 ); if ( result == NULL ) return NULL; - tempBuf = ( wchar_t* )alloca(( len+1 )*sizeof( wchar_t )); + wchar_t* tempBuf = ( wchar_t* )alloca(( len+1 )*sizeof( wchar_t )); MultiByteToWideChar( CP_ACP, 0, src, -1, tempBuf, len ); tempBuf[ len ] = 0; { -- cgit v1.2.3