Skip to content

refactor: CODING_STYLE準拠の型修正(int→int_fast16_t/int16_t/int_fixed等)#308

Merged
ainyan03 merged 5 commits into
mainfrom
claude/fleximg-codestyle-fix
Feb 7, 2026
Merged

refactor: CODING_STYLE準拠の型修正(int→int_fast16_t/int16_t/int_fixed等)#308
ainyan03 merged 5 commits into
mainfrom
claude/fleximg-codestyle-fix

Conversation

@ainyan03
Copy link
Copy Markdown
Owner

@ainyan03 ainyan03 commented Feb 7, 2026

Summary

フェーズ1: 固定小数点メンバを int_fixed 型に統一

  • AffinePrecomputed, SinkNode, SourceNode の Q16.16 メンバを int32_tint_fixed に変更

フェーズ2: 関数引数・メンバ変数の型修正

  • 関数引数: intint_fast16_t(14ファイル)
  • 構造体メンバ: intint16_t(RendererNode, BlurNode, MatteNode 等)

フェーズ3: ローカル変数・ループカウンタの型修正

  • auto + static_cast<int_fast16_t>(...) パターンでローカル変数を統一
  • ループカウンタは終端変数の型に一致

フェーズ4: 配列インデックス・メトリクス型の整理

  • EntryPool/RenderContext: ループカウンタを uint_fast8_t に統一
  • FormatMetrics: constexpr定数を uint_fast8_t に変更
  • PoolAllocator: 探索ループを size_t に統一
  • PerfMetrics: count系メンバを uint32_t に統一

Test plan

  • cd fleximg/test && make clean && make all_tests && ./all_tests — 160テスト全パス (67718 assertions)
  • Emscripten リリースビルド (./build.sh) — 成功
  • Emscripten デバッグビルド (./build.sh --debug) — 成功
  • M5Stack ビルド確認(手動)

AffinePrecomputed, SinkNode, SourceNodeの固定小数点値を
int32_t → int_fixedに変更。int_fixedはint32_tのエイリアスのため
バイナリ互換性に影響なし。型名で意図を明確化。
CODING_STYLE.mdに従い、関数引数はint→int_fast16_t、
構造体メンバはint→int16_tに統一。対象: viewport, image_buffer,
pixel_format, render_types, renderer_node, blur nodes, matte_node,
node, distributor_node, ninepatch_source_node, canvas_utils, perf_metrics
auto + static_cast<int_fast16_t>(...)パターンでローカル変数を統一。
ループカウンタは終端変数の型に一致させた。対象: matte_node,
vertical/horizontal_blur_node, renderer_node, sink_node, canvas_utils,
filters, image_buffer, viewport, node
EntryPool/RenderContextのループカウンタをuint_fast8_tに統一、
FormatMetrics定数をuint_fast8_tに、PoolAllocator探索をsize_tに、
PerfMetricsのcount系メンバをuint32_tに修正。CHANGELOGに記載追加。
FormatIdx/OpType定数のuint_fast8_t化に伴うbindings.cppのループカウンタ修正、
canvas_utils.hのtoStraight呼び出し時のint_fast16_t→size_tキャスト追加。
@ainyan03 ainyan03 merged commit 4de1fe2 into main Feb 7, 2026
5 checks passed
@ainyan03 ainyan03 deleted the claude/fleximg-codestyle-fix branch February 7, 2026 22:32
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