diff --git a/sakura_core/cmd/CViewCommander_Search.cpp b/sakura_core/cmd/CViewCommander_Search.cpp index b010a03e0f..2d0b0dbdbf 100644 --- a/sakura_core/cmd/CViewCommander_Search.cpp +++ b/sakura_core/cmd/CViewCommander_Search.cpp @@ -809,7 +809,7 @@ void CViewCommander::Command_REPLACE_ALL() int nReplaceNum = 0; HWND hwndStatic = ::GetDlgItem( hwndCancel, IDC_STATIC_KENSUU ); WCHAR szLabel[64]; - _itot( nReplaceNum, szLabel, 10 ); + _itow( nReplaceNum, szLabel, 10 ); ::SendMessage( hwndStatic, WM_SETTEXT, 0, (LPARAM)szLabel ); CLayoutRange sRangeA; //選択範囲 @@ -1033,7 +1033,7 @@ void CViewCommander::Command_REPLACE_ALL() Progress_SetPos( hwndProgress, nNewPos ); nOldPos = nNewPos; } - _itot( nReplaceNum, szLabel, 10 ); + _itow( nReplaceNum, szLabel, 10 ); ::SendMessage( hwndStatic, WM_SETTEXT, 0, (LPARAM)szLabel ); } @@ -1449,7 +1449,7 @@ void CViewCommander::Command_REPLACE_ALL() } //>> 2002/03/26 Azumaiya - _itot( nReplaceNum, szLabel, 10 ); + _itow( nReplaceNum, szLabel, 10 ); ::SendMessage( hwndStatic, WM_SETTEXT, 0, (LPARAM)szLabel ); if( !cDlgCancel.IsCanceled() ){ diff --git a/sakura_core/dlg/CDlgTagJumpList.cpp b/sakura_core/dlg/CDlgTagJumpList.cpp index 92a03a0c85..23a312998c 100644 --- a/sakura_core/dlg/CDlgTagJumpList.cpp +++ b/sakura_core/dlg/CDlgTagJumpList.cpp @@ -738,7 +738,7 @@ bool CDlgTagJumpList::GetFullPathAndLine( int index, WCHAR *fullPath, int count, const WCHAR *p = fileName; if( p[0] == L'\\' ){ wcscpy( dirFileName, p ); - }else if( _istalpha( p[0] ) && p[1] == L':' ){ + }else if( iswalpha( p[0] ) && p[1] == L':' ){ wcscpy( dirFileName, p ); }else{ // 相対パス:連結する @@ -1617,7 +1617,7 @@ WCHAR* CDlgTagJumpList::GetFullPathFromDepth( WCHAR* pszOutput, int count, const WCHAR *p = fileName; if( p[0] == L'\\' ){ //ドライブなし絶対パスか? wcscpy( pszOutput, p ); //何も加工しない。 - }else if( _istalpha( p[0] ) && p[1] == L':' ){ //絶対パスか? + }else if( iswalpha( p[0] ) && p[1] == L':' ){ //絶対パスか? wcscpy( pszOutput, p ); //何も加工しない。 }else{ for( int i = 0; i < depth; i++ ){ diff --git a/sakura_core/env/CFileNameManager.cpp b/sakura_core/env/CFileNameManager.cpp index a0c8185660..287d151e44 100644 --- a/sakura_core/env/CFileNameManager.cpp +++ b/sakura_core/env/CFileNameManager.cpp @@ -239,7 +239,7 @@ bool CFileNameManager::ExpandMetaToFolder( LPCWSTR pszSrc, LPWSTR pszDes, int nD szMeta, szPath, _countof( szPath ) ); } if( false == bFolderPath || L'\0' == szPath[0] ){ - pStr = _tgetenv( szMeta ); + pStr = _wgetenv( szMeta ); // 環境変数 if( NULL != pStr ){ nPathLen = wcslen( pStr ); diff --git a/sakura_core/env/CShareData_IO.cpp b/sakura_core/env/CShareData_IO.cpp index 79d304fd9b..f5bcb8c9a1 100644 --- a/sakura_core/env/CShareData_IO.cpp +++ b/sakura_core/env/CShareData_IO.cpp @@ -118,7 +118,7 @@ bool CShareData_IO::ShareData_IO_2( bool bRead ) DWORD mH, mL, lH, lL; mH = mL = lH = lL = 0; // ※ 古~い ini だと "szVersion" は無い if( cProfile.IOProfileData(LTEXT("Other"), L"szVersion", StringBufferW(iniVer)) ) - _stscanf( iniVer, L"%u.%u.%u.%u", &mH, &mL, &lH, &lL ); + swscanf( iniVer, L"%u.%u.%u.%u", &mH, &mL, &lH, &lL ); DWORD dwMS = (DWORD)MAKELONG(mL, mH); DWORD dwLS = (DWORD)MAKELONG(lL, lH); DLLSHAREDATA* pShareData = &GetDllShareData(); diff --git a/sakura_core/func/CKeyBind.cpp b/sakura_core/func/CKeyBind.cpp index d5c7217ffb..cf066172ef 100644 --- a/sakura_core/func/CKeyBind.cpp +++ b/sakura_core/func/CKeyBind.cpp @@ -399,7 +399,7 @@ WCHAR* CKeyBind::MakeMenuLabel(const WCHAR* sName, const WCHAR* sKey) } else { if( !GetDllShareData().m_Common.m_sMainMenu.m_bMainMenuKeyParentheses - && (((p = wcschr( sName, sKey[0])) != NULL) || ((p = wcschr( sName, _totlower(sKey[0]))) != NULL)) ){ + && (((p = wcschr( sName, sKey[0])) != nullptr) || ((p = wcschr( sName, towlower(sKey[0]))) != nullptr)) ){ // 欧文風、使用している文字をアクセスキーに wcscpy_s( sLabel, _countof(sLabel), sName ); sLabel[p-sName] = L'&'; diff --git a/sakura_core/macro/CMacroFactory.cpp b/sakura_core/macro/CMacroFactory.cpp index b2c5c90d6d..124e4000fe 100644 --- a/sakura_core/macro/CMacroFactory.cpp +++ b/sakura_core/macro/CMacroFactory.cpp @@ -36,7 +36,7 @@ std::wstring CMacroFactory::Ext2Key(const WCHAR *ext) } std::wstring key = ext; - std::transform( key.begin(), key.end(), key.begin(), _totlower); + std::transform( key.begin(), key.end(), key.begin(), towlower); return key; } diff --git a/sakura_core/prop/CPropComMacro.cpp b/sakura_core/prop/CPropComMacro.cpp index ee12ff5d12..7f43550eed 100644 --- a/sakura_core/prop/CPropComMacro.cpp +++ b/sakura_core/prop/CPropComMacro.cpp @@ -272,7 +272,7 @@ void CPropMacro::SetData( HWND hwndDlg ) // マクロ停止ダイアログ表示待ち時間 WCHAR szCancelTimer[16] = {0}; - ::DlgItem_SetText( hwndDlg, IDC_MACROCANCELTIMER, _itot(m_Common.m_sMacro.m_nMacroCancelTimer, szCancelTimer, 10) ); + ::DlgItem_SetText( hwndDlg, IDC_MACROCANCELTIMER, _itow(m_Common.m_sMacro.m_nMacroCancelTimer, szCancelTimer, 10) ); return; } @@ -422,7 +422,7 @@ void CPropMacro::InitDialog( HWND hwndDlg ) sItem.mask = LVIF_TEXT | LVIF_PARAM; sItem.iItem = pos; sItem.iSubItem = 0; - _itot( pos, buf, 10 ); + _itow( pos, buf, 10 ); sItem.pszText = buf; sItem.lParam = pos; ListView_InsertItem( hListView, &sItem ); diff --git a/sakura_core/prop/CPropComPlugin.cpp b/sakura_core/prop/CPropComPlugin.cpp index 155987b4f8..ef82a1ee88 100644 --- a/sakura_core/prop/CPropComPlugin.cpp +++ b/sakura_core/prop/CPropComPlugin.cpp @@ -341,7 +341,7 @@ void CPropPlugin::SetData_LIST( HWND hwndDlg ) sItem.mask = LVIF_TEXT | LVIF_PARAM; sItem.iItem = index; sItem.iSubItem = 0; - _itot( index, buf, 10 ); + _itow( index, buf, 10 ); sItem.pszText = buf; sItem.lParam = index; ListView_InsertItem( hListView, &sItem ); diff --git a/sakura_core/typeprop/CDlgTypeAscertain.cpp b/sakura_core/typeprop/CDlgTypeAscertain.cpp index dc14dac889..68fca55933 100644 --- a/sakura_core/typeprop/CDlgTypeAscertain.cpp +++ b/sakura_core/typeprop/CDlgTypeAscertain.cpp @@ -66,7 +66,7 @@ BOOL CDlgTypeAscertain::OnBnClicked( int wID ) m_psi->sColorFile.clear(); m_psi->nColorType = Combo_GetCurSel( GetItemHwnd( IDC_COMBO_COLORS ) ) - 1; if (m_psi->nColorType >= MAX_TYPES && Combo_GetLBText( GetItemHwnd( IDC_COMBO_COLORS ), m_psi->nColorType + 1, buff1)) { - if (_stscanf( buff1, L"File -- %ls", buff2 ) > 0) { + if (swscanf( buff1, L"File -- %ls", buff2 ) > 0) { m_psi->sColorFile = buff2; m_psi->nColorType = MAX_TYPES; } diff --git a/sakura_core/uiparts/CMenuDrawer.cpp b/sakura_core/uiparts/CMenuDrawer.cpp index fde44c781b..62707ed51d 100644 --- a/sakura_core/uiparts/CMenuDrawer.cpp +++ b/sakura_core/uiparts/CMenuDrawer.cpp @@ -1424,7 +1424,7 @@ WCHAR CMenuDrawer::GetAccelCharFromLabel( const WCHAR* pszLabel ) if( L'&' == pszLabel[i + 1] ){ i++; }else{ - return (WCHAR)_totupper( pszLabel[i + 1] ); + return (WCHAR)towupper( pszLabel[i + 1] ); } } } @@ -1451,7 +1451,7 @@ LRESULT CMenuDrawer::OnMenuChar( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa chUser += '@'; } else { - chUser = (WCHAR)_totupper( chUser ); + chUser = (WCHAR)towupper( chUser ); } // 2011.11.18 vector化 diff --git a/sakura_core/util/file.cpp b/sakura_core/util/file.cpp index 4cbd67add2..750388a83f 100644 --- a/sakura_core/util/file.cpp +++ b/sakura_core/util/file.cpp @@ -175,7 +175,7 @@ bool IsLocalDrive( const WCHAR* pszDrive ) long lngRet; if( iswalpha(pszDrive[0]) ){ - auto_sprintf(szDriveType, L"%c:\\", _totupper(pszDrive[0])); + auto_sprintf(szDriveType, L"%c:\\", towupper(pszDrive[0])); lngRet = GetDriveType( szDriveType ); if( lngRet == DRIVE_REMOVABLE || lngRet == DRIVE_CDROM || lngRet == DRIVE_REMOTE ) { diff --git a/sakura_core/util/format.cpp b/sakura_core/util/format.cpp index e488aa082e..12fa21e441 100644 --- a/sakura_core/util/format.cpp +++ b/sakura_core/util/format.cpp @@ -108,15 +108,15 @@ UINT32 ParseVersion( const WCHAR* sVer ) else p++; nShift = 0x20; } - else if( !_istdigit(*p) ){ + else if( !iswdigit(*p) ){ nShift = -0x80; } else{ nShift = 0; } - while( *p && !_istdigit(*p) ){ p++; } + while( *p && !iswdigit(*p) ){ p++; } //数値の抽出 - for( nVer = 0, nDigit = 0; _istdigit(*p); p++ ){ + for( nVer = 0, nDigit = 0; iswdigit(*p); p++ ){ if( ++nDigit > 2 )break; //数字は2桁までで止める nVer = nVer * 10 + *p - L'0'; } diff --git a/sakura_core/util/string_ex.h b/sakura_core/util/string_ex.h index e9036ad349..f6bce59122 100644 --- a/sakura_core/util/string_ex.h +++ b/sakura_core/util/string_ex.h @@ -185,7 +185,7 @@ inline int auto_sprintf(WCHAR* buf, const WCHAR* format, ...) { va_list args; va inline int auto_vsprintf_s(ACHAR* buf, size_t nBufCount, const ACHAR* format, va_list& v) { return ::_vsnprintf_s(buf, nBufCount, _TRUNCATE, format, v); } inline int auto_vsprintf_s(WCHAR* buf, size_t nBufCount, const WCHAR* format, va_list& v) { return ::_vsnwprintf_s(buf, nBufCount, _TRUNCATE, format, v); } -#define auto_snprintf_s(buf, nBufCount, format, ...) ::_sntprintf_s((buf), nBufCount, _TRUNCATE, (format), __VA_ARGS__) +#define auto_snprintf_s(buf, nBufCount, format, ...) ::_snwprintf_s((buf), nBufCount, _TRUNCATE, (format), __VA_ARGS__) std::wstring& eos(std::wstring& strOut, size_t cchOut); std::string& eos(std::string& strOut, size_t cchOut); diff --git a/sakura_core/view/CEditView_Command.cpp b/sakura_core/view/CEditView_Command.cpp index 647db82da0..6ca43052be 100644 --- a/sakura_core/view/CEditView_Command.cpp +++ b/sakura_core/view/CEditView_Command.cpp @@ -207,7 +207,7 @@ open_c:; _wsplitpath( GetDocument()->m_cDocFile.GetFilePath(), szDrive, szDir, szFname, szExt ); for( i = 0; i < open_extno; i++ ){ - _tmakepath( szPath, szDrive, szDir, szFname, open_ext[i] ); + _wmakepath( szPath, szDrive, szDir, szFname, open_ext[i] ); if( !fexist(szPath) ){ if( i < open_extno - 1 ) continue;