Sign in
googlers
/
jrn
/
git
/
5fdd5b989cbe5096d44e89861a92b2dd47c279d9
/
.
/
contrib
/
coccinelle
/
swap.cocci
blob: 522177afb66354110b6a63a044d183c512ed1662 [
file
] [
log
] [
blame
]
@@
type T
;
identifier tmp
;
T a
,
b
;
@@
-
T tmp
=
a
;
+
T tmp
;
+
tmp
=
a
;
a
=
b
;
b
=
tmp
;
@
swap
@
type T
;
T tmp
,
a
,
b
;
@@
-
tmp
=
a
;
-
a
=
b
;
-
b
=
tmp
;
+
SWAP
(
a
,
b
);
@
extends
swap
@
identifier unused
;
@@
{
...
-
T unused
;
...
when
!=
unused
}