On Sun, Sep 11, 2016 at 12:51 AM, Joe Perches wrote:
> On Sun, 2016-09-11 at 00:38 +0530, Bhumika Goyal wrote:
>> Replace ternary operators with macro 'max' as it is shorter
>> and thus increases code readability. Macro max returns
>> the maximum of the two compared values.
>> Done using coccinel
On Sun, 2016-09-11 at 00:38 +0530, Bhumika Goyal wrote:
> Replace ternary operators with macro 'max' as it is shorter
> and thus increases code readability. Macro max returns
> the maximum of the two compared values.
> Done using coccinelle:
>
> @@
> type T;
> T x;
> T y;
> @@
> (
> - x < y ? x :
Replace ternary operators with macro 'max' as it is shorter
and thus increases code readability. Macro max returns
the maximum of the two compared values.
Done using coccinelle:
@@
type T;
T x;
T y;
@@
(
- x < y ? x : y
+ min(x,y)
|
- x > y ? x : y
+ max(x,y)
)
Signed-off-by: Bhumika Goyal
---
3 matches
Mail list logo