All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] How can i rename a specific structure field?
@ 2014-10-02 20:12 jmiguel hernandez
  2014-10-02 20:22 ` Julia Lawall
  2014-10-02 20:44 ` Lars-Peter Clausen
  0 siblings, 2 replies; 7+ messages in thread
From: jmiguel hernandez @ 2014-10-02 20:12 UTC (permalink / raw)
  To: cocci

if i have this

typedef struct type1 {
  char8 a;
  char8 b;
  char8 c;
}

typedef struct _interface {
  type1 field1;
}interface;

and want to change to

typedef struct type1 {
  char8 d;
  char8 b;
  char8 c;
}

typedef struct _protocol {
  type1 *field1;
}interface;

interface *p

-p->field->a
+p->field->d

I have tried just changing field1 to field2. This gives parsing errors.

@@
typedef interface;
interface *p;
typedef type1;
type1 field1;
@@
<...
-p->field1
+p->fieldnew
...>

also, similar question. What if i want to change the type.

typedef struct _interface {
  type2 *field1;
}interface;

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20141002/89ff092a/attachment.html>

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

end of thread, other threads:[~2014-10-07  7:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-02 20:12 [Cocci] How can i rename a specific structure field? jmiguel hernandez
2014-10-02 20:22 ` Julia Lawall
2014-10-02 20:44 ` Lars-Peter Clausen
     [not found]   ` <CAHsAT8Knor4wG+398-BZ15Upwv1PWz=6VOGQvEXcHSGzimkD9Q@mail.gmail.com>
2014-10-06 17:11     ` [Cocci] Fwd: " jmiguel hernandez
2014-10-06 17:32       ` Julia Lawall
2014-10-06 18:14         ` jmiguel hernandez
2014-10-07  7:27           ` Julia Lawall

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.