--- np2/win9x/dialog/d_clnd.cpp 2005/03/20 08:58:19 1.7 +++ np2/win9x/dialog/d_clnd.cpp 2005/03/20 23:48:03 1.9 @@ -10,6 +10,15 @@ #include "calendar.h" +#if !defined(OSLANG_UTF8) +#define tchar_2x str_2x +#define tchar_2d str_2d +#else +static const TCHAR tchar_2x[] = _T("%.2x"); +static const TCHAR tchar_2d[] = _T("%.2d"); +#endif + + static UINT8 cbuf[8]; typedef struct { @@ -29,14 +38,14 @@ static const VIRCAL_T vircal[6] = { {IDC static void set_cal2dlg(HWND hWnd, const UINT8 *cbuf) { int i; - OEMCHAR work[8]; + TCHAR work[8]; for (i=0; i<6; i++) { if (i != 1) { - wsprintf(work, str_2x, cbuf[i]); + wsprintf(work, tchar_2x, cbuf[i]); } else { - wsprintf(work, str_2d, cbuf[1] >> 4); + wsprintf(work, tchar_2d, cbuf[1] >> 4); } SetDlgItemText(hWnd, vircal[i].res, work); } @@ -52,10 +61,10 @@ static void vircalendar(HWND hWnd, BOOL EnableWindow(GetDlgItem(hWnd, IDC_SETNOW), disp); } -static UINT8 getbcd(const OEMCHAR *str, int len) { +static UINT8 getbcd(const TCHAR *str, int len) { UINT ret; - OEMCHAR c; + TCHAR c; ret = 0; while(len--) { @@ -74,7 +83,7 @@ static UINT8 getbcd(const OEMCHAR *str, LRESULT CALLBACK ClndDialogProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { - OEMCHAR work[32]; + TCHAR work[32]; UINT8 b; int i; HWND subwnd; @@ -99,7 +108,7 @@ LRESULT CALLBACK ClndDialogProc(HWND hWn case WM_COMMAND: switch(LOWORD(wp)) { case IDOK: - b = GetDlgItemCheck(hWnd, IDC_CLNDREAL); + b = (UINT8)GetDlgItemCheck(hWnd, IDC_CLNDREAL); if (np2cfg.calendar != b) { np2cfg.calendar = b; sysmng_update(SYS_UPDATECFG);