Re: [PATCH 5/5] graph: use SWAP macro
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 30, 2017, 16:16 UTC
- Message-ID
- <alpine.DEB.2.20.1701301714450.3469@virtualbox>
- In-Reply-To
- <af5a7205-7703-f5ad-4ea2-b20ab4c01c80@web.de>
Hi René,
On Sat, 28 Jan 2017, René Scharfe wrote:
Show 7 quoted lines
> Exchange the values of graph->columns and graph->new_columns using the > macro SWAP instead of hand-rolled code. The result is shorter and > easier to read. > > This transformation was not done by the semantic patch swap.cocci > because there's an unrelated statement between the second and the last > step of the exchange, so it didn't match the expected pattern.
Is it really true that Coccinelle cannot be told to look for a code block that declares a variable that is then used *only* in the lines we want to match and replace?
I never used the tool, and a quick web search did not clarify the picture, either...
Ciao, Dscho