On 2014-05-07 23:48, julien2412 wrote:
In fact, my primary goal was to clean this use of getCppuType because it was
reported by cppcheck (when they were used in if/else if blocks)
Then I wanted to remove all of them. The problem is there are 33 Opengrok
pages of these and I don't know enough about regexp to remove them quickly.
I tried things like this:
fgrep -lR 'getCppuType((const sal_Int32*)0)' |xargs -i sed -i
's/getCppuType[(][(]const sal_Int32[*])0)/cppu::UnoType<sal_Int32>::get()/g'
{}
But it's still too naive to get rid of them. (I wanted to put "const"
optional but didn't even find how to do it)

Any regexp wizard here?




This works for me:

git grep -lF "getCppuType((const sal_Int32*)0)" -- *.cxx | xargs perl -pi -w -e "s/getCppuType\(\(const sal_Int32\*\)0\)/cppu::UnoType\<sal_Int32\>::get\(\)/g;"

Disclaimer: http://www.peralex.com/disclaimer.html


_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to