Page MenuHome

Split transform.c in multiple files
Needs ReviewPublic

Authored by Germano Cavalcante (mano-wii) on Sep 17 2019, 3:27 AM.



transform.c has now 9452 lines of code, so coders can get lost in the middle of so much code.
Therefore it would be good to start thinking of a way to split this file.
The suggestion of this patch is to split the file according to the transform mode/operator.
Since most modes have their own operator, the parallel codes in transfom_ops.c have also been moved to the corresponding file.
The downside of this change is that we now have 66 items in the transform/ folder.

Diff Detail

rB Blender
transform_refactor (branched from master)
Build Status
Buildable 4985
Build 4985: arc lint + arc unit

Event Timeline

Generally OK, although these names seem a bit long transform_op_mode_*.c

While each transform mode happens to be an operator, I don't think this needs to be in the file name.

Names in this patch:

  • transform_op.c
  • transform_op_mode_bend.c

Could be named:

  • transform_ops.c (keep current name) or transform_mode_utils.c.
  • transform_mode_bend.c

So we don't have to have transform_op_mode_ before every transform type.

  • Rename transform_op_mode_*.c to transform_mode_*.c;
  • Rename transform_op to transform_ops;
  • Rename transform_op_orientation to transform_ops_orientation;

Fine with me, but will leave it to Campbell to review the specifics.