Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


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



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.