Skip to content

GetTickCount64()への置き換えとTTLマクロへの64ビット整数型(int64) とコマンド(uptime64)追加#1333

Open
m-tmatma wants to merge 17 commits into
TeraTermProject:mainfrom
m-tmatma:feature/ttl_int64
Open

GetTickCount64()への置き換えとTTLマクロへの64ビット整数型(int64) とコマンド(uptime64)追加#1333
m-tmatma wants to merge 17 commits into
TeraTermProject:mainfrom
m-tmatma:feature/ttl_int64

Conversation

@m-tmatma

@m-tmatma m-tmatma commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

GetTickCount()をGetTickCount64()に置き換え

  • GetTickCount()(32bit、約49.7日でオーバーフロー)をGetTickCount64()(64bit)に全面置き換え
  • 関連する変数の型をDWORDからULONGLONGに変更
  • CheckTimeout()のDWORDオーバーフロー対策コード(49.7日ラップアラウンド処理)を削除して簡略化
  • ttmenc.cLOWORD(GetTickCount())、フォーマット文字列%d%lluなども合わせて修正

TTLマクロに64ビット整数型(int64)とuptime64コマンドを追加

  • int64 varname 構文で64ビット整数変数を宣言できるようにした
  • uptime64 varname コマンドを新規追加。int64 変数に OS 起動からの経過時間(ミリ秒)を64ビットで格納
  • uptime は従来通り下位32ビットのみ格納(既存動作を維持)
  • 式評価器(GetExpression)の内部型を int から long long に変更し、int64 変数の算術・比較が可能
  • uptime64 コマンドのドキュメント(英語・日本語)を追加
  • ヘルプID(HlpMacroCommandUptime64)を追加

制約事項

  • GetTickCount64() は Windows Vista 以降で利用可能な API です。Windows XP 以前はサポート対象外となります。
  • int64 変数は宣言が必要(int64 varname)。宣言なしでは通常の int 変数として生成される
  • 配列型(intdim)の64ビット版は未対応

変更ファイル一覧

カテゴリ ファイル
ヘッダー ssh.h, tttypes.h, filesys_proto.h, dlglib.h, ftdlg.h, vtwin.h, ttlib.h
ファイル転送 bplus.c, quickvan.c, raw.c, xmodem.c, ymodem.c, zmodem.c, kermit.c
UI/ダイアログ dlglib.c, ftdlg.cpp, ftdlg_lite.cpp, filesys_proto.cpp
コア buffer.c, vtterm.c, vtwin.cpp, teraterm.cpp, commlib.c
マクロ ttl.cpp, ttmenc.c, ttmparse.cpp, ttmparse.h
SSH/SCP ssh.c, ssh.h, ttxssh.c
その他 compat_win.cpp, ttlib.c, ProxyWSockHook.h, sendmem.cpp, filesys.cpp, filesys_log.cpp
ドキュメント doc/en/html/macro/command/uptime64.html, doc/ja/html/macro/command/uptime64.html, doc/en/teraterm.hhc, doc/ja/teraterm.hhc, doc/en/teraterm.hhp, doc/ja/teraterm.hhp
ヘルプID teraterm/common/helpid.h
テスト tests/uptime_test.ttl, tests/uptime64_test.ttl, tests/uptime64.ttl, tests/wait_timeout_connected.ttl, tests/int64_arith_test.ttl

