summaryrefslogtreecommitdiff
path: root/src/mir_core
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-11-30 21:20:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-11-30 21:20:14 +0000
commitd9c98bcdfca6da51a1a82dc6c0dc5996b3b6cd6d (patch)
treea6f925c63bc31e4b4dba301183cc3b429d52d816 /src/mir_core
parentce2d4f19e3f810b282eb7d47d470d426ff459e1f (diff)
new sorting functions applied
git-svn-id: http://svn.miranda-ng.org/main/trunk@11180 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/mir_core')
-rw-r--r--src/mir_core/langpack.cpp22
-rw-r--r--src/mir_core/utils.cpp16
-rw-r--r--src/mir_core/winver.cpp2
3 files changed, 20 insertions, 20 deletions
diff --git a/src/mir_core/langpack.cpp b/src/mir_core/langpack.cpp
index 7401c0d991..b5488e7d2f 100644
--- a/src/mir_core/langpack.cpp
+++ b/src/mir_core/langpack.cpp
@@ -308,7 +308,7 @@ static int LoadLangDescr(LANGPACK_INFO &lpinfo, FILE *fp, char *line, int &start
memmove(line, line + 3, lineLen - 2);
lrtrim(line);
- if (lstrcmpA(line, "Miranda Language Pack Version 1"))
+ if (mir_strcmp(line, "Miranda Language Pack Version 1"))
return 2;
// headers
@@ -329,24 +329,24 @@ static int LoadLangDescr(LANGPACK_INFO &lpinfo, FILE *fp, char *line, int &start
return 3;
*pszColon++ = 0;
- if (!lstrcmpA(line, "Language")) {
+ if (!mir_strcmp(line, "Language")) {
mir_snprintf(szLanguage, sizeof(szLanguage), "%s", pszColon);
lrtrim(szLanguage);
}
- else if (!lstrcmpA(line, "Last-Modified-Using")) {
+ else if (!mir_strcmp(line, "Last-Modified-Using")) {
lpinfo.szLastModifiedUsing = pszColon;
lpinfo.szLastModifiedUsing.Trim();
}
- else if (!lstrcmpA(line, "Authors")) {
+ else if (!mir_strcmp(line, "Authors")) {
if (!szAuthors.IsEmpty())
szAuthors.AppendChar(' ');
szAuthors.Append(lrtrim(pszColon));
}
- else if (!lstrcmpA(line, "Author-email")) {
+ else if (!mir_strcmp(line, "Author-email")) {
lpinfo.szAuthorEmail = pszColon;
lpinfo.szAuthorEmail.Trim();
}
- else if (!lstrcmpA(line, "Locale")) {
+ else if (!mir_strcmp(line, "Locale")) {
char szBuf[20], *stopped;
lrtrim(pszColon + 1);
@@ -373,7 +373,7 @@ static int LoadLangDescr(LANGPACK_INFO &lpinfo, FILE *fp, char *line, int &start
MIR_CORE_DLL(int) LoadLangPack(const TCHAR *ptszLangPack)
{
- if (ptszLangPack == NULL || !lstrcmpi(ptszLangPack, _T("")))
+ if (ptszLangPack == NULL || !mir_tstrcmpi(ptszLangPack, _T("")))
return 1;
// ensure that a lang's name is a full file name
@@ -384,7 +384,7 @@ MIR_CORE_DLL(int) LoadLangPack(const TCHAR *ptszLangPack)
_tcsncpy_s(tszFullPath, ptszLangPack, _TRUNCATE);
// this lang is already loaded? nothing to do then
- if (!lstrcmp(tszFullPath, langPack.tszFullPath))
+ if (!mir_tstrcmp(tszFullPath, langPack.tszFullPath))
return 0;
// ok... loading a new langpack. remove the old one if needed
@@ -568,9 +568,9 @@ static BOOL CALLBACK TranslateDialogEnumProc(HWND hwnd, LPARAM lParam)
MUUID *uuid = Langpack_LookupUuid(hLangpack);
GetClassName(hwnd, szClass, SIZEOF(szClass));
- if (!lstrcmpi(szClass, _T("static")) || !lstrcmpi(szClass, _T("hyperlink")) || !lstrcmpi(szClass, _T("button")) || !lstrcmpi(szClass, _T("MButtonClass")) || !lstrcmpi(szClass, _T("MHeaderbarCtrl")))
+ if (!mir_tstrcmpi(szClass, _T("static")) || !mir_tstrcmpi(szClass, _T("hyperlink")) || !mir_tstrcmpi(szClass, _T("button")) || !mir_tstrcmpi(szClass, _T("MButtonClass")) || !mir_tstrcmpi(szClass, _T("MHeaderbarCtrl")))
TranslateWindow(uuid, hwnd);
- else if (!lstrcmpi(szClass, _T("edit"))) {
+ else if (!mir_tstrcmpi(szClass, _T("edit"))) {
if (GetWindowLongPtr(hwnd, GWL_STYLE) & ES_READONLY)
TranslateWindow(uuid, hwnd);
}
@@ -648,7 +648,7 @@ void GetDefaultLang()
PathToAbsoluteT(_T("\\mirandaboot.ini"), tszPath);
GetPrivateProfileString(_T("Language"), _T("DefaultLanguage"), _T(""), tszDefaultLang, SIZEOF(tszDefaultLang), tszPath);
- if (!lstrcmpi(tszDefaultLang, _T("default"))) {
+ if (!mir_tstrcmpi(tszDefaultLang, _T("default"))) {
db_set_ts(NULL, "Langpack", "Current", _T("default"));
return;
}
diff --git a/src/mir_core/utils.cpp b/src/mir_core/utils.cpp
index 5e9c640c4e..10348a28f1 100644
--- a/src/mir_core/utils.cpp
+++ b/src/mir_core/utils.cpp
@@ -377,35 +377,35 @@ MIR_CORE_DLL(wchar_t*) mir_wstrncat(wchar_t *dest, const wchar_t *src, size_t le
MIR_CORE_DLL(int) mir_strcmp(const char *p1, const char *p2)
{
if (p1 == NULL)
- return (p2 == NULL) ? 0 : 1;
+ return (p2 == NULL) ? 0 : -1;
if (p2 == NULL)
- return -1;
+ return 1;
return strcmp(p1, p2);
}
MIR_CORE_DLL(int) mir_wstrcmp(const wchar_t *p1, const wchar_t *p2)
{
if (p1 == NULL)
- return (p2 == NULL) ? 0 : 1;
+ return (p2 == NULL) ? 0 : -1;
if (p2 == NULL)
- return -1;
+ return 1;
return wcscmp(p1, p2);
}
MIR_CORE_DLL(int) mir_strcmpi(const char *p1, const char *p2)
{
if (p1 == NULL)
- return (p2 == NULL) ? 0 : 1;
+ return (p2 == NULL) ? 0 : -1;
if (p2 == NULL)
- return -1;
+ return 1;
return stricmp(p1, p2);
}
MIR_CORE_DLL(int) mir_wstrcmpi(const wchar_t *p1, const wchar_t *p2)
{
if (p1 == NULL)
- return (p2 == NULL) ? 0 : 1;
+ return (p2 == NULL) ? 0 : -1;
if (p2 == NULL)
- return -1;
+ return 1;
return wcsicmp(p1, p2);
}
diff --git a/src/mir_core/winver.cpp b/src/mir_core/winver.cpp
index 7c568a59a4..ad011a8e40 100644
--- a/src/mir_core/winver.cpp
+++ b/src/mir_core/winver.cpp
@@ -80,7 +80,7 @@ MIR_CORE_DLL(BOOL) IsWorkstationLocked(void)
TCHAR tszName[100];
DWORD cbName;
- BOOL bLocked = (!GetUserObjectInformation(hDesk, UOI_NAME, tszName, SIZEOF(tszName), &cbName) || lstrcmpi(tszName,_T("default")) != 0);
+ BOOL bLocked = (!GetUserObjectInformation(hDesk, UOI_NAME, tszName, SIZEOF(tszName), &cbName) || mir_tstrcmpi(tszName,_T("default")) != 0);
CloseDesktop(hDesk);
return bLocked;
}