# Sed script to rename C++ functions to start with a lowercase # letter. Scores about 90% of cases so some manual work remains. NOTE: # functions starting with two or more uppercase letters are ignored. # Class names should be left alone so skip ctor definitions. NOTE: # Catches template ctors too. /\([A-Z][a-z0-9_][a-z0-9A-Z_]*\)\(<.*>\)*::\1(/ { p d } # Change first letter of capitalised function name to lowercase in # declarations, definitions and calls. NOTE: This erroneously catches # declarations of capitalised variables initialised by arguments to # the ctor, e.g. MyClass MyVar(1, 2, 3);. s/\([[(.>:*/+-=%!&|?,; ]\)\([A-Z][a-z0-9_][a-z0-9_A-Z]*(\)/\1\l\2/g