Refactor get/set_property to take the item as first argument
Originally reported by: dakas
Refactor get/set_property to take the item as first argument
This makes it possible in a future revision to make type-dependent
optimisations using memoisation techniques that cannot be factored
into member functions.
This consists of three commits, separately entered into the review so
that the humongous mechanical change in the middle commit can be
reviewed separately from the manual commits.
Commits are:
Issue 5882/1: Grob::flush_extent_cache: refactor del_property call
Issue 5882/2: Run script for get/set_property refactor
In order to allow for type-dependent speedups,
xxx->get_property ("prop") is converted to get_property (xxx, "prop").
The bulk of the work is done mechanically using the sed script
sed -i -n '1h
1!H
${x
s/\([a-z_A-Z][a-z_A-Z0-9]*\s*\(->\s*[a-z_A-Z][a-zA-Z_0-9]*\s*\|\.\s*[a-z_A-Z][a-zA-Z_0-9]*\s*\|\[[^]]*\]\s*\|([^()]*)\s*\|<[a-zA-Z_]\+>\s*\)*\)->\s*\(set_property\|get_property\|get_property_data\|get_object\|set_object\|get_pure_property\|get_maybe_pure_property\|del_property\)\(\s\+(\)/\3\4\1, /g
s/\(set_property\|get_property\|get_property_data\|get_object\|set_object\|get_pure_property\|get_maybe_pure_property\|del_property\)\(\s\+(\)"/\1\2this, "/g
p}' $(git ls-files '*.cc' '*.ll' '*.yy')
Issue 5882/3: Complete the set/get_property style conversion
This fixes oversights by the automated script and actually changes the
involved macros. Functionally, there is no difference yet.
http://codereview.appspot.com/573670043
Original URL: https://sourceforge.net/p/testlilyissues/issues/5882