[Bf-committers] math lib reorganization

Brecht Van Lommel brecht at blender.org
Sun Nov 8 01:53:55 CET 2009


Hi,

I've made a patch to reorganize BLI_arithb.h, the Blender C math
library which has various consistency issues.

What I've done is splitting it up into multiple BLI_math_*.h files,
renaming functions according the proposal by Ton/Zr a few years ago,
and making function parameter order consistent. All the code is still
in arithb.c, need to split up into .c files according to the .h files
still. Mainly the tricky thing was changing all the source code that
uses these functions to rename them and change the parameter order,
which was done using a python script.

The problem is merging these changes into branches, as it would give
many merge conflicts, and new code that is likely also using the math
functions. I think it's doable though, the following steps should make
this possible without unnecessary conflicts:
* merge up to the math lib refactor commit
* run the python script to do the renaming
* merge the following revisions

There's more changes I'd like to do, like making some functions
inline, parameters const, adding functions, and also changing a few
infrequently used functions more drastically .. but these should not
affect other source code as much and give merging issues, so could be
done afterwards still.

I don't want to interfere with 2.5 beta 0, so committing this can be
postponed. I think this is fairly low risk though, most likely bug
this would cause is if I've made a mistake in function parameter
reordering, double checked the orders but it's still possible of
course. Using my simple rendering test suite also survives. I guess
this depends on the beta 0 schedule, but personally I think it's quite
safe to commit if we don't plan a beta 0 in the next week.

Here's the full patch with the new header files and all source changes
included to test, and the script I used:
http://users.pandora.be/blendix/arithb_reorganization.txt
http://users.pandora.be/blendix/arithb_refactor.py

Brecht.


More information about the Bf-committers mailing list