diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-15 14:13:45 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-15 14:13:45 +0000 |
commit | 4aa6229698b946e52ce19018aaf13f8b92fb168e (patch) | |
tree | 29334e8c5ee492a80f11a97fedab2373b8fbb392 /src/modules/database/dbutils.cpp | |
parent | 5e8e561a80d1ac9ca1c2f1c3d388105733ed4e4e (diff) |
another portion of "#ifsef Unicode" removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@426 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/database/dbutils.cpp')
-rw-r--r-- | src/modules/database/dbutils.cpp | 49 |
1 files changed, 14 insertions, 35 deletions
diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp index cd4168884d..6cad16035b 100644 --- a/src/modules/database/dbutils.cpp +++ b/src/modules/database/dbutils.cpp @@ -206,17 +206,10 @@ static INT_PTR DbEventGetStringT( WPARAM wParam, LPARAM lParam ) DBEVENTINFO* dbei = ( DBEVENTINFO* )wParam;
char* string = ( char* )lParam;
- #if defined( _UNICODE )
- if ( dbei->flags & DBEF_UTF )
- return ( INT_PTR )Utf8DecodeUcs2( string );
-
- return ( INT_PTR )mir_a2t( string );
- #else
- char* res = mir_strdup( string );
- if ( dbei->flags & DBEF_UTF )
- Utf8Decode( res, NULL );
- return ( INT_PTR )res;
- #endif
+ if ( dbei->flags & DBEF_UTF )
+ return ( INT_PTR )Utf8DecodeUcs2( string );
+
+ return ( INT_PTR )mir_a2t( string );
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -253,14 +246,10 @@ static INT_PTR GetProfilePath(WPARAM wParam, LPARAM lParam) char* dst = (char*)lParam;
- #if defined( _UNICODE )
- char* tmp = mir_t2a( g_profileDir );
- strncpy( dst, tmp, wParam );
- mir_free( tmp );
- #else
- strncpy( dst, g_profileDir, wParam );
- #endif
-
+ char* tmp = mir_t2a( g_profileDir );
+ strncpy( dst, tmp, wParam );
+ mir_free( tmp );
+
if (wParam <= _tcslen(g_profileName))
{
dst[wParam - 1] = 0;
@@ -276,14 +265,10 @@ static INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam) char* dst = (char*)lParam;
- #if defined( _UNICODE )
- char* tmp = makeFileName( g_profileName );
- strncpy( dst, tmp, wParam );
- mir_free( tmp );
- #else
- strncpy( dst, g_profileName, wParam );
- #endif
-
+ char* tmp = makeFileName( g_profileName );
+ strncpy( dst, tmp, wParam );
+ mir_free( tmp );
+
if (wParam <= _tcslen(g_profileName))
{
dst[wParam - 1] = 0;
@@ -292,8 +277,6 @@ static INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam) return 0;
}
-#if defined( _UNICODE )
-
static INT_PTR GetProfilePathW(WPARAM wParam, LPARAM lParam)
{
if (!wParam || !lParam)
@@ -321,8 +304,6 @@ static INT_PTR GetProfileNameW(WPARAM wParam, LPARAM lParam) return 0;
}
-#endif
-
/////////////////////////////////////////////////////////////////////////////////////////
int InitUtils()
@@ -339,10 +320,8 @@ int InitUtils() CreateServiceFunction(MS_DB_GETPROFILEPATH, GetProfilePath);
CreateServiceFunction(MS_DB_GETPROFILENAME, GetProfileName);
- #if defined( _UNICODE )
- CreateServiceFunction(MS_DB_GETPROFILEPATHW, GetProfilePathW);
- CreateServiceFunction(MS_DB_GETPROFILENAMEW, GetProfileNameW);
- #endif
+ CreateServiceFunction(MS_DB_GETPROFILEPATHW, GetProfilePathW);
+ CreateServiceFunction(MS_DB_GETPROFILENAMEW, GetProfileNameW);
return 0;
}
|