Test plan

  • ビルドが通ることを確認
  • ファイル転送(ZMODEM/XMODEM/YMODEM/Kermit/B+/QuickVAN)が正常動作すること
  • SCPファイル転送の進捗ダイアログが正常表示されること
  • マクロのタイムアウト処理(wait/waitregex等)が正常動作すること
  • OS起動から49.7日以上経過しても正しく経過時間が取得できること
  • int64 x で変数が宣言できること
  • uptime64 x で64ビット値が格納されること
  • int64 変数同士の算術(加減乗除)・比較が正常動作すること(tests/int64_arith_test.ttl
  • tests/uptime64_test.ttl を実行し OK メッセージが表示されること
  • tests/uptime64.ttl を実行し OK メッセージが表示されること
  • tests/uptime_test.ttl を実行し OK メッセージが表示されること
  • tests/wait_timeout_connected.ttl を接続済みセッションで実行し OK メッセージが表示されること
  • 既存の uptime コマンドが従来通り動作すること(int 変数に下位32ビット格納)

🤖 Generated with Claude Code

m-tmatma and others added 6 commits June 2, 2026 16:27
49日でオーバーフローするGetTickCount()をGetTickCount64()に置き換え。
関連する変数の型をDWORDからULONGLONGに変更し、CheckTimeout()の
DWORDオーバーフロー対策コードを削除して簡略化。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
`int64 varname` 構文で64ビット整数変数を宣言できるようにし、
`uptime` コマンドがTypInteger64変数に対して64ビット全体を格納するよう対応。
これにより OS 起動から 49.7 日以上経過した環境でも正確な経過時間計測が可能。

- ttmparse.h/cpp: TypInteger64型追加、式評価器をlong longに変更、
  NewInt64Var/GetIntVal(int*)オーバーロード追加
- ttl.cpp: TTLInt64Decl追加、TTLUptime 64bit対応、ExecCmndにTypInteger64代入処理追加
- tests/wait_timeout.ttl: int64変数を使った経過時間テストを追加

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- GetIntVal/GetVarTypeのint*オーバーロードをextern"C"非互換のため削除
- GetIntVal実装をint*シグネチャに戻し、内部でlong longを使用してlong longに truncate
- GetVarType実装をint*シグネチャに戻す
- GetExpressionを直接呼ばないlong long Valローカル変数をint Valに戻す
- TTLWait内のGetExpression呼び出し用Valをlong longに修正

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GetExpressionがlong long*を期待するため、GetStrVal2内のVarIdを
long longに変更し、TypInteger64のstring変換も対応。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- uptime: 従来通り下位32ビットのみ格納(既存動作を維持)
- uptime64: 新規コマンド。int64変数に64ビット全体を格納し、
  OS起動から49.7日以上経過しても正確な時刻取得が可能
- wait_timeout.ttl: uptime → uptime64 に変更

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@m-tmatma m-tmatma changed the title TTLマクロに64ビット整数型(int64)とuptime64コマンドを追加 GetTickCount64()への置き換えとTTLマクロへの64ビット整数型(int64/uptime64)追加 Jun 4, 2026
m-tmatma and others added 11 commits June 4, 2026 15:06
wait_timeout.ttl と同じ構造で、uptime(32bit int版)が
3秒の pause で正確に経過時間を計測できることを確認する。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
テスト内容(uptime64コマンドの動作確認)に合わせてファイル名を変更。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
32ビットを超える値($80000000, $100000000, 10000000000 等)を使い、
int64 の加減乗除・剰余・比較演算が正しく動作することを確認する。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Introduced new HTML documentation for the uptime64 command in both English and Japanese, detailing its usage and providing examples.
- Updated the Tera Term Help Contents (HHC) files to include references to the new uptime64 command.
- Added a test script for uptime64 to verify its functionality without requiring a connection.

This enhances the usability and accessibility of the uptime64 command for users.
- Changed instances of 'uptime varend' to 'uptime64 varend' in both English and Japanese documentation files for consistency and accuracy.
- This ensures that the documentation correctly reflects the usage of the uptime64 command.
- Added references for the new uptime64 command in both English and Japanese documentation files.
- Updated the help ID file to include the new command's identifier, ensuring consistency across the project.
- Changed the title and header from 'uptime' to 'uptime64' in both English and Japanese HTML documentation files to accurately reflect the command's name.
- This ensures consistency and clarity in the documentation for users.
- Modified the macro syntax in both English and Japanese HTML documentation files to reflect the correct usage of the uptime64 command, changing 'uptime &lt;intvar&gt;' to 'int64 var' and 'uptime64 &lt;var&gt;'.
- This update enhances clarity and accuracy in the documentation for users.
…mentation

- Changed 'int64 var' to 'int64 &lt;var&gt;' in both English and Japanese HTML documentation files to improve clarity and accuracy in the usage of the uptime64 command.
- This update ensures that users have the correct syntax for the command.
@m-tmatma m-tmatma marked this pull request as ready for review June 4, 2026 07:58
@m-tmatma m-tmatma changed the title GetTickCount64()への置き換えとTTLマクロへの64ビット整数型(int64/uptime64)追加 GetTickCount64()への置き換えとTTLマクロへの64ビット整数型(int64) とコマンド uptime64)追加 Jun 5, 2026
@m-tmatma m-tmatma changed the title GetTickCount64()への置き換えとTTLマクロへの64ビット整数型(int64) とコマンド uptime64)追加 GetTickCount64()への置き換えとTTLマクロへの64ビット整数型(int64) とコマンド(uptime64)追加 Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant