Hello, Thanks a lot Julia for your fast and efficient answer !
Le samedi 22 septembre 2012 à 19:08 +0200, Julia Lawall a écrit :
> A proposed patch that fixes this and some other trailing whitespace
> problems is attached. I still need to check that it does not break
> anything, so let me know if there are any new problems.
First of all, it fixes the whitespace issue described in my previous
mail.
I've runned all my cocci test with this patch applied and no problem
appears.
I've only one issue left regarding formatting but this is dependant of
my indentation style and can not be considered as a real problem. The
issue is that the transformation modifies my indentation like shows in
the following example:
- if (new_pe == NULL) {
- return NULL;
- }
+ if (unlikely(new_pe == NULL))
+ {
+ return NULL;
+ }
I obtain a code which is not with the good coding style and need to be
reindented. Is there a way to specify to coccinelle we want to use a
specific model of indentation ?
BR,
>
> julia
>
> On Sat, 22 Sep 2012, Eric Leblond wrote:
>
> > Hello,
> >
> > I've just wrote a really simple SMPL (attached to the mail). It makes a
> > modification on the code which is the following:
> >
> > - if (x == NULL) S1
> > + if (unlikely(x == NULL)) S1
> >
> > The result is semantically correct but there is spaces at end of line as
> > shown in the example below:
> >
> > @@ -173,8 +173,8 @@ DefragContextNew(void)
> > DefragContext *dc;
> >
> > dc = SCCalloc(1, sizeof(*dc));
> > - if (dc == NULL)
> > - return NULL;<- no space
> > + if (unlikely(dc == NULL))
> > + return NULL; <- 4 space here
> >
> > I've tried to look at coccinelle code but I'm unable to find a way to a
> > solution.
> >
> > Am I missing an option ?
> >
> > BR,
> > --
> > Eric Leblond
> >
> >
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Cocci mailing list [email protected] https://systeme.lip6.fr/mailman/listinfo/cocci
