Re: [PATCH 5/5] graph: use SWAP macro
From: Johannes Schindelin <hidden>
Date: 2017-01-30 16:23:34
From: Johannes Schindelin <hidden>
Date: 2017-01-30 16:23:34
Hi René, On Sat, 28 Jan 2017, René Scharfe wrote:
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