チケット #44977

generate_packets.py: indent generated code only once needed

登録: 2022-07-02 06:03 最終更新: 2022-07-05 18:41

報告者:
担当者:
チケットの種類:
状況:
完了
コンポーネント:
マイルストーン:
優先度:
5 - 中
重要度:
5 - 中
解決法:
修正済み
ファイル:
1

詳細

Part of #43927. To make code-generating functions more reusable, each function should produce code that is as un-indented as possible, with callers using prefix() to indent as necessary; this way, the generated code can easily be used in different contexts where it needs different indentation.

チケットの履歴 (7 件中 3 件表示)

2022-07-02 06:03 更新者: alienvalkyrie
  • 新しいチケット "generate_packets.py: indent generated code only once needed" が作成されました
2022-07-02 06:07 更新者: alienvalkyrie
コメント

Note: This change is going to conflict with parts of hrm#745593 (by changing the indentation of code modified there). Need to figure out whether to delay this until after that, or whether that needs more changes that take longer anyway.

2022-07-03 22:07 更新者: cazfi
コメント

Reply To alienvalkyrie

Note: This change is going to conflict with parts of hrm#745593 (by changing the indentation of code modified there). Need to figure out whether to delay this until after that, or whether that needs more changes that take longer anyway.

One thing still in hrm#745593 touching generate_packets.py, and not related to the main issue of that ticket are the change to use FC_FREE() instead of free() + "... = NULL;" for some fields. Not sure if we want to do that, but if we do, it should go to separate ticket and then handle also other similar cases in generate_packets.py.

2022-07-04 00:08 更新者: alienvalkyrie
コメント

Reply To cazfi

Reply To alienvalkyrie

Note: This change is going to conflict with parts of hrm#745593 (by changing the indentation of code modified there). Need to figure out whether to delay this until after that, or whether that needs more changes that take longer anyway.

One thing still in hrm#745593 touching generate_packets.py, and not related to the main issue of that ticket are the change to use FC_FREE() instead of free() + "... = NULL;" for some fields. Not sure if we want to do that, but if we do, it should go to separate ticket and then handle also other similar cases in generate_packets.py.

As far as I can tell (based on the latest patch attached there), that's not the only change to be made to generate_packets.py, so extracting that into its own patch won't completely solve this conflict – but it's probably sensible anyway, given the number of such cases (and the fact that in one case, the ... = NULL; was forgotten) ~> #44993

2022-07-04 04:53 更新者: alienvalkyrie
  • 解決法なし から 受領 に更新されました
2022-07-05 18:41 更新者: alienvalkyrie
  • 状況オープン から 完了 に更新されました
  • 解決法受領 から 修正済み に更新されました

添付ファイルリスト

編集

ログインしていません。ログインしていない状態では、コメントに記載者の記録が残りません。 » ログインする