svnno****@sourc*****
svnno****@sourc*****
2017年 6月 26日 (月) 19:38:16 JST
Revision: 6822 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6822 Author: doda Date: 2017-06-26 19:38:15 +0900 (Mon, 26 Jun 2017) Log Message: ----------- デバッグし易さの為 enum に変更 Modified Paths: -------------- trunk/ttssh2/ttxssh/fwd.h trunk/ttssh2/ttxssh/fwdui.c -------------- next part -------------- Modified: trunk/ttssh2/ttxssh/fwd.h =================================================================== --- trunk/ttssh2/ttxssh/fwd.h 2017-06-26 10:38:04 UTC (rev 6821) +++ trunk/ttssh2/ttxssh/fwd.h 2017-06-26 10:38:15 UTC (rev 6822) @@ -72,9 +72,9 @@ } FWDChannel; /* Request types */ -#define FWD_LOCAL_TO_REMOTE 1 -#define FWD_REMOTE_TO_LOCAL 2 -#define FWD_REMOTE_X11_TO_LOCAL 3 +typedef enum { + FWD_NONE, FWD_LOCAL_TO_REMOTE, FWD_REMOTE_TO_LOCAL, FWD_REMOTE_X11_TO_LOCAL +} FWDType; /* If 'type' is FWD_REMOTE_X11_TO_LOCAL, then from_port must be -1, to_port must be 6000 + display number, and to_host must @@ -84,7 +84,7 @@ at one time. */ typedef struct { - int type; + FWDType type; int from_port; char from_port_name[32]; int to_port; Modified: trunk/ttssh2/ttxssh/fwdui.c =================================================================== --- trunk/ttssh2/ttxssh/fwdui.c 2017-06-26 10:38:04 UTC (rev 6821) +++ trunk/ttssh2/ttxssh/fwdui.c 2017-06-26 10:38:15 UTC (rev 6822) @@ -989,7 +989,7 @@ } } -static void shift_over_input(HWND dlg, int type, WORD rtl_item, +static void shift_over_input(HWND dlg, FWDType type, WORD rtl_item, WORD ltr_item) { HWND shift_from; @@ -1018,7 +1018,7 @@ static void set_dir_options_status(HWND dlg) { - int type = IsDlgButtonChecked(dlg, IDC_SSHFWDREMOTETOLOCAL) + FWDType type = IsDlgButtonChecked(dlg, IDC_SSHFWDREMOTETOLOCAL) ? FWD_REMOTE_TO_LOCAL : FWD_LOCAL_TO_REMOTE; shift_over_input(dlg, type, IDC_SSHRTLFROMPORT, IDC_SSHLTRFROMPORT); @@ -1106,7 +1106,7 @@ fill_service_names(dlg, IDC_SSHLTRTOPORT); } -static void grab_control_text(HWND dlg, int type, WORD rtl_item, +static void grab_control_text(HWND dlg, FWDType type, WORD rtl_item, WORD ltr_item, char *buf, int bufsize) { GetDlgItemText(dlg, type == FWD_REMOTE_TO_LOCAL ? rtl_item : ltr_item, @@ -1118,7 +1118,7 @@ HWND dlg) { FWDRequestSpec new_spec; - int type = IsDlgButtonChecked(dlg, IDC_SSHFWDREMOTETOLOCAL) + FWDType type = IsDlgButtonChecked(dlg, IDC_SSHFWDREMOTETOLOCAL) ? FWD_REMOTE_TO_LOCAL : FWD_LOCAL_TO_REMOTE; char buf[1024];