diff --git a/sakura_core/StdAfx.h b/sakura_core/StdAfx.h index 3b6c3c027d..971b0809ab 100644 --- a/sakura_core/StdAfx.h +++ b/sakura_core/StdAfx.h @@ -107,12 +107,5 @@ // プリコンパイルの有無がビルドパフォーマンスに大きく影響するため。 #include "env/DLLSHAREDATA.h" -//その他 -#define malloc_char (char*)malloc -#define GlobalLockChar (char*)::GlobalLock -#define GlobalLockUChar (unsigned char*)::GlobalLock -#define GlobalLockWChar (wchar_t*)::GlobalLock -#define GlobalLockBYTE (BYTE*)::GlobalLock - //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ は前行の直前に追加の宣言を挿入します。 diff --git a/sakura_core/_os/CClipboard.cpp b/sakura_core/_os/CClipboard.cpp index fa0d6806a0..6353f7fe79 100644 --- a/sakura_core/_os/CClipboard.cpp +++ b/sakura_core/_os/CClipboard.cpp @@ -86,7 +86,7 @@ bool CClipboard::SetText( nTextLen + 1 ); if( hgClipText ){ - char* pszClip = GlobalLockChar( hgClipText ); + char* pszClip = static_cast(::GlobalLock(hgClipText)); memcpy( pszClip, pszText, nTextLen ); pszClip[nTextLen] = '\0'; ::GlobalUnlock( hgClipText ); @@ -106,7 +106,7 @@ bool CClipboard::SetText( if( !hgClipText )break; //確保した領域にデータをコピー - wchar_t* pszClip = GlobalLockWChar( hgClipText ); + wchar_t* pszClip = static_cast(::GlobalLock(hgClipText)); wmemcpy( pszClip, pData, nDataLen ); //データ pszClip[nDataLen] = L'\0'; //終端ヌル ::GlobalUnlock( hgClipText ); @@ -135,7 +135,7 @@ bool CClipboard::SetText( if( !hgClipSakura )break; //確保した領域にデータをコピー - BYTE* pClip = GlobalLockBYTE( hgClipSakura ); + BYTE* pClip = static_cast(::GlobalLock(hgClipSakura)); *((int*)pClip) = nDataLen; pClip += sizeof(int); //データの長さ wmemcpy( (wchar_t*)pClip, pData, nDataLen ); pClip += nDataLen*sizeof(wchar_t); //データ *((wchar_t*)pClip) = L'\0'; pClip += sizeof(wchar_t); //終端ヌル @@ -157,7 +157,7 @@ bool CClipboard::SetText( 1 ); if( hgClipMSDEVColumn ){ - BYTE* pClip = GlobalLockBYTE( hgClipMSDEVColumn ); + BYTE* pClip = static_cast(::GlobalLock(hgClipMSDEVColumn)); pClip[0] = 0; ::GlobalUnlock( hgClipMSDEVColumn ); SetClipboardData( uFormat, hgClipMSDEVColumn ); @@ -241,7 +241,7 @@ bool CClipboard::SetHtmlText(const CNativeW& cmemBUf) if( !hgClipText ) return false; //確保した領域にデータをコピー - char* pszClip = GlobalLockChar( hgClipText ); + char* pszClip = static_cast(::GlobalLock(hgClipText)); memcpy_raw( pszClip, cmemHeader.GetStringPtr(), cmemHeader.GetStringLength() ); //データ memcpy_raw( pszClip + cmemHeader.GetStringLength(), cmemUtf8.GetStringPtr(), cmemUtf8.GetStringLength() ); //データ memcpy_raw( pszClip + cmemHeader.GetStringLength() + cmemUtf8.GetStringLength(), cmemFooter.GetStringPtr(), cmemFooter.GetStringLength() ); //データ @@ -319,7 +319,7 @@ bool CClipboard::GetText(CNativeW* cmemBuf, bool* pbColumnSelect, bool* pbLineSe } if( hUnicode != NULL ){ //DWORD nLen = GlobalSize(hUnicode); - wchar_t* szData = GlobalLockWChar(hUnicode); + wchar_t* szData = static_cast(::GlobalLock(hUnicode)); cmemBuf->SetString( szData ); ::GlobalUnlock(hUnicode); return true; @@ -332,7 +332,7 @@ bool CClipboard::GetText(CNativeW* cmemBuf, bool* pbColumnSelect, bool* pbLineSe hText = GetClipboardData( CF_OEMTEXT ); } if( hText != NULL ){ - char* szData = GlobalLockChar(hText); + char* szData = static_cast(::GlobalLock(hText)); //SJIS→UNICODE CMemory cmemSjis( szData, GlobalSize(hText) ); CNativeW cmemUni; @@ -515,7 +515,7 @@ bool CClipboard::SetClipboradByFormat(const CStringRef& cstr, const wchar_t* pFo if( !hgClipText ){ return false; } - char* pszClip = GlobalLockChar( hgClipText ); + char* pszClip = static_cast(::GlobalLock(hgClipText)); memcpy( pszClip, pBuf, nTextByteLen ); if( nulLen ){ memset( &pszClip[nTextByteLen], 0, nulLen ); diff --git a/sakura_core/dlg/CDlgProperty.cpp b/sakura_core/dlg/CDlgProperty.cpp index ea85c49a24..ca8eed667b 100644 --- a/sakura_core/dlg/CDlgProperty.cpp +++ b/sakura_core/dlg/CDlgProperty.cpp @@ -259,7 +259,7 @@ void CDlgProperty::SetData( void ) in.Close(); goto end_of_CodeTest; } - pBuf = GlobalLockChar( hgData ); + pBuf = static_cast(::GlobalLock(hgData)); in.Read( pBuf, nBufLen ); in.Close();