linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] use c99 initializers in structures
@ 2014-08-23 11:20 Julia Lawall
  2014-08-23 11:20 ` [PATCH 1/9] [media] v4l: ti-vpe: " Julia Lawall
                   ` (9 more replies)
  0 siblings, 10 replies; 22+ messages in thread
From: Julia Lawall @ 2014-08-23 11:20 UTC (permalink / raw)
  To: dri-devel
  Cc: josh, kernel-janitors, linux-nfc, linux-wireless, linux-fbdev,
	linux-kernel, linux-media, linux-pwm, devel, linux-omap,
	rtc-linux

These patches add labels in the initializations of structure fields (c99
initializers).  The complete semantic patch thta makes this change is shown
below.  This rule ignores cases where the initialization is just 0 or NULL,
where some of the fields already use labels, and where there are nested
structures.

// <smpl>
@ok1@
identifier i1,i2;
position p;
@@

struct i1 i2@p = { \(0\|NULL\) };

@ok2@
identifier i1,i2,i3;
position p;
expression e;
@@

struct i1 i2@p = { ..., .i3 = e, ... };

@ok3@
identifier i1,i2;
position p;
@@

struct i1 i2@p = { ..., { ... }, ... };

@decl@
identifier i1,fld;
type T;
field list[n] fs;
@@

struct i1 {
 fs
 T fld;
 ...};

@bad@
identifier decl.i1,i2;
expression e;
position p != {ok1.p,ok2.p,ok3.p};
constant nm;
initializer list[decl.n] is;
position fix;
@@

struct i1 i2@p = { is,
(
 nm(...)
|
 e@fix
)
 ,...};

@@
identifier decl.i1,i2,decl.fld;
expression e;
position bad.p, bad.fix;
@@

struct i1 i2@p = { ...,
+ .fld = e
- e@fix
 ,...};
// </smpl>


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

end of thread, other threads:[~2014-08-26 10:43 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-23 11:20 [PATCH 0/9] use c99 initializers in structures Julia Lawall
2014-08-23 11:20 ` [PATCH 1/9] [media] v4l: ti-vpe: " Julia Lawall
2014-08-23 11:20 ` [PATCH 2/9] video: fbdev: matrox: " Julia Lawall
2014-08-23 11:20 ` [PATCH 3/9] pwm: lpss: " Julia Lawall
2014-08-25  9:44   ` Thierry Reding
2014-08-23 11:20 ` [PATCH 4/9] NFC: " Julia Lawall
2014-08-23 11:20 ` [PATCH 5/9] lustre: obdclass: " Julia Lawall
2014-08-23 11:20 ` [PATCH 6/9] drm: " Julia Lawall
2014-08-23 15:16   ` Josh Triplett
2014-08-23 16:09     ` [PATCH 6/9 v2] " Julia Lawall
2014-08-25 13:18       ` Daniel Vetter
2014-08-23 11:20 ` [PATCH 7/9] OMAPDSS: DSI: " Julia Lawall
2014-08-23 11:20 ` [PATCH 8/9] video: fbdev: aty: " Julia Lawall
2014-08-23 15:20   ` Josh Triplett
2014-08-23 15:32     ` Julia Lawall
2014-08-23 16:03       ` Josh Triplett
2014-08-25 10:16       ` Dan Carpenter
2014-08-23 15:50     ` [PATCH 8/9 v2] " Julia Lawall
2014-08-23 16:03       ` Josh Triplett
2014-08-26 10:43       ` Tomi Valkeinen
2014-08-23 11:20 ` [PATCH 9/9] rtc: " Julia Lawall
2014-08-23 15:21 ` [PATCH 0/9] " Josh Triplett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).