All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] Unwanted space added at end of line
@ 2012-09-22  8:29 Eric Leblond
  2012-09-22 14:43 ` Lars-Peter Clausen
  2012-09-22 17:08 ` Julia Lawall
  0 siblings, 2 replies; 10+ messages in thread
From: Eric Leblond @ 2012-09-22  8:29 UTC (permalink / raw)
  To: cocci

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@coccinelle code but I'm unable to find a way to a
solution.

Am I missing an option ?

BR,
--
Eric Leblond

-------------- next part --------------
@istested@
identifier x;
statement S1;
identifier func =~ "(SCMalloc|SCStrdup|SCCalloc)";
@@

x = func(...)
... when != x
- if (x == NULL) S1
+ if (unlikely(x == NULL)) S1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20120922/52ec3cfa/attachment.asc>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-09-23 22:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-22  8:29 [Cocci] Unwanted space added at end of line Eric Leblond
2012-09-22 14:43 ` Lars-Peter Clausen
2012-09-22 17:08 ` Julia Lawall
2012-09-22 22:27   ` Eric Leblond
2012-09-23  5:47     ` Julia Lawall
2012-09-23  9:24     ` Julia Lawall
2012-09-23 15:07       ` Eric Leblond
2012-09-23 15:14         ` Julia Lawall
2012-09-23 20:55           ` [Cocci] Clarification of work flows with content management systems SF Markus Elfring
2012-09-23 22:09             ` Jesper Louis Andersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.