Skip to content

Commit

Permalink
adapt to MinGW
Browse files Browse the repository at this point in the history
  • Loading branch information
katahiromz committed Jun 15, 2018
1 parent 8564875 commit 5635f13
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
File renamed without changes.
16 changes: 8 additions & 8 deletions src/RisohEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ WORD LangFromText(LPWSTR pszLang)
ReplaceFullWithHalf(pszLang);
MStringW strLang = pszLang;
mstr_trim(strLang);
lstrcpyW(pszLang, strLang.c_str());
StringCchCopyW(pszLang, MAX_PATH, strLang.c_str());

do
{
Expand Down Expand Up @@ -1036,7 +1036,7 @@ BOOL CheckLangComboBox(HWND hCmb3, WORD& lang)
WCHAR szLang[MAX_PATH];
GetWindowTextW(hCmb3, szLang, _countof(szLang));

lang = LangFromText(szLang);;
lang = LangFromText(szLang);
if (lang != 0xFFFF)
return TRUE;

Expand Down Expand Up @@ -1411,7 +1411,7 @@ class MMainWnd : public MWindowBase
e->m_strLabel = e->get_name_label();
item.pszText = &e->m_strLabel[0];
if (pszText)
lstrcpyW(pszText, item.pszText);
StringCchCopyW(pszText, MAX_PATH, item.pszText);
TreeView_SetItem(m_hwndTV, &item);
}
void UpdateEntryLang(EntryBase *e, LPWSTR pszText = NULL)
Expand All @@ -1423,7 +1423,7 @@ class MMainWnd : public MWindowBase
e->m_strLabel = e->get_lang_label();
item.pszText = &e->m_strLabel[0];
if (pszText)
lstrcpyW(pszText, item.pszText);
StringCchCopyW(pszText, MAX_PATH, item.pszText);
TreeView_SetItem(m_hwndTV, &item);
}

Expand Down Expand Up @@ -2241,7 +2241,7 @@ void MMainWnd::OnSaveAs(HWND hwnd)
if (GetFileAttributesW(szFile) == INVALID_FILE_ATTRIBUTES)
szFile[0] = 0;

static const LPWSTR s_DotExts[] =
static const LPCWSTR s_DotExts[] =
{
L".exe", L".dll", L".ocx", L".cpl", L".scr", L".mui", L".rc", L".res"
};
Expand Down Expand Up @@ -6152,7 +6152,7 @@ BOOL MMainWnd::DoExport(LPCWSTR pszRCFile, LPWSTR pszResHFile)
StringCchCatW(szPath, _countof(szPath), L"\\resource.h");
bOK = DoWriteResH(szPath, pszRCFile) && DoWriteRC(pszRCFile, szPath);
if (bOK && pszResHFile)
lstrcpyW(pszResHFile, szPath);
StringCchCopyW(pszResHFile, MAX_PATH, szPath);
}
else
{
Expand Down Expand Up @@ -7618,7 +7618,7 @@ LRESULT MMainWnd::OnNotify(HWND hwnd, int idFrom, NMHDR *pnmhdr)
else
{
static WORD old_lang = 0xFFFF;
static WCHAR szOldText[128] = L"";
static WCHAR szOldText[MAX_PATH] = L"";

if (pnmhdr->code == TVN_BEGINLABELEDIT)
{
Expand Down Expand Up @@ -7682,7 +7682,7 @@ LRESULT MMainWnd::OnNotify(HWND hwnd, int idFrom, NMHDR *pnmhdr)
}
}

WCHAR szNewText[128];
WCHAR szNewText[MAX_PATH];
StringCchCopyW(szNewText, _countof(szNewText), pszNewText);
mstr_trim(szNewText);

Expand Down

0 comments on commit 5635f13

Please sign in to comment.