diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-16 15:37:16 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-16 15:37:16 +0000 |
commit | 5772526af8c29f7eecbe26bb70a106e350cf8680 (patch) | |
tree | 30ab7c0995cf049eb49e2548acfd78400ace69b9 /plugins/Clist_modern | |
parent | 330ff76e913f03653a2db5ef6e4a62885b19ae5e (diff) |
aplrtly revert [13616]
git-svn-id: http://svn.miranda-ng.org/main/trunk@13619 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r-- | plugins/Clist_modern/src/hdr/modern_commonheaders.h | 6 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_skinengine.cpp | 48 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_skinselector.cpp | 15 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_utils.cpp | 4 |
4 files changed, 37 insertions, 36 deletions
diff --git a/plugins/Clist_modern/src/hdr/modern_commonheaders.h b/plugins/Clist_modern/src/hdr/modern_commonheaders.h index f1e5cbcce0..ab4108520f 100644 --- a/plugins/Clist_modern/src/hdr/modern_commonheaders.h +++ b/plugins/Clist_modern/src/hdr/modern_commonheaders.h @@ -290,19 +290,19 @@ public: HashStringKeyNoCase(const char* szKey)
{
- _strKey = mir_strdup(szKey);
+ _strKey = _strdup(szKey);
_CreateHashKey();
}
HashStringKeyNoCase(const HashStringKeyNoCase& hsKey)
{
- _strKey = mir_strdup(hsKey._strKey);
+ _strKey = _strdup(hsKey._strKey);
_dwKey = hsKey._dwKey;
}
HashStringKeyNoCase& operator= (const HashStringKeyNoCase& hsKey)
{
- _strKey = mir_strdup(hsKey._strKey);
+ _strKey = _strdup(hsKey._strKey);
_dwKey = hsKey._dwKey;
}
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index 2eac19011f..e0aa2ce889 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -185,15 +185,15 @@ HRESULT IniParser::WriteStrToDb(const char * szSection, const char * szName, con int IniParser::GetSkinFolder(IN const TCHAR * szFileName, OUT TCHAR * pszFolderName) { TCHAR *szBuff = mir_tstrdup(szFileName); - TCHAR *pszPos = szBuff + mir_tstrlen(szBuff); + TCHAR *pszPos = szBuff + _tcslen(szBuff); while (pszPos > szBuff && *pszPos != _T('.')) { pszPos--; } *pszPos = _T('\0'); - mir_tstrcpy(pszFolderName, szBuff); + _tcscpy(pszFolderName, szBuff); TCHAR custom_folder[MAX_PATH], cus[MAX_PATH]; TCHAR *b3; - mir_tstrncpy(custom_folder, pszFolderName, SIZEOF(custom_folder)); - b3 = custom_folder + mir_tstrlen(custom_folder); + _tcsncpy(custom_folder, pszFolderName, MAX_PATH-1); + b3 = custom_folder + _tcslen(custom_folder); while (b3 > custom_folder && *b3 != _T('\\')) { b3--; } *b3 = _T('\0'); @@ -288,7 +288,7 @@ const char * IniParser::_RemoveTailings(const char * szLine, size_t& len) const char * pStart = szLine; while (*pStart == ' ' || *pStart == '\t') pStart++; //skip spaces at begin - const char * pEnd = pStart + mir_strlen(pStart); + const char * pEnd = pStart + strlen(pStart); while (pEnd > pStart && (*pEnd == ' ' || *pEnd == '\t' || *pEnd == '\n' || *pEnd == '\r')) pEnd--; @@ -299,7 +299,7 @@ const char * IniParser::_RemoveTailings(const char * szLine, size_t& len) BOOL IniParser::_DoParseLine(char *szLine) { _nLine++; - size_t len = mir_strlen(szLine); + size_t len = strlen(szLine); if (len == 0) return TRUE; @@ -322,7 +322,7 @@ BOOL IniParser::_DoParseLine(char *szLine) DWORD sectionLen = ebuf - tbuf; _szSection = (char*)mir_alloc(sectionLen + 1); - mir_strncpy(_szSection, tbuf, sectionLen); + strncpy(_szSection, tbuf, sectionLen); _szSection[sectionLen] = '\0'; } return TRUE; @@ -334,7 +334,7 @@ BOOL IniParser::_DoParseLine(char *szLine) char *keyName = szLine; char *keyValue = szLine; - size_t eqPlace = 0, len2 = mir_strlen(keyName); + size_t eqPlace = 0, len2 = strlen(keyName); while (eqPlace < len2 && keyName[eqPlace] != '=') eqPlace++; //find '=' @@ -1382,7 +1382,7 @@ INT_PTR ske_Service_DrawGlyph(WPARAM wParam, LPARAM lParam) LPSKINDRAWREQUEST preq = (LPSKINDRAWREQUEST)wParam; if (preq == NULL) return -1; - + mir_cslock lck(cs_SkinChanging); LPSKINOBJECTDESCRIPTOR pgl = (lParam ? ske_FindObjectByMask((MODERNMASK*)lParam, NULL) : ske_FindObject(preq->szObjectID, NULL)); @@ -1462,7 +1462,7 @@ int ske_GetFullFilename(TCHAR *buf, const TCHAR *file, TCHAR *skinfolder, BOOL m if (file[0] != '\\' && file[1] != ':') mir_sntprintf(b2, SIZEOF(b2), _T("%s\\%s"), (skinfolder == NULL) ? SkinPlace : ((INT_PTR)skinfolder != -1) ? skinfolder : _T(""), file); else - mir_tstrncpy(b2, file, SIZEOF(b2)); + _tcsncpy(b2, file, SIZEOF(b2)); if (madeAbsolute) { if (b2[0] == '\\' && b2[1] != '\\') @@ -1470,7 +1470,7 @@ int ske_GetFullFilename(TCHAR *buf, const TCHAR *file, TCHAR *skinfolder, BOOL m else PathToAbsoluteT(b2, buf); } - else mir_tstrncpy(buf, b2, MAX_PATH); + else _tcsncpy(buf, b2, MAX_PATH); mir_free(SkinPlace); return 0; @@ -1742,7 +1742,7 @@ HBITMAP ske_LoadGlyphImage(const TCHAR *tszFileName) return NULL; // add to loaded list - if (dwLoadedImagesCount + 1 > dwLoadedImagesAlocated) { + if (dwLoadedImagesCount + 1>dwLoadedImagesAlocated) { pLoadedImages = (GLYPHIMAGE*)mir_realloc(pLoadedImages, sizeof(GLYPHIMAGE)*(dwLoadedImagesCount + 1)); if (!pLoadedImages) return NULL; @@ -1761,7 +1761,7 @@ int ske_UnloadGlyphImage(HBITMAP hbmp) for (DWORD i = 0; i < dwLoadedImagesCount && pLoadedImages; i++) { if (hbmp != pLoadedImages[i].hGlyph) continue; - + pLoadedImages[i].dwLoadedTimes--; if (pLoadedImages[i].dwLoadedTimes == 0) { LPGLYPHIMAGE gl = &(pLoadedImages[i]); @@ -1802,7 +1802,7 @@ int ske_UnloadSkin(SKINOBJECTSLIST * Skin) if (Skin->pTextList) List_Destroy(Skin->pTextList); mir_free_and_nil(Skin->pTextList); ModernSkinButtonDeleteAll(); - if (Skin->dwObjLPAlocated == 0) + if (Skin->dwObjLPAlocated == 0) return 0; for (DWORD i = 0; i < Skin->dwObjLPAlocated; i++) { @@ -1854,7 +1854,7 @@ static void RegisterMaskByParce(const char *szSetting, char *szValue, SKINOBJECT DWORD ID = atoi(szSetting + 1); Mask = szValue + i + 1; Obj = (char*)mir_alloc(i + 1); - mir_strncpy(Obj, szValue, i); + strncpy(Obj, szValue, i); Obj[i] = '\0'; res = AddStrModernMaskToList(ID, Mask, Obj, pSkin->pMaskList); mir_free(Obj); @@ -2307,7 +2307,7 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect, int workRectWidth = workRect.right - workRect.left; int workRectHeight = workRect.bottom - workRect.top; if (workRectWidth <= 0 || workRectHeight <= 0) { - if (destHasNotDIB) + if(destHasNotDIB) mir_free(pDestBits); return 0; } @@ -2649,7 +2649,7 @@ BOOL ske_DrawIconEx(HDC hdcDst, int xLeft, int yTop, HICON hIcon, int cxWidth, i DeleteObject(ici.hbmMask); return 0; } - + BITMAP immaskbt; GetObject(ici.hbmMask, sizeof(BITMAP), &immaskbt); DWORD cy = imbt.bmHeight; @@ -2667,7 +2667,7 @@ BOOL ske_DrawIconEx(HDC hdcDst, int xLeft, int yTop, HICON hIcon, int cxWidth, i } DeleteDC(tempDC1); } - + bool NoDIBImage = (imbt.bmBits == NULL); if (NoDIBImage) { imimagbits = (BYTE*)malloc(cy*imbt.bmWidthBytes); @@ -3492,7 +3492,7 @@ static void ske_AddParseSkinFont(char * szFontID, char * szDefineString) logfont.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; char buf[255]; - mir_strncpy(logfont.lfFaceName, GetParamN(szDefineString, buf, sizeof(buf), 0, ',', TRUE), SIZEOF(logfont.lfFaceName)); + strncpy(logfont.lfFaceName, GetParamN(szDefineString, buf, sizeof(buf), 0, ',', TRUE), 32); logfont.lfHeight = atoi(GetParamN(szDefineString, buf, sizeof(buf), 1, ',', TRUE)); if (logfont.lfHeight < 0) { HDC hdc = CreateCompatibleDC(NULL); @@ -3749,13 +3749,13 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha) } #define NEWJOINEDSTR(destination, first, separator, last) \ - destination = (char*)alloca(mir_strlen(first)+mir_strlen(separator)+mir_strlen(last)+1); \ + destination = (char*)alloca(strlen(first)+strlen(separator)+strlen(last)+1); \ if (destination) { \ *destination = '\0'; \ - mir_strcat(destination,first); \ - mir_strcat(destination,separator); \ - mir_strcat(destination,last); \ - } + strcat(destination,first); \ + strcat(destination,separator); \ + strcat(destination,last); \ + } #define SKINSETSECTION "SkinnedSettings" diff --git a/plugins/Clist_modern/src/modern_skinselector.cpp b/plugins/Clist_modern/src/modern_skinselector.cpp index e78f3f79e1..7d62758208 100644 --- a/plugins/Clist_modern/src/modern_skinselector.cpp +++ b/plugins/Clist_modern/src/modern_skinselector.cpp @@ -95,7 +95,7 @@ DWORD mod_CalcHash(const char *szStr) mov esi, szStr
mov al, [esi]
xor cl, cl
- lph_top : //only 4 of 9 instructions in here don't use AL, so optimal pipe use is impossible
+lph_top : //only 4 of 9 instructions in here don't use AL, so optimal pipe use is impossible
xor edx, eax
inc esi
xor eax, eax
@@ -195,7 +195,8 @@ int SortMaskList(LISTMODERNMASK * mmList) pos = 1;
}
else pos++;
- } while (pos < mmList->dwMaskCnt);
+ }
+ while (pos < mmList->dwMaskCnt);
return 1;
}
@@ -326,7 +327,7 @@ int ParseToModernMask(MODERNMASK *mm, char *szText) }
else //ParamName = 'Module'
{
- param.szName = mir_strdup("Module");
+ param.szName = _strdup("Module");
param.dwId = mod_CalcHash(param.szName);
}
@@ -413,7 +414,7 @@ int AddStrModernMaskToList(DWORD maskID, char *szStr, char *objectName, LISTMODE SKINOBJECTDESCRIPTOR *skin_FindObjectByMask(MODERNMASK *mm, LISTMODERNMASK *mmTemplateList)
{
- for (DWORD i = 0; i < mmTemplateList->dwMaskCnt; i++)
+ for (DWORD i = 0;i < mmTemplateList->dwMaskCnt;i++)
if (CompareModernMask(mm, &(mmTemplateList->pl_Masks[i])))
return (SKINOBJECTDESCRIPTOR*)mmTemplateList->pl_Masks[i].pObject;
@@ -464,7 +465,7 @@ WCHAR* GetParamN(WCHAR *string, WCHAR *buf, int buflen, BYTE paramN, WCHAR Delim i--;
}
len = ((int)(i - start) < buflen) ? i - start : buflen;
- mir_tstrncpy(buf, string + start, len);
+ _tcsncpy(buf, string + start, len);
buf[len] = '\0';
}
else buf[0] = '\0';
@@ -490,7 +491,7 @@ char * GetParamN(char * string, char * buf, int buflen, BYTE paramN, char Delim, i--;
}
len = ((int)(i - start) < buflen) ? i - start : buflen;
- mir_strncpy(buf, string + start, len);
+ strncpy(buf, string + start, len);
buf[len] = '\0';
}
else buf[0] = '\0';
@@ -641,6 +642,6 @@ int SkinDrawGlyphMask(HDC hdc, RECT *rcSize, RECT *rcClip, MODERNMASK *ModernMas rq.hDC = hdc;
rq.rcDestRect = *rcSize;
rq.rcClipRect = *rcClip;
- mir_strncpy(rq.szObjectID, "Masked draw", SIZEOF(rq.szObjectID));
+ strncpy(rq.szObjectID, "Masked draw", SIZEOF(rq.szObjectID)-1);
return ske_Service_DrawGlyph((WPARAM)&rq, (LPARAM)ModernMask);
}
diff --git a/plugins/Clist_modern/src/modern_utils.cpp b/plugins/Clist_modern/src/modern_utils.cpp index 6164b79de4..1dbd55bb5d 100644 --- a/plugins/Clist_modern/src/modern_utils.cpp +++ b/plugins/Clist_modern/src/modern_utils.cpp @@ -6,8 +6,8 @@ char * __cdecl strstri(char *a, const char *b) {
char * x, *y;
if (!a || !b) return FALSE;
- x = mir_strdup(a);
- y = mir_strdup(b);
+ x = _strdup(a);
+ y = _strdup(b);
x = _strupr(x);
y = _strupr(y);
char * pos = strstr(x, y);
|