Skip to content

Commit 897bab3

Browse files
authored
Merge pull request sakura-editor#1040 from beru/autobacs
auto_ 系の関数を使う必要が無いところで使わないように変更
2 parents 0f11263 + ec01bac commit 897bab3

File tree

79 files changed

+325
-332
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+325
-332
lines changed

sakura_core/CDataProfile.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct StringBufferW_{
3838

3939
StringBufferW_& operator = (const StringBufferW_& rhs)
4040
{
41-
auto_strcpy_s(pData,nDataCount,rhs.pData);
41+
wcscpy_s(pData,nDataCount,rhs.pData);
4242
return *this;
4343
}
4444
};
@@ -51,7 +51,7 @@ struct StringBufferA_{
5151

5252
StringBufferA_& operator = (const StringBufferA_& rhs)
5353
{
54-
auto_strcpy_s(pData,nDataCount,rhs.pData);
54+
strcpy_s(pData,nDataCount,rhs.pData);
5555
return *this;
5656
}
5757
};

sakura_core/CDicMgr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ int CDicMgr::HokanSearch(
153153
if( szLine.length() == 0 )continue;
154154

155155
if( bHokanLoHiCase ){ /* 英大文字小文字を同一視する */
156-
nRet = auto_memicmp( pszKey, szLine.c_str(), nKeyLen );
156+
nRet = wmemicmp( pszKey, szLine.c_str(), nKeyLen );
157157
}else{
158-
nRet = auto_memcmp( pszKey, szLine.c_str(), nKeyLen );
158+
nRet = wmemcmp( pszKey, szLine.c_str(), nKeyLen );
159159
}
160160
if( 0 == nRet ){
161161
vKouho.push_back( szLine );

sakura_core/CEol.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ struct SEolDefinition{
5454
const ACHAR* m_szDataA;
5555
int m_nLen;
5656

57-
bool StartsWith(const WCHAR* pData, int nLen) const{ return m_nLen<=nLen && 0==auto_memcmp(pData,m_szDataW,m_nLen); }
58-
bool StartsWith(const ACHAR* pData, int nLen) const{ return m_nLen<=nLen && m_szDataA[0] != '\0' && 0==auto_memcmp(pData,m_szDataA,m_nLen); }
57+
bool StartsWith(const WCHAR* pData, int nLen) const{ return m_nLen<=nLen && 0==wmemcmp(pData,m_szDataW,m_nLen); }
58+
bool StartsWith(const ACHAR* pData, int nLen) const{ return m_nLen<=nLen && m_szDataA[0] != '\0' && 0==amemcmp(pData,m_szDataA,m_nLen); }
5959
};
6060
extern const SEolDefinition g_aEolTable[];
6161

sakura_core/CFileExt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ const WCHAR *CFileExt::GetExtFilter( void )
122122

123123
int i = (int)m_vstrFilter.size();
124124
m_vstrFilter.resize( i + work.length() );
125-
auto_memcpy( &m_vstrFilter[i], &work[0], work.length() );
125+
wmemcpy( &m_vstrFilter[i], &work[0], work.length() );
126126
}
127127
if( 0 == m_nCount ){
128128
m_vstrFilter.push_back( L'\0' );

sakura_core/CGrepAgent.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ void CGrepAgent::OnAfterSave(const SSaveInfo& sSaveInfo)
6464
*/
6565
void CGrepAgent::CreateFolders( const WCHAR* pszPath, std::vector<std::wstring>& vPaths )
6666
{
67-
const int nPathLen = auto_strlen( pszPath );
67+
const int nPathLen = wcslen( pszPath );
6868
auto szPath = std::make_unique<WCHAR[]>(nPathLen + 1);
6969
auto szTmp = std::make_unique<WCHAR[]>(nPathLen + 1);
70-
auto_strcpy( &szPath[0], pszPath );
70+
wcscpy( &szPath[0], pszPath );
7171
WCHAR* token;
7272
int nPathPos = 0;
7373
while( NULL != (token = my_strtok<WCHAR>( &szPath[0], nPathLen, &nPathPos, L";")) ){
74-
auto_strcpy( &szTmp[0], token );
74+
wcscpy( &szTmp[0], token );
7575
WCHAR* p;
7676
WCHAR* q;
7777
p = q = &szTmp[0];
@@ -711,7 +711,7 @@ int CGrepAgent::DoGrepTree(
711711
int nWork = 0;
712712
int nHitCountOld = -100;
713713
bool bOutputFolderName = false;
714-
int nBasePathLen = auto_strlen(pszBasePath);
714+
int nBasePathLen = wcslen(pszBasePath);
715715
CGrepEnumOptions cGrepEnumOptions;
716716
CGrepEnumFilterFiles cGrepEnumFilterFiles;
717717
cGrepEnumFilterFiles.Enumerates( pszPath, cGrepEnumKeys, cGrepEnumOptions, cGrepExceptAbsFiles );
@@ -751,7 +751,7 @@ int CGrepAgent::DoGrepTree(
751751
currentFile += L"\\";
752752
currentFile += lpFileName;
753753
int nBasePathLen2 = nBasePathLen + 1;
754-
if( (int)auto_strlen(pszPath) < nBasePathLen2 ){
754+
if( (int)wcslen(pszPath) < nBasePathLen2 ){
755755
nBasePathLen2 = nBasePathLen;
756756
}
757757

@@ -1196,7 +1196,7 @@ int CGrepAgent::DoGrepFile(
11961196
X / O : (D)Folder(Abs) -> (G)RelPath(File)
11971197
X / X : (H)FullPath
11981198
*/
1199-
auto pszWork = std::make_unique<wchar_t[]>(auto_strlen(pszFullPath) + auto_strlen(pszCodeName) + 10);
1199+
auto pszWork = std::make_unique<wchar_t[]>(wcslen(pszFullPath) + wcslen(pszCodeName) + 10);
12001200
wchar_t* szWork0 = &pszWork[0];
12011201
if( sGrepOption.bGrepOutputBaseFolder || sGrepOption.bGrepSeparateFolder ){
12021202
if( !bOutputBaseFolder && sGrepOption.bGrepOutputBaseFolder ){
@@ -1214,7 +1214,7 @@ int CGrepAgent::DoGrepFile(
12141214
if( pszFolder[0] ){
12151215
auto_sprintf( szWork0, L"\"%s\"\r\n", pszFolder ); // (C), (D)
12161216
}else{
1217-
auto_strcpy( szWork0, L"\r\n" );
1217+
wcscpy( szWork0, L"\r\n" );
12181218
}
12191219
cmemMessage.AppendString( szWork0 );
12201220
bOutputFolderName = true;
@@ -1243,7 +1243,7 @@ int CGrepAgent::DoGrepFile(
12431243
{
12441244
if( CODE_AUTODETECT == sGrepOption.nGrepCharSet ){
12451245
if( IsValidCodeType(nCharCode) ){
1246-
auto_strcpy( szCpName, CCodeTypeName(nCharCode).Bracket() );
1246+
wcscpy( szCpName, CCodeTypeName(nCharCode).Bracket() );
12471247
pszCodeName = szCpName;
12481248
}else{
12491249
CCodePage::GetNameBracket(szCpName, nCharCode);
@@ -1694,7 +1694,7 @@ int CGrepAgent::DoGrepReplaceFile(
16941694
{
16951695
if( CODE_AUTODETECT == sGrepOption.nGrepCharSet ){
16961696
if( IsValidCodeType(nCharCode) ){
1697-
auto_strcpy( szCpName, CCodeTypeName(nCharCode).Bracket() );
1697+
wcscpy( szCpName, CCodeTypeName(nCharCode).Bracket() );
16981698
pszCodeName = szCpName;
16991699
}else{
17001700
CCodePage::GetNameBracket(szCpName, nCharCode);

sakura_core/CGrepEnumFileBase.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ class CGrepEnumFileBase {
112112
int baseLen = wcslen( lpBaseFolder );
113113
LPWSTR lpPath = new WCHAR[ baseLen + wcslen( vecKeys[ i ] ) + 2 ];
114114
if( NULL == lpPath ) break;
115-
auto_strcpy( lpPath, lpBaseFolder );
116-
auto_strcpy( lpPath + baseLen, L"\\" );
117-
auto_strcpy( lpPath + baseLen + 1, vecKeys[ i ] );
115+
wcscpy( lpPath, lpBaseFolder );
116+
wcscpy( lpPath + baseLen, L"\\" );
117+
wcscpy( lpPath + baseLen + 1, vecKeys[ i ] );
118118
// vecKeys[ i ] ==> "subdir\*.h" 等の場合に後で(ファイル|フォルダ)名に "subdir\" を連結する
119119
const WCHAR* keyDirYen = wcsrchr( vecKeys[ i ], L'\\' );
120120
const WCHAR* keyDirSlash = wcsrchr( vecKeys[ i ], L'/' );
@@ -150,9 +150,9 @@ class CGrepEnumFileBase {
150150
wcsncpy( lpName, vecKeys[ i ], nKeyDirLen );
151151
wcscpy( lpName + nKeyDirLen, w32fd.cFileName );
152152
LPWSTR lpFullPath = new WCHAR[ baseLen + wcslen(lpName) + 2 ];
153-
auto_strcpy( lpFullPath, lpBaseFolder );
154-
auto_strcpy( lpFullPath + baseLen, L"\\" );
155-
auto_strcpy( lpFullPath + baseLen + 1, lpName );
153+
wcscpy( lpFullPath, lpBaseFolder );
154+
wcscpy( lpFullPath + baseLen, L"\\" );
155+
wcscpy( lpFullPath + baseLen + 1, lpName );
156156
if( IsValid( w32fd, lpName ) ){
157157
if( pExceptItems && pExceptItems->IsExist( lpFullPath ) ){
158158
}else{

sakura_core/CHokanMgr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,9 @@ void CHokanMgr::HokanSearchByKeyword(
327327
const wchar_t* word = keywordMgr.GetKeyWord(kwdset,i);
328328
int nRet;
329329
if( bHokanLoHiCase ){
330-
nRet = auto_memicmp(pszCurWord, word, nKeyLen );
330+
nRet = wmemicmp(pszCurWord, word, nKeyLen );
331331
}else{
332-
nRet = auto_memcmp(pszCurWord, word, nKeyLen );
332+
nRet = wmemcmp(pszCurWord, word, nKeyLen );
333333
}
334334
if( nRet != 0 ){
335335
continue;

sakura_core/CKeyWordSetMgr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,11 +534,11 @@ int CKeyWordSetMgr::CleanKeyWords( int nIdx )
534534
unsigned int nKeyWordLen = wcslen( p );
535535
if( nKeyWordLen == wcslen( r ) ){
536536
if( m_bKEYWORDCASEArr[nIdx] ){
537-
if( 0 == auto_memcmp( p, r, nKeyWordLen ) ){
537+
if( 0 == wmemcmp( p, r, nKeyWordLen ) ){
538538
bDelKey = true;
539539
}
540540
}else{
541-
if( 0 == auto_memicmp( p, r, nKeyWordLen ) ){
541+
if( 0 == wmemicmp( p, r, nKeyWordLen ) ){
542542
bDelKey = true;
543543
}
544544
}

sakura_core/CSearchAgent.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ const wchar_t* CSearchAgent::SearchStringWord(
329329
for( size_t iSW = 0; iSW < nSize; ++iSW ) {
330330
if( searchWords[iSW].second == nNextWordTo2 - nNextWordFrom2 ){
331331
/* 1==大文字小文字の区別 */
332-
if( (!bLoHiCase && 0 == auto_memicmp( &(pLine[nNextWordFrom2]) , searchWords[iSW].first, searchWords[iSW].second ) ) ||
333-
(bLoHiCase && 0 == auto_memcmp( &(pLine[nNextWordFrom2]) , searchWords[iSW].first, searchWords[iSW].second ) )
332+
if( (!bLoHiCase && 0 == wmemicmp( &(pLine[nNextWordFrom2]) , searchWords[iSW].first, searchWords[iSW].second ) ) ||
333+
(bLoHiCase && 0 == wmemcmp( &(pLine[nNextWordFrom2]) , searchWords[iSW].first, searchWords[iSW].second ) )
334334
){
335335
*pnMatchLen = searchWords[iSW].second;
336336
return &pLine[nNextWordFrom2];
@@ -603,8 +603,8 @@ int CSearchAgent::SearchWord(
603603
if( searchWords[iSW].second == nNextWordTo2 - nNextWordFrom2 ){
604604
const wchar_t* pData = pDocLine->GetPtr(); // 2002/2/10 aroka CMemory変更
605605
/* 1==大文字小文字の区別 */
606-
if( (!sSearchOption.bLoHiCase && 0 == auto_memicmp( &(pData[nNextWordFrom2]) , searchWords[iSW].first, searchWords[iSW].second ) ) ||
607-
(sSearchOption.bLoHiCase && 0 == auto_memcmp( &(pData[nNextWordFrom2]) , searchWords[iSW].first, searchWords[iSW].second ) )
606+
if( (!sSearchOption.bLoHiCase && 0 == wmemicmp( &(pData[nNextWordFrom2]) , searchWords[iSW].first, searchWords[iSW].second ) ) ||
607+
(sSearchOption.bLoHiCase && 0 == wmemcmp( &(pData[nNextWordFrom2]) , searchWords[iSW].first, searchWords[iSW].second ) )
608608
){
609609
pMatchRange->SetFromY(nLinePos); // マッチ行
610610
pMatchRange->SetToY (nLinePos); // マッチ行

sakura_core/CSortedTagJumpList.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ BOOL CSortedTagJumpList::GetParam( int index, WCHAR* keyword, WCHAR* filename, i
192192
if( depth ) *depth = p->depth;
193193
if( baseDir ){
194194
if( 0 <= p->baseDirId && (size_t)p->baseDirId < m_baseDirArr.size() ){
195-
auto_strcpy( baseDir, m_baseDirArr[p->baseDirId].c_str() );
195+
wcscpy( baseDir, m_baseDirArr[p->baseDirId].c_str() );
196196
}
197197
}
198198
return TRUE;

0 commit comments

Comments
 (0)