summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
commit6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch)
tree2e8bb660c908b54914abd562af8aafa4a486c846 /plugins/Db3x_mmap/src
parenta61c8728b379057fe7f0a0d86fe0b037598229dd (diff)
less TCHARs:
- TCHAR is replaced with wchar_t everywhere; - LPGENT replaced with either LPGENW or LPGEN; - fixes for ANSI plugins that improperly used _t functions; - TCHAR *t removed from MAllStrings; - ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz* git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src')
-rw-r--r--plugins/Db3x_mmap/src/database.cpp8
-rw-r--r--plugins/Db3x_mmap/src/dbheaders.cpp8
-rw-r--r--plugins/Db3x_mmap/src/dbintf.cpp2
-rw-r--r--plugins/Db3x_mmap/src/dbintf.h10
-rw-r--r--plugins/Db3x_mmap/src/dbtool/modulechain.cpp4
-rw-r--r--plugins/Db3x_mmap/src/init.cpp8
-rw-r--r--plugins/Db3x_mmap/src/ui.cpp12
7 files changed, 26 insertions, 26 deletions
diff --git a/plugins/Db3x_mmap/src/database.cpp b/plugins/Db3x_mmap/src/database.cpp
index d5ff51a4a4..06cfcaf963 100644
--- a/plugins/Db3x_mmap/src/database.cpp
+++ b/plugins/Db3x_mmap/src/database.cpp
@@ -76,9 +76,9 @@ DWORD CDb3Mmap::ReallocSpace(DWORD ofs, int oldSize, int newSize)
/////////////////////////////////////////////////////////////////////////////////////////
static DWORD DatabaseCorrupted = 0;
-static TCHAR *msg = NULL;
+static wchar_t *msg = NULL;
static DWORD dwErr = 0;
-static TCHAR tszPanic[] = LPGENT("Miranda has detected corruption in your database. This corruption may be fixed by DbChecker plugin. Please download it from http://miranda-ng.org/p/DbChecker/. Miranda will now shut down.");
+static wchar_t tszPanic[] = LPGENW("Miranda has detected corruption in your database. This corruption may be fixed by DbChecker plugin. Please download it from http://miranda-ng.org/p/DbChecker/. Miranda will now shut down.");
void __cdecl dbpanic(void *)
{
@@ -86,7 +86,7 @@ void __cdecl dbpanic(void *)
if (dwErr == ERROR_DISK_FULL)
msg = TranslateT("Disk is full. Miranda will now shut down.");
- TCHAR err[256];
+ wchar_t err[256];
mir_sntprintf(err, msg, TranslateT("Database failure. Miranda will now shut down."), dwErr);
MessageBox(0, err, TranslateT("Database Error"), MB_SETFOREGROUND | MB_TOPMOST | MB_APPLMODAL | MB_ICONWARNING | MB_OK);
@@ -95,7 +95,7 @@ void __cdecl dbpanic(void *)
TerminateProcess(GetCurrentProcess(), 255);
}
-void CDb3Mmap::DatabaseCorruption(TCHAR *text)
+void CDb3Mmap::DatabaseCorruption(wchar_t *text)
{
int kill = 0;
diff --git a/plugins/Db3x_mmap/src/dbheaders.cpp b/plugins/Db3x_mmap/src/dbheaders.cpp
index 8662142d0d..8cd51d5a6b 100644
--- a/plugins/Db3x_mmap/src/dbheaders.cpp
+++ b/plugins/Db3x_mmap/src/dbheaders.cpp
@@ -55,8 +55,8 @@ int CDb3Mmap::CreateDbHeaders(const DBSignature& _sign)
/////////////////////////////////////////////////////////////////////////////////////////
-static TCHAR tszOldHeaders[] =
-LPGENT("This profile is too old to be updated with PluginUpdater, your database must be converted first.\n\nWould you like to read how to fix this?");
+static wchar_t tszOldHeaders[] =
+LPGENW("This profile is too old to be updated with PluginUpdater, your database must be converted first.\n\nWould you like to read how to fix this?");
int CDb3Mmap::CheckDbHeaders(bool bInteractive)
{
@@ -70,9 +70,9 @@ int CDb3Mmap::CheckDbHeaders(bool bInteractive)
if (!memcmp(&m_dbHeader.signature, &dbSignatureSD, sizeof(m_dbHeader.signature))) {
if (bInteractive)
if (IDYES == MessageBox(NULL, TranslateTS(tszOldHeaders), TranslateT("Obsolete database format"), MB_YESNO | MB_ICONWARNING)) {
- TCHAR tszCurPath[MAX_PATH];
+ wchar_t tszCurPath[MAX_PATH];
GetModuleFileName(NULL, tszCurPath, _countof(tszCurPath));
- TCHAR *p = _tcsrchr(tszCurPath, '\\');
+ wchar_t *p = wcsrchr(tszCurPath, '\\');
if (p) *p = 0;
HKEY hPathSetting;
diff --git a/plugins/Db3x_mmap/src/dbintf.cpp b/plugins/Db3x_mmap/src/dbintf.cpp
index 18735f7c44..f831b627b8 100644
--- a/plugins/Db3x_mmap/src/dbintf.cpp
+++ b/plugins/Db3x_mmap/src/dbintf.cpp
@@ -44,7 +44,7 @@ static int stringCompare2(const char *p1, const char *p2)
return mir_strcmp(p1, p2);
}
-CDb3Mmap::CDb3Mmap(const TCHAR *tszFileName, int iMode) :
+CDb3Mmap::CDb3Mmap(const wchar_t *tszFileName, int iMode) :
m_hDbFile(INVALID_HANDLE_VALUE),
m_safetyMode(true),
m_bReadOnly((iMode & DBMODE_READONLY) != 0),
diff --git a/plugins/Db3x_mmap/src/dbintf.h b/plugins/Db3x_mmap/src/dbintf.h
index 9a5b690799..dc21944426 100644
--- a/plugins/Db3x_mmap/src/dbintf.h
+++ b/plugins/Db3x_mmap/src/dbintf.h
@@ -183,7 +183,7 @@ struct DBCachedContact : public DBCachedContactBase
struct CDb3Mmap : public MIDatabase, public MIDatabaseChecker, public MZeroedObject
{
- CDb3Mmap(const TCHAR *tszFileName, int mode);
+ CDb3Mmap(const wchar_t *tszFileName, int mode);
~CDb3Mmap();
int Load(bool bSkipInit);
@@ -193,14 +193,14 @@ struct CDb3Mmap : public MIDatabase, public MIDatabaseChecker, public MZeroedObj
void ToggleEncryption(void);
void StoreKey(void);
- void SetPassword(const TCHAR *ptszPassword);
+ void SetPassword(const wchar_t *ptszPassword);
void UpdateMenuItem(void);
int PrepareCheck(int*);
- __forceinline LPTSTR GetMenuTitle() const { return m_bUsesPassword ? LPGENT("Change/remove password") : LPGENT("Set password"); }
+ __forceinline LPTSTR GetMenuTitle() const { return m_bUsesPassword ? LPGENW("Change/remove password") : LPGENW("Set password"); }
- void DatabaseCorruption(TCHAR *text);
+ void DatabaseCorruption(wchar_t *text);
void WriteSignature(DBSignature&);
__forceinline HANDLE getFile() const { return m_hDbFile; }
@@ -282,7 +282,7 @@ public: // Check functions
int WorkFinalTasks(int);
protected:
- TCHAR* m_tszProfileName;
+ wchar_t* m_tszProfileName;
HANDLE m_hDbFile;
DBHeader m_dbHeader;
DWORD m_ChunkSize;
diff --git a/plugins/Db3x_mmap/src/dbtool/modulechain.cpp b/plugins/Db3x_mmap/src/dbtool/modulechain.cpp
index cdfc9b3cc9..16ff76df78 100644
--- a/plugins/Db3x_mmap/src/dbtool/modulechain.cpp
+++ b/plugins/Db3x_mmap/src/dbtool/modulechain.cpp
@@ -96,9 +96,9 @@ int CDb3Mmap::WorkModuleChain(int firstTime)
n++;
}
if (n) {
- TCHAR szModuleName[257];
+ wchar_t szModuleName[257];
MultiByteToWideChar(CP_ACP, 0, modChain[iCurrentModName].name, -1, szModuleName, _countof(szModuleName));
- TCHAR *pszModuleName = szModuleName;
+ wchar_t *pszModuleName = szModuleName;
cb->pfnAddLogMessage(STATUS_WARNING, TranslateT("Module name '%s' is not unique: %d duplicates found"), pszModuleName, n);
}
diff --git a/plugins/Db3x_mmap/src/init.cpp b/plugins/Db3x_mmap/src/init.cpp
index ad2b9130aa..1480ad214a 100644
--- a/plugins/Db3x_mmap/src/init.cpp
+++ b/plugins/Db3x_mmap/src/init.cpp
@@ -47,7 +47,7 @@ LIST<CDb3Mmap> g_Dbs(1, HandleKeySortT);
/////////////////////////////////////////////////////////////////////////////////////////
// returns 0 if the profile is created, EMKPRF*
-static int makeDatabase(const TCHAR *profile)
+static int makeDatabase(const wchar_t *profile)
{
std::auto_ptr<CDb3Mmap> db(new CDb3Mmap(profile, 0));
if (db->Create() != ERROR_SUCCESS)
@@ -57,7 +57,7 @@ static int makeDatabase(const TCHAR *profile)
}
// returns 0 if the given profile has a valid header
-static int grokHeader(const TCHAR *profile)
+static int grokHeader(const wchar_t *profile)
{
std::auto_ptr<CDb3Mmap> db(new CDb3Mmap(profile, DBMODE_SHARED | DBMODE_READONLY));
if (db->Load(true) != ERROR_SUCCESS)
@@ -67,7 +67,7 @@ static int grokHeader(const TCHAR *profile)
}
// returns 0 if all the APIs are injected otherwise, 1
-static MIDatabase* LoadDatabase(const TCHAR *profile, BOOL bReadOnly)
+static MIDatabase* LoadDatabase(const wchar_t *profile, BOOL bReadOnly)
{
// set the memory, lists & UTF8 manager
mir_getLP(&pluginInfo);
@@ -87,7 +87,7 @@ static int UnloadDatabase(MIDatabase *db)
return 0;
}
-MIDatabaseChecker* CheckDb(const TCHAR *profile, int *error)
+MIDatabaseChecker* CheckDb(const wchar_t *profile, int *error)
{
std::auto_ptr<CDb3Mmap> db(new CDb3Mmap(profile, DBMODE_READONLY));
if (db->Load(true) != ERROR_SUCCESS) {
diff --git a/plugins/Db3x_mmap/src/ui.cpp b/plugins/Db3x_mmap/src/ui.cpp
index e29e8f0ec2..36896352e4 100644
--- a/plugins/Db3x_mmap/src/ui.cpp
+++ b/plugins/Db3x_mmap/src/ui.cpp
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct DlgChangePassParam
{
CDb3Mmap *db;
- TCHAR newPass[100];
+ wchar_t newPass[100];
int wrongPass;
};
@@ -141,7 +141,7 @@ bool CDb3Mmap::EnterPassword(const BYTE *pKey, const size_t keyLen)
static bool CheckOldPassword(HWND hwndDlg, CDb3Mmap *db)
{
if (db->usesPassword()) {
- TCHAR buf[100];
+ wchar_t buf[100];
GetDlgItemText(hwndDlg, IDC_OLDPASS, buf, _countof(buf));
if (!db->m_crypto->checkPassword(T2Utf(buf))) {
SetDlgItemText(hwndDlg, IDC_HEADERBAR, TranslateT("Wrong old password entered!"));
@@ -154,7 +154,7 @@ static bool CheckOldPassword(HWND hwndDlg, CDb3Mmap *db)
static INT_PTR CALLBACK sttChangePassword(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
DlgChangePassParam *param = (DlgChangePassParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- TCHAR buf[100];
+ wchar_t buf[100];
switch (uMsg) {
case WM_INITDIALOG:
@@ -199,7 +199,7 @@ static INT_PTR CALLBACK sttChangePassword(HWND hwndDlg, UINT uMsg, WPARAM wParam
break;
case IDOK:
- TCHAR buf2[100];
+ wchar_t buf2[100];
GetDlgItemText(hwndDlg, IDC_USERPASS1, buf2, _countof(buf2));
if (mir_tstrlen(buf2) < 3) {
SetDlgItemText(hwndDlg, IDC_HEADERBAR, TranslateT("Password is too short!"));
@@ -313,13 +313,13 @@ static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM)
CMenuItem mi;
// main menu item
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Database"), 500000000, iconList[0].hIcolib);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Database"), 500000000, iconList[0].hIcolib);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "F7C5567C-D1EE-484B-B4F6-24677A5AAAEF");
SET_UID(mi, 0x50321866, 0xba1, 0x46dd, 0xb3, 0xa6, 0xc3, 0xcc, 0x55, 0xf2, 0x42, 0x9e);
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = iconList[1].hIcolib;
- mi.name.t = db->GetMenuTitle();
+ mi.name.w = db->GetMenuTitle();
mi.pszService = MS_DB_CHANGEPASSWORD;
hSetPwdMenu = Menu_AddMainMenuItem(&mi);
return 0;