Skip to content

Commit

Permalink
add va_end
Browse files Browse the repository at this point in the history
  • Loading branch information
nathancorvussolis committed Oct 28, 2015
1 parent cbddb5f commit 058bb49
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
25 changes: 11 additions & 14 deletions imcrvcnf/imcrvcnf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd

void CreateProperty()
{
PROPSHEETPAGEW psp;
PROPSHEETHEADERW psh;
struct {
int id;
DLGPROC DlgProc;
Expand All @@ -51,29 +49,28 @@ void CreateProperty()
{IDD_DIALOG_KANATBL, DlgProcKana},
{IDD_DIALOG_JLATTBL, DlgProcJLatin}
};
HPROPSHEETPAGE hpsp[_countof(DlgPage)];

PROPSHEETPAGEW psp[_countof(DlgPage)];
ZeroMemory(&psp, sizeof(psp));
psp.dwSize = sizeof(psp);
psp.dwFlags = PSP_PREMATURE;
psp.hInstance = hInst;

for(int i = 0; i < _countof(DlgPage); i++)
for(int i = 0; i < _countof(psp); i++)
{
psp.pszTemplate = MAKEINTRESOURCE(DlgPage[i].id);
psp.pfnDlgProc = DlgPage[i].DlgProc;
hpsp[i] = CreatePropertySheetPageW(&psp);
psp[i].dwSize = sizeof(psp[i]);
psp[i].dwFlags = PSP_PREMATURE;
psp[i].hInstance = hInst;
psp[i].pszTemplate = MAKEINTRESOURCE(DlgPage[i].id);
psp[i].pfnDlgProc = DlgPage[i].DlgProc;
}

PROPSHEETHEADERW psh;
ZeroMemory(&psh, sizeof(psh));
psh.dwSize = sizeof(psh);
psh.dwFlags = PSH_DEFAULT | PSH_NOCONTEXTHELP | PSH_USECALLBACK;
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOCONTEXTHELP | PSH_USECALLBACK;
psh.hwndParent = NULL;
psh.hInstance = hInst;
psh.pszCaption = TEXTSERVICE_DESC L" (ver. " TEXTSERVICE_VER L")";
psh.nPages = _countof(DlgPage);
psh.nPages = _countof(psp);
psh.nStartPage = 0;
psh.phpage = hpsp;
psh.ppsp = psp;
psh.pfnCallback = PropSheetProc;

PropertySheetW(&psh);
Expand Down
2 changes: 1 addition & 1 deletion imcrvtip/CandidateWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ LRESULT CALLBACK CCandidateWindow::_WindowProc(HWND hWnd, UINT uMsg, WPARAM wPar
case WM_MOUSEACTIVATE:
return MA_NOACTIVATE;
default:
return DefWindowProc(hWnd, uMsg, wParam, lParam);
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
}
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion imcrvtip/InputModeWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ LRESULT CALLBACK CInputModeWindow::_WindowProc(HWND hWnd, UINT uMsg, WPARAM wPar
case WM_MOUSEACTIVATE:
return MA_NOACTIVATE;
default:
return DefWindowProc(hWnd, uMsg, wParam, lParam);
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
}
return 0;
}
Expand Down
4 changes: 4 additions & 0 deletions luaxx/lu8w.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ int u8fprintf(FILE *file, const char *format, ...)

vsnprintf(buf, buflen, format, argptr);

va_end(argptr);

if(file == stdout || file == stderr) {
wbuf = u8stows(buf);
if(wbuf) {
Expand Down Expand Up @@ -225,6 +227,8 @@ int u8printf(const char *format, ...)

vsnprintf(buf, buflen, format, argptr);

va_end(argptr);

wbuf = u8stows(buf);
if(wbuf) {
ret = wprintf(L"%s", wbuf);
Expand Down

0 comments on commit 058bb49

Please sign in to comment.