[U-Boot] [Patch v3] Consolidate bool type

York Sun yorksun at freescale.com
Thu Jan 24 19:49:31 CET 2013


On 01/24/2013 10:28 AM, Allen Martin wrote:
> On Thu, Jan 24, 2013 at 10:23:21AM -0800, York Sun wrote:
>> On 01/24/2013 10:14 AM, Scott Wood wrote:
>>>>>
>>>>
>>>> I thought I have replaced all #define, enum, typedef. I have left alone
>>>> those FALSE, False, false but add define like this
>>>>
>>>> +#include <stdbool.h>
>>>> +#define TRUE true
>>>> +#define FALSE false
>>>> +#define True true
>>>> +#define False false
>>>>
>>>> Isn't that enough?
>>>
>>> It's enough to make it build, but it would be better to fix the users.
>>>
>>
>> Let me try to run a script to replace all of them to "false" and "true".
>>
>> York
>>
>>
> 
> Try this:
> 
> $ find . -type f -name \*.h -print | xargs perl -pi -e 's/(\b)FALSE(\b)/$1false$2/g'
> $ find . -type f -name \*.h -print | xargs perl -pi -e 's/(\b)TRUE(\b)/$1true$2/g'
> $ find . -type f -name \*.c -print | xargs perl -pi -e 's/(\b)FALSE(\b)/$1false$2/g'
> $ find . -type f -name \*.c -print | xargs perl -pi -e 's/(\b)TRUE(\b)/$1true$2/g'
> $ find . -type f -name \*.h -print | xargs perl -pi -e 's/(\b)False(\b)/$1false$2/g'
> $ find . -type f -name \*.h -print | xargs perl -pi -e 's/(\b)True(\b)/$1true$2/g'
> $ find . -type f -name \*.c -print | xargs perl -pi -e 's/(\b)False(\b)/$1false$2/g'
> $ find . -type f -name \*.c -print | xargs perl -pi -e 's/(\b)True(\b)/$1true$2/g'
> 

Thanks. I used xargs sed -i "s/\bTrue\b/true/g" following your git grep.

York





More information about the U-Boot mailing list