| version 1.3, 2003/10/31 03:40:10 | version 1.5, 2005/02/07 15:39:27 | 
| Line 10 | Line 10 | 
 | #include        "calendar.h" | #include        "calendar.h" | 
 |  |  | 
 |  |  | 
| static  BYTE    cbuf[8]; | static  UINT8   cbuf[8]; | 
 |  |  | 
 | typedef struct { | typedef struct { | 
 | UINT16  res; | UINT16  res; | 
| BYTE    min; | UINT8   min; | 
| BYTE    max; | UINT8   max; | 
 | } VIRCAL_T; | } VIRCAL_T; | 
 |  |  | 
 | static const VIRCAL_T vircal[6] = {     {IDC_VIRYEAR,   0x00, 0x99}, | static const VIRCAL_T vircal[6] = {     {IDC_VIRYEAR,   0x00, 0x99}, | 
| Line 26  static const VIRCAL_T vircal[6] = { {IDC | Line 26  static const VIRCAL_T vircal[6] = { {IDC | 
 | {IDC_VIRSECOND, 0x00, 0x59}}; | {IDC_VIRSECOND, 0x00, 0x59}}; | 
 |  |  | 
 |  |  | 
| static void set_cal2dlg(HWND hWnd, const BYTE *cbuf) { | static void set_cal2dlg(HWND hWnd, const UINT8 *cbuf) { | 
 |  |  | 
 | int             i; | int             i; | 
| char    work[8]; | TCHAR   work[8]; | 
 |  |  | 
 | for (i=0; i<6; i++) { | for (i=0; i<6; i++) { | 
 | if (i != 1) { | if (i != 1) { | 
| Line 52  static void vircalendar(HWND hWnd, BOOL | Line 52  static void vircalendar(HWND hWnd, BOOL | 
 | EnableWindow(GetDlgItem(hWnd, IDC_SETNOW), disp); | EnableWindow(GetDlgItem(hWnd, IDC_SETNOW), disp); | 
 | } | } | 
 |  |  | 
| static DWORD getbcd(char *str, int len) { | static UINT32 getbcd(char *str, int len) { | 
 |  |  | 
| DWORD   ret; | UINT32  ret; | 
| BYTE    c; | UINT8   c; | 
 |  |  | 
 | if (!(*str)) { | if (!(*str)) { | 
 | return(0xff); | return(0xff); | 
| Line 70  static DWORD getbcd(char *str, int len) | Line 70  static DWORD getbcd(char *str, int len) | 
 | return(0xff); | return(0xff); | 
 | } | } | 
 | ret <<= 4; | ret <<= 4; | 
| ret |= (BYTE)(c - '0'); | ret |= (UINT8)(c - '0'); | 
 | } | } | 
 | return(ret); | return(ret); | 
 | } | } | 
| Line 78  static DWORD getbcd(char *str, int len) | Line 78  static DWORD getbcd(char *str, int len) | 
 | LRESULT CALLBACK ClndDialogProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { | LRESULT CALLBACK ClndDialogProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { | 
 |  |  | 
 | char    work[32]; | char    work[32]; | 
| BYTE    b; | UINT8   b; | 
 | int             i; | int             i; | 
 | HWND    subwnd; | HWND    subwnd; | 
 |  |  | 
| Line 100  LRESULT CALLBACK ClndDialogProc(HWND hWn | Line 100  LRESULT CALLBACK ClndDialogProc(HWND hWn | 
 | return(FALSE); | return(FALSE); | 
 |  |  | 
 | case WM_COMMAND: | case WM_COMMAND: | 
| switch (LOWORD(wp)) { | switch(LOWORD(wp)) { | 
 | case IDOK: | case IDOK: | 
 | b = GetDlgItemCheck(hWnd, IDC_CLNDREAL); | b = GetDlgItemCheck(hWnd, IDC_CLNDREAL); | 
 | if (np2cfg.calendar != b) { | if (np2cfg.calendar != b) { | 
| Line 110  LRESULT CALLBACK ClndDialogProc(HWND hWn | Line 110  LRESULT CALLBACK ClndDialogProc(HWND hWn | 
 | for (i=0; i<6; i++) { | for (i=0; i<6; i++) { | 
 | GetDlgItemText(hWnd, vircal[i].res, | GetDlgItemText(hWnd, vircal[i].res, | 
 | work, sizeof(work)); | work, sizeof(work)); | 
| b = (BYTE)getbcd(work, 2); | b = (UINT8)getbcd(work, 2); | 
 | if ((b >= vircal[i].min) && (b <= vircal[i].max)) { | if ((b >= vircal[i].min) && (b <= vircal[i].max)) { | 
 | if (i == 1) { | if (i == 1) { | 
 | b = ((b & 0x10) * 10) + (b << 4); | b = ((b & 0x10) * 10) + (b << 4); |