Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f5f2964
GetTickCount()をGetTickCount64()に置き換え
m-tmatma Jun 2, 2026
ae75417
TTLマクロに64ビット整数型(int64)を追加
m-tmatma Jun 4, 2026
7861672
ビルドエラー修正: extern"C"オーバーロード問題と型不一致を解消
m-tmatma Jun 4, 2026
b494100
ビルドエラー修正: GetStrVal2のint VarIdをlong longに変更
m-tmatma Jun 4, 2026
bed1442
uptime を int, uptime64 を int64 専用コマンドに分離
m-tmatma Jun 4, 2026
c344e78
空行の修正
m-tmatma Jun 4, 2026
1b8bc93
uptime64 のテスト ttl
m-tmatma Jun 4, 2026
55e4cba
uptime コマンドのテスト TTL を追加
m-tmatma Jun 4, 2026
fc8ba12
wait_timeout.ttl を uptime64_test.ttl に改名
m-tmatma Jun 4, 2026
bd11ce7
int64 変数の算術・比較テスト TTL を追加
m-tmatma Jun 4, 2026
761ffa9
Add uptime64 command documentation and tests
m-tmatma Jun 4, 2026
50738a2
Update uptime command references in documentation to use uptime64
m-tmatma Jun 4, 2026
66569e8
Add HlpMacroCommandUptime64 references in documentation and help ID
m-tmatma Jun 4, 2026
c379919
Update uptime64 documentation titles in English and Japanese
m-tmatma Jun 4, 2026
801706b
Update syntax for uptime64 command in English and Japanese documentation
m-tmatma Jun 4, 2026
fdc9f39
Update macro syntax for uptime64 command in English and Japanese docu…
m-tmatma Jun 4, 2026
bc64af0
Fix minor typographical error in Japanese documentation for uptime64 …
m-tmatma Jun 4, 2026
5cc9e60
整数型を64bitに拡張し int64型・uptime64コマンドを廃止
m-tmatma Jun 8, 2026
2040a4a
整数リテラルとして 64bit 変数を受け入れる
m-tmatma Jun 8, 2026
bfc7383
ドキュメント: 整数型の範囲を 32bit から 64bit に更新
m-tmatma Jun 8, 2026
e7162b4
doc/en/teraterm.hhp: Shift-JIS バイト列の破損を修復
m-tmatma Jun 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions TTProxy/ProxyWSockHook.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ class ProxyWSockHook {
in_addr addr;
struct in6_addr addr6;
char* buffer;
DWORD time;
ULONGLONG time;
ConnectionInfo(ProxyInfo& proxy, String realhost):proxy(proxy), realhost(realhost), buffer(NULL) {
}
~ConnectionInfo() {
Expand Down Expand Up @@ -664,7 +664,7 @@ class ProxyWSockHook {
ConnectionInfo* info = table.get(url);
::LeaveCriticalSection(&section);
if (info != NULL) {
info->time = ::GetTickCount();
info->time = ::GetTickCount64();
return info;
}
ProxyInfo proxy;
Expand All @@ -688,8 +688,8 @@ class ProxyWSockHook {
}
}
if (i >= countof(list)) {
DWORD now = ::GetTickCount();
DWORD max = 0;
ULONGLONG now = ::GetTickCount64();
ULONGLONG max = 0;
int index = -1;
for (i = 0; i < countof(list); i++) {
if (list[i] != NULL) {
Expand All @@ -709,7 +709,7 @@ class ProxyWSockHook {
info->addr6.s6_addr[11] = 0xff;
info->addr6.s6_addr[15] = i + 1;

info->time = ::GetTickCount();
info->time = ::GetTickCount64();
return info;
}
};
Expand Down
3 changes: 2 additions & 1 deletion doc/en/html/macro/command/uptime.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ <h2>Remarks</h2>
</p>

<p>
The time wraps around to zero if the system is run continuously for 49.7 days.
Since version 5.7.0, the value is stored as a 64-bit integer,
so it will not wrap around even if the system is run continuously for more than 49.7 days.
</p>


Expand Down
2 changes: 1 addition & 1 deletion doc/en/html/macro/syntax/types.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h1>Types</h1>

<h2 id="Integer">1) Integer</h2>
<p>
Signed 32 bit, from -2147483648 to 2147483647.<br />
Signed 64 bit, from -9223372036854775808 to 9223372036854775807.<br />
Floating point operation is not supported.
</p>

Expand Down
2 changes: 1 addition & 1 deletion doc/ja/html/macro/command/uptime.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1>uptime</h1>
</p>

<p>
��ғ����Ԃ�49�����o�߂���ƁA0�ɖ߂�B
o�[�W����5.7.0�ȍ~��64�r�b�g�����Ƃ��Ċi�[���邽�߁A49���𒴂��Ă�0�ɖ߂邱�Ƃ͂Ȃ��B
</p>


Expand Down
2 changes: 1 addition & 1 deletion doc/ja/html/macro/syntax/types.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<h2 id="Integer">1) ����</h2>
<p>
�����t�� 32 bit�A-2147483648����2147483647�܂ŁB<br />
�����t�� 64 bit�A-9223372036854775808����9223372036854775807�܂ŁB<br />
���������_�͖��T�|�[�g�B
</p>

Expand Down
2 changes: 1 addition & 1 deletion teraterm/common/compat_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ static HWND WINAPI GetConsoleWindowLocal(void)
}

// Format a "unique" NewWindowTitle.
wsprintfA(pszNewWindowTitle, "%d/%d", GetTickCount(), GetCurrentProcessId());
wsprintfA(pszNewWindowTitle, "%I64u/%d", GetTickCount64(), GetCurrentProcessId());

// Change current window title.
SetConsoleTitleA(pszNewWindowTitle);
Expand Down
17 changes: 9 additions & 8 deletions teraterm/common/dlglib.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,14 @@ void SetDlgPercent(HWND HDlg, int id_Item, int id_Progress, LONG a, LONG b, int
}
}

void SetDlgTime(HWND HDlg, int id_Item, DWORD stime, int bytes)
void SetDlgTime(HWND HDlg, int id_Item, ULONGLONG stime, int bytes)
{
static int prev_elapsed;
int elapsed, rate;
static ULONGLONG prev_elapsed;
ULONGLONG elapsed;
int rate;
wchar_t buff[64];

elapsed = (GetTickCount() - stime) / 1000;
elapsed = (GetTickCount64() - stime) / 1000;

if (elapsed == 0) {
prev_elapsed = 0;
Expand All @@ -172,15 +173,15 @@ void SetDlgTime(HWND HDlg, int id_Item, DWORD stime, int bytes)
}
prev_elapsed = elapsed;

rate = bytes / elapsed;
rate = (int)(bytes / elapsed);
if (rate < 1200) {
_snwprintf_s(buff, _countof(buff), _TRUNCATE, L"%d:%02d (%dBytes/s)", elapsed / 60, elapsed % 60, rate);
_snwprintf_s(buff, _countof(buff), _TRUNCATE, L"%llu:%02llu (%dBytes/s)", elapsed / 60, elapsed % 60, rate);
}
else if (rate < 1200000) {
_snwprintf_s(buff, _countof(buff), _TRUNCATE, L"%d:%02d (%d.%02dKB/s)", elapsed / 60, elapsed % 60, rate / 1000, rate / 10 % 100);
_snwprintf_s(buff, _countof(buff), _TRUNCATE, L"%llu:%02llu (%d.%02dKB/s)", elapsed / 60, elapsed % 60, rate / 1000, rate / 10 % 100);
}
else {
_snwprintf_s(buff, _countof(buff), _TRUNCATE, L"%d:%02d (%d.%02dMB/s)", elapsed / 60, elapsed % 60, rate / (1000 * 1000), rate / 10000 % 100);
_snwprintf_s(buff, _countof(buff), _TRUNCATE, L"%llu:%02llu (%d.%02dMB/s)", elapsed / 60, elapsed % 60, rate / (1000 * 1000), rate / 10000 % 100);
}

SetDlgItemTextW(HDlg, id_Item, buff);
Expand Down
2 changes: 1 addition & 1 deletion teraterm/common/dlglib.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void SetRB(HWND HDlg, int R, int FirstId, int LastId);
void GetRB(HWND HDlg, LPWORD R, int FirstId, int LastId);
void SetDlgNum(HWND HDlg, int id_Item, LONG Num);
void SetDlgPercent(HWND HDlg, int id_Item, int id_Progress, LONG a, LONG b, int *prog);
void SetDlgTime(HWND HDlg, int id_Item, DWORD elapsed, int bytes);
void SetDlgTime(HWND HDlg, int id_Item, ULONGLONG elapsed, int bytes);
void SetDropDownList(HWND HDlg, int Id_Item, const char *List[], int nsel);
void SetDropDownListW(HWND HDlg, int Id_Item, const wchar_t *List[], int nsel);
LONG GetCurSel(HWND HDlg, int Id_Item);
Expand Down
14 changes: 7 additions & 7 deletions teraterm/common/ttlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,24 +956,24 @@ char *mctimelocal(const char *format, BOOL utc_flag)
* @return 経過時間の文字列
* 不要になったらfree()すること
*/
char *strelapsed(DWORD start_time)
char *strelapsed(ULONGLONG start_time)
{
size_t sizeof_strtime = 20;
char *strtime = malloc(sizeof_strtime);
int days, hours, minutes, seconds, msecs;
DWORD delta = GetTickCount() - start_time;
ULONGLONG delta = GetTickCount64() - start_time;

msecs = delta % 1000;
msecs = (int)(delta % 1000);
delta /= 1000;

seconds = delta % 60;
seconds = (int)(delta % 60);
delta /= 60;

minutes = delta % 60;
minutes = (int)(delta % 60);
delta /= 60;

hours = delta % 24;
days = delta / 24;
hours = (int)(delta % 24);
days = (int)(delta / 24);

_snprintf_s(strtime, sizeof_strtime, _TRUNCATE,
"%d %02d:%02d:%02d.%03d",
Expand Down
2 changes: 1 addition & 1 deletion teraterm/common/ttlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ DllExport BOOL HasMultiMonitorSupport();
DllExport BOOL HasDnsQuery();
DllExport BOOL HasBalloonTipSupport();
DllExport char *mctimelocal(const char *format, BOOL utc_flag);
char *strelapsed(DWORD start_time);
char *strelapsed(ULONGLONG start_time);

void b64encode(PCHAR dst, int dsize, PCHAR src, int len);
DllExport int b64decode(PCHAR dst, int dsize, PCHAR src);
Expand Down
2 changes: 1 addition & 1 deletion teraterm/common/tttypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ typedef struct {

void *NotifyIcon;

DWORD ConnectedTime;
ULONGLONG ConnectedTime;

void (*Log1Byte)(BYTE b);
void (*Log1Bin)(BYTE b);
Expand Down
8 changes: 4 additions & 4 deletions teraterm/teraterm/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static BOOL BoxSelect; // TRUE=矩形選択 / FALSE=行選択
static POINT ClickCell; // クリックした文字cell
static POINT SelectStartOld; // 描画した選択領域、start
static POINT SelectEndOld; // 描画した選択領域、end
static DWORD SelectStartTime;
static ULONGLONG SelectStartTime;
static POINT DblClkStart;
static POINT DblClkEnd;

Expand Down Expand Up @@ -4749,7 +4749,7 @@ void BuffStartSelect(int Xw, int Yw, BOOL Box, BOOL Shift)
Selected = FALSE;

// 選択開始ガード
SelectStartTime = GetTickCount();
SelectStartTime = GetTickCount64();
Selecting = FALSE;

// push位置
Expand Down Expand Up @@ -4778,7 +4778,7 @@ void BuffChangeSelect(int Xw, int Yw, int NClick)

if (!Selecting) {
// 選択ガード?
if (GetTickCount() - SelectStartTime < ts.SelectStartDelay) {
if (GetTickCount64() - SelectStartTime < ts.SelectStartDelay) {
// ガード中
return;
}
Expand Down Expand Up @@ -4889,7 +4889,7 @@ void BuffEndSelect(int Xw, int Yw)
(void)Xw;
(void)Yw;
if (!Selecting) {
if (GetTickCount() - SelectStartTime < ts.SelectStartDelay) {
if (GetTickCount64() - SelectStartTime < ts.SelectStartDelay) {
// ガード時間以内なら
// 選択領域解除
SelectEnd = SelectStart;
Expand Down
2 changes: 1 addition & 1 deletion teraterm/teraterm/commlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ void CommStart(PComVar cv, LONG lParam, PTTSet ts)
break;
}
cv->Ready = TRUE;
cv->ConnectedTime = GetTickCount();
cv->ConnectedTime = GetTickCount64();
}

BOOL CommCanClose(PComVar cv)
Expand Down
4 changes: 2 additions & 2 deletions teraterm/teraterm/filesys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ typedef struct {
LONG FileSize; // uint64_t FileSize; TODO
LONG ByteCount; // uint64_t ByteCount;

DWORD StartTime;
ULONGLONG StartTime;
BOOL FilePause;

BOOL FileRetrySend, FileRetryEcho, FileCRSend, FileReadEOF, BinaryMode;
Expand Down Expand Up @@ -118,7 +118,7 @@ static BOOL OpenFTDlg(PFileVar fv)
free(DlgCaption);

fv->FilePause = FALSE;
fv->StartTime = GetTickCount();
fv->StartTime = GetTickCount64();
fv->SendDlg = FTDlg; /* File send */

return TRUE;
Expand Down
4 changes: 2 additions & 2 deletions teraterm/teraterm/filesys_log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ typedef struct {
LONG FileSize; // ? 使っていない
LONG ByteCount; // ファイルサイズ

DWORD StartTime;
ULONGLONG StartTime;

enum enumLineEnd eLineEnd;

Expand Down Expand Up @@ -406,7 +406,7 @@ static BOOL LogStart(PFileVar fv, const wchar_t *fname)
}

fv->IsPause = FALSE;
fv->StartTime = GetTickCount();
fv->StartTime = GetTickCount64();

if (ts.DeferredLogWriteMode) {
StartThread(fv);
Expand Down
2 changes: 1 addition & 1 deletion teraterm/teraterm/filesys_proto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static PFileVarProto FileVar = NULL;
static PProtoDlg PtDlg = NULL;
static BOOL cv_ProtoFlag = FALSE;

static void _SetDlgTime(TFileVarProto *fv, DWORD elapsed, int bytes)
static void _SetDlgTime(TFileVarProto *fv, ULONGLONG elapsed, int bytes)
{
SetDlgTime(fv->HWin, IDC_PROTOELAPSEDTIME, elapsed, bytes);
}
Expand Down
2 changes: 1 addition & 1 deletion teraterm/teraterm/filesys_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ typedef TFileVarProto *PFileVarProto;
// UIなど情報表示用関数
typedef struct InfoOp_ {
void (*InitDlgProgress)(struct FileVarProto *fv, int *CurProgStat);
void (*SetDlgTime)(struct FileVarProto *fv, DWORD elapsed, int bytes);
void (*SetDlgTime)(struct FileVarProto *fv, ULONGLONG elapsed, int bytes);
void (*SetDlgPacketNum)(struct FileVarProto *fv, LONG Num);
void (*SetDlgByteCount)(struct FileVarProto *fv, LONG Num);
void (*SetDlgPercent)(struct FileVarProto *fv, LONG a, LONG b, int *p);
Expand Down
16 changes: 8 additions & 8 deletions teraterm/teraterm/ftdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,31 +151,31 @@ void CFileTransDlg::ChangeButton(BOOL PauseFlag)
}
}

void CFileTransDlg::RefreshNum(DWORD StartTime, LONG FileSize, LONG ByteCount)
void CFileTransDlg::RefreshNum(ULONGLONG StartTime, LONG FileSize, LONG ByteCount)
{
char NumStr[24];
double rate;
int rate2;
static DWORD prev_elapsed;
DWORD elapsed;
static ULONGLONG prev_elapsed;
ULONGLONG elapsed;

if (OpId == OpSendFile) {
if (StartTime == 0) {
SetDlgItemText(IDC_TRANS_ETIME, "0:00");
prev_elapsed = 0;
}
else {
elapsed = (GetTickCount() - StartTime) / 1000;
elapsed = (GetTickCount64() - StartTime) / 1000;
if (elapsed != prev_elapsed && elapsed != 0) {
rate2 = ByteCount / elapsed;
rate2 = (int)(ByteCount / elapsed);
if (rate2 < 1200) {
_snprintf_s(NumStr, sizeof(NumStr), _TRUNCATE, "%d:%02d (%dBytes/s)", elapsed / 60, elapsed % 60, rate2);
_snprintf_s(NumStr, sizeof(NumStr), _TRUNCATE, "%llu:%02llu (%dBytes/s)", elapsed / 60, elapsed % 60, rate2);
}
else if (rate2 < 1200000) {
_snprintf_s(NumStr, sizeof(NumStr), _TRUNCATE, "%d:%02d (%d.%02dKB/s)", elapsed / 60, elapsed % 60, rate2 / 1000, rate2 / 10 % 100);
_snprintf_s(NumStr, sizeof(NumStr), _TRUNCATE, "%llu:%02llu (%d.%02dKB/s)", elapsed / 60, elapsed % 60, rate2 / 1000, rate2 / 10 % 100);
}
else {
_snprintf_s(NumStr, sizeof(NumStr), _TRUNCATE, "%d:%02d (%d.%02dMB/s)", elapsed / 60, elapsed % 60, rate2 / (1000*1000), rate2 / 10000 % 100);
_snprintf_s(NumStr, sizeof(NumStr), _TRUNCATE, "%llu:%02llu (%d.%02dMB/s)", elapsed / 60, elapsed % 60, rate2 / (1000*1000), rate2 / 10000 % 100);
}
SetDlgItemText(IDC_TRANS_ETIME, NumStr);
prev_elapsed = elapsed;
Expand Down
2 changes: 1 addition & 1 deletion teraterm/teraterm/ftdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class CFileTransDlg : public TTCDialog

BOOL Create(HINSTANCE hInstance, Info *info);
void ChangeButton(BOOL PauseFlag);
void RefreshNum(DWORD StartTime, LONG FileSize, LONG ByteCount);
void RefreshNum(ULONGLONG StartTime, LONG FileSize, LONG ByteCount);

private:
virtual BOOL OnCancel();
Expand Down
14 changes: 7 additions & 7 deletions teraterm/teraterm/ftdlg_lite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ class PrivateData : public TTCDialog
BOOL Pause;
BOOL check_2sec;
BOOL show;
DWORD prev_elapsed;
DWORD StartTime;
ULONGLONG prev_elapsed;
ULONGLONG StartTime;
BOOL HideDialog;

CFileTransLiteDlg::Observer *observer_;
Expand Down Expand Up @@ -215,7 +215,7 @@ BOOL CFileTransLiteDlg::Create(HINSTANCE hInstance, HWND hParent, const wchar_t
}

pData->SetDlgItemTextA(IDC_TRANS_ETIME, "0:00");
pData->StartTime = GetTickCount();
pData->StartTime = GetTickCount64();
pData->prev_elapsed = 0;

return Ok;
Expand All @@ -232,10 +232,10 @@ void CFileTransLiteDlg::RefreshNum(size_t ByteCount, size_t FileSize)
return;
}

const DWORD now = GetTickCount();
const ULONGLONG now = GetTickCount64();

if (!pData->check_2sec) {
DWORD elapsed_ms = now - pData->StartTime;
ULONGLONG elapsed_ms = now - pData->StartTime;
if (elapsed_ms > 2 * 1000) {
// 2sec経過
pData->check_2sec = TRUE;
Expand All @@ -247,10 +247,10 @@ void CFileTransLiteDlg::RefreshNum(size_t ByteCount, size_t FileSize)
}

char NumStr[24];
DWORD elapsed = (now - pData->StartTime) / 1000;
ULONGLONG elapsed = (now - pData->StartTime) / 1000;
if (elapsed != pData->prev_elapsed && elapsed != 0) {
char elapsed_str[24];
_snprintf_s(elapsed_str, sizeof(elapsed_str), _TRUNCATE, "%ld:%02ld",
_snprintf_s(elapsed_str, sizeof(elapsed_str), _TRUNCATE, "%llu:%02llu",
elapsed / 60, elapsed % 60);

char speed_str[24];
Expand Down
Loading