mirror of
https://github.com/ostreedev/ostree.git
synced 2024-12-23 21:35:26 +03:00
305db981d4
This is inspired by the [Coccinelle](http://coccinelle.lip6.fr/) usage in systemd. I also took it a bit further and added infrastructure to have spatches which should never apply. This acts as a blacklist. The reason to do the latter is that coccinelle is *way* more powerful than the regular expresssions we have in `make syntax-check`. I started with blacklisting `g_error_free()` directly. The reason that's bad is it leaves a dangling pointer. Closes: #754 Approved by: jlebon
23 lines
266 B
Plaintext
23 lines
266 B
Plaintext
@@
|
|
expression p;
|
|
@@
|
|
- glnx_set_error_from_errno (p);
|
|
- goto out;
|
|
+ return glnx_throw_errno (p);
|
|
@@
|
|
expression p;
|
|
@@
|
|
- if (!p)
|
|
- goto out;
|
|
+ if (!p)
|
|
+ return FALSE;
|
|
@@
|
|
expression p;
|
|
@@
|
|
- gboolean ret = FALSE;
|
|
...
|
|
- ret = TRUE;
|
|
- out:
|
|
- return ret;
|
|
+ return TRUE;
|