summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-27 14:23:31 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-27 14:23:31 +0000
commit2f261839b60692e33d0e160344d0d636d49c90ba (patch)
tree187921722698b681d29df3f6e60fb18394a5e9d5 /utils
parent2e931a0b2780587d85f3902468c935f5adba70c8 (diff)
less TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'utils')
-rw-r--r--utils/mir_buffer.h2
-rw-r--r--utils/mir_fonts.cpp18
-rw-r--r--utils/mir_options.cpp22
-rw-r--r--utils/mir_smileys.cpp2
4 files changed, 22 insertions, 22 deletions
diff --git a/utils/mir_buffer.h b/utils/mir_buffer.h
index 25ea5a0516..3adc17fd4c 100644
--- a/utils/mir_buffer.h
+++ b/utils/mir_buffer.h
@@ -471,7 +471,7 @@ static void ReplaceVars(Buffer<wchar_t> *buffer, MCONTACT hContact, wchar_t **va
{
for(int k = 0; k < numVariables; k += 2)
{
- size_t len = mir_tstrlen(variables[k]);
+ size_t len = mir_wstrlen(variables[k]);
if (foundLen == len + 2 && wcsncmp(&buffer->str[j]+1, variables[k], len) == 0)
{
buffer->replace(j, i + 1, variables[k + 1]);
diff --git a/utils/mir_fonts.cpp b/utils/mir_fonts.cpp
index 410f936fa3..cb0dba3571 100644
--- a/utils/mir_fonts.cpp
+++ b/utils/mir_fonts.cpp
@@ -12,10 +12,10 @@ int FontService_RegisterFont(const char *pszDbModule, const char *pszDbName, con
fid.cbSize = sizeof(fid);
mir_strncpy(fid.dbSettingsGroup, pszDbModule, sizeof(fid.dbSettingsGroup)); /* buffer safe */
mir_strncpy(fid.prefix, pszDbName, sizeof(fid.prefix)); /* buffer safe */
- mir_tstrncpy(fid.group, pszSection, _countof(fid.group)); /* buffer safe */
- mir_tstrncpy(fid.name, pszDescription, _countof(fid.name)); /* buffer safe */
- mir_tstrncpy(fid.backgroundGroup, pszBackgroundGroup, _countof(fid.backgroundGroup)); /* buffer safe */
- mir_tstrncpy(fid.backgroundName, pszBackgroundName, _countof(fid.backgroundName)); /* buffer safe */
+ mir_wstrncpy(fid.group, pszSection, _countof(fid.group)); /* buffer safe */
+ mir_wstrncpy(fid.name, pszDescription, _countof(fid.name)); /* buffer safe */
+ mir_wstrncpy(fid.backgroundGroup, pszBackgroundGroup, _countof(fid.backgroundGroup)); /* buffer safe */
+ mir_wstrncpy(fid.backgroundName, pszBackgroundName, _countof(fid.backgroundName)); /* buffer safe */
fid.flags = FIDF_ALLOWREREGISTER;
if (bAllowEffects) fid.flags |= FIDF_ALLOWEFFECTS;
fid.order = position;
@@ -28,7 +28,7 @@ int FontService_RegisterFont(const char *pszDbModule, const char *pszDbName, con
if (plfDefault->lfUnderline) fid.deffontsettings.style |= DBFONTF_UNDERLINE;
if (plfDefault->lfStrikeOut) fid.deffontsettings.style |= DBFONTF_STRIKEOUT;
fid.deffontsettings.charset = plfDefault->lfCharSet;
- mir_tstrncpy(fid.deffontsettings.szFace, plfDefault->lfFaceName, _countof(fid.deffontsettings.szFace)); /* buffer safe */
+ mir_wstrncpy(fid.deffontsettings.szFace, plfDefault->lfFaceName, _countof(fid.deffontsettings.szFace)); /* buffer safe */
}
FontRegisterT(&fid);
return 0;
@@ -37,8 +37,8 @@ int FontService_RegisterFont(const char *pszDbModule, const char *pszDbName, con
int FontService_GetFont(const wchar_t *pszSection, const wchar_t *pszDescription, COLORREF *pclr, LOGFONT *plf)
{
FontIDT fid = { 0 };
- mir_tstrncpy(fid.group, pszSection, _countof(fid.group)); /* buffer sfae */
- mir_tstrncpy(fid.name, pszDescription, _countof(fid.name)); /* buffer safe */
+ mir_wstrncpy(fid.group, pszSection, _countof(fid.group)); /* buffer sfae */
+ mir_wstrncpy(fid.name, pszDescription, _countof(fid.name)); /* buffer safe */
*pclr = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)plf); /* uses fallback font on error */
return (int)*pclr == -1;
}
@@ -50,8 +50,8 @@ int FontService_RegisterColor(const char *pszDbModule, const char *pszDbName, co
cid.defcolour = clrDefault;
mir_strncpy(cid.dbSettingsGroup, pszDbModule, sizeof(cid.dbSettingsGroup)); /* buffer safe */
mir_strncpy(cid.setting, pszDbName, sizeof(cid.setting)); /* buffer safe */
- mir_tstrncpy(cid.group, pszSection, _countof(cid.group)); /* buffer safe */
- mir_tstrncpy(cid.name, pszDescription, _countof(cid.name)); /* buffer safe */
+ mir_wstrncpy(cid.group, pszSection, _countof(cid.group)); /* buffer safe */
+ mir_wstrncpy(cid.name, pszDescription, _countof(cid.name)); /* buffer safe */
ColourRegisterT(&cid);
return 0;
}
diff --git a/utils/mir_options.cpp b/utils/mir_options.cpp
index 90bf27c3e8..dcba3e6b26 100644
--- a/utils/mir_options.cpp
+++ b/utils/mir_options.cpp
@@ -38,12 +38,12 @@ static wchar_t* MyDBGetContactSettingTString(MCONTACT hContact, char* module, ch
out[0] = '\0';
if (!db_get_ts(hContact, module, setting, &dbv)) {
- mir_tstrncpy(out, dbv.ptszVal, (int)len);
+ mir_wstrncpy(out, dbv.ptszVal, (int)len);
db_free(&dbv);
}
else {
if (def != NULL)
- mir_tstrncpy(out, def, (int)len);
+ mir_wstrncpy(out, def, (int)len);
}
return out;
@@ -55,7 +55,7 @@ static wchar_t dbPath[MAX_PATH] = { 0 }; // database profile path (read at star
static int PathIsAbsolute(const wchar_t *path)
{
- if (!path || !(mir_tstrlen(path) > 2))
+ if (!path || !(mir_wstrlen(path) > 2))
return 0;
if ((path[1] == ':' && path[2] == '\\') || (path[0] == '\\' && path[1] == '\\'))
return 1;
@@ -65,33 +65,33 @@ static int PathIsAbsolute(const wchar_t *path)
static void PathToRelative(wchar_t *pOut, size_t outSize, const wchar_t *pSrc)
{
if (!PathIsAbsolute(pSrc))
- mir_tstrncpy(pOut, pSrc, (int)outSize);
+ mir_wstrncpy(pOut, pSrc, (int)outSize);
else {
if (dbPath[0] == '\0') {
char tmp[1024];
CallService(MS_DB_GETPROFILEPATH, _countof(tmp), (LPARAM)tmp);
- mir_sntprintf(dbPath, L"%S\\", tmp);
+ mir_snwprintf(dbPath, L"%S\\", tmp);
}
- size_t len = mir_tstrlen(dbPath);
+ size_t len = mir_wstrlen(dbPath);
if (!wcsnicmp(pSrc, dbPath, len))
len = 0;
- mir_tstrncpy(pOut, pSrc + len, outSize);
+ mir_wstrncpy(pOut, pSrc + len, outSize);
}
}
static void PathToAbsolute(wchar_t *pOut, size_t outSize, const wchar_t *pSrc)
{
if (PathIsAbsolute(pSrc) || !isalnum(pSrc[0]))
- mir_tstrncpy(pOut, pSrc, (int)outSize);
+ mir_wstrncpy(pOut, pSrc, (int)outSize);
else {
if (dbPath[0] == '\0') {
char tmp[1024];
CallService(MS_DB_GETPROFILEPATH, _countof(tmp), (LPARAM)tmp);
- mir_sntprintf(dbPath, L"%S\\", tmp);
+ mir_snwprintf(dbPath, L"%S\\", tmp);
}
- mir_sntprintf(pOut, outSize, L"%s%s", dbPath, pSrc);
+ mir_snwprintf(pOut, outSize, L"%s%s", dbPath, pSrc);
}
}
@@ -267,7 +267,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha
int k;
for (k = 0; k < count; k++) {
wchar_t *id = (wchar_t *)SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETITEMDATA, (WPARAM)k, 0);
- if (mir_tstrcmp(id, tmp) == 0)
+ if (mir_wstrcmp(id, tmp) == 0)
break;
}
if (k < count)
diff --git a/utils/mir_smileys.cpp b/utils/mir_smileys.cpp
index 0bce208d26..64407a4ccf 100644
--- a/utils/mir_smileys.cpp
+++ b/utils/mir_smileys.cpp
@@ -131,7 +131,7 @@ int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT
int ret;
if (nCount < 0)
- nCount = (int)mir_tstrlen(lpString);
+ nCount = (int)mir_wstrlen(lpString);
// Get parse info
if (parseInfo == NULL)