Skip to content

マクロ整数型を 64-bit に拡張 (int64型・uptime64コマンドを廃止)#1343

Draft
m-tmatma wants to merge 21 commits into
TeraTermProject:mainfrom
m-tmatma:feature/no-new-int64
Draft

マクロ整数型を 64-bit に拡張 (int64型・uptime64コマンドを廃止)#1343
m-tmatma wants to merge 21 commits into
TeraTermProject:mainfrom
m-tmatma:feature/no-new-int64

Conversation

@m-tmatma

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

Copy link
Copy Markdown
Contributor

概要

TTL マクロの整数型を 32-bit から 64-bit (long long) に拡張します。
別途 int64 型や uptime64 コマンドを追加するのではなく、既存の整数型そのものを 64-bit 化することで、後方互換性を保ちつつ大きな値を扱えるようにします。

主な変更点

  • 整数型の 64-bit 化: TTL マクロの整数変数を intlong long に変更
  • int64 型の廃止: 別型として導入していた int64 型を削除し、通常の整数型が 64-bit に
  • uptime64 コマンドの廃止: uptime コマンドが 64-bit 値を返すようになったため uptime64 を削除
  • GetTickCount()GetTickCount64(): タイマー精度の向上
  • ドキュメント更新: 整数型の範囲説明を 32-bit から 64-bit に更新 (英語・日本語)
  • テスト追加: int64 算術・比較テスト TTL、uptime テスト TTL を追加

テスト計画

  • tests/int64_arith_test.ttl で算術・比較演算が正しく動作することを確認
  • tests/uptime_test.ttluptime コマンドが 64-bit 値を返すことを確認
  • 既存マクロの後方互換性 (32-bit 範囲内の整数演算) を確認
  • Windows 32-bit / 64-bit ビルドが通ることを確認

🤖 Generated with Claude Code

m-tmatma and others added 21 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>
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.
- TypInteger の内部表現を int から long long に変更し、すべての
  整数変数が宣言不要で64bitとして機能するようにした
- TypInteger64 型・NewInt64Var()・int64 キーワードを廃止
- uptime コマンドを GetTickCount64() の完全な64bit値を格納するよう変更し
  49.7日オーバーフロー制限を解消。uptime64 コマンドは uptime に統合し廃止
- sprintf2 の %d/%i/%o/%u/%x/%X が64bit値を正しく出力するよう
  内部で %lld 等に自動変換する処理を追加 (GetInt64Val 関数も追加)
- 関連ドキュメント(uptime64.html)・テストファイルを更新

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
TTLFor, TTLInt2Str, TTLStr2Int で GetIntVal (int) を
GetInt64Val (long long) に置き換え、64bit 整数リテラルを
切り捨てなく扱えるようにする。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
types.html (英語・日本語) の整数型の説明を
符号付き 32bit (-2147483648〜2147483647) から
符号付き 64bit (-9223372036854775808〜9223372036854775807) に修正する。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
前回の編集で Language= 行の Shift-JIS バイトが
UTF-8 置換文字 (U+FFFD) に化けていたのを元に戻す。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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