diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-10-11 00:45:47 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-10-11 00:45:47 +0200 |
commit | 18387b5983150181dd9dee8edf1573285eecbaa4 (patch) | |
tree | 60818e4f9000af107fc71d785e29cfd0da410360 /src/gudev/gudev-1.0.pc.in | |
parent | eaa3cbef3b8c214cd5c2d75b04e70ad477187e17 (diff) |
macro: add new assert_return() macro for early parameter checking in functions
For the library functions we expose we currently repeatedly use checks
like the following:
if (!value_is_ok(parameter1))
return -EINVAL;
if (!value_is_ok(parameter2))
return -EINVAL;
And so on. Let's turn this into a macro:
assert_return(value_is_ok(parameter1), -EINVAL);
assert_return(value_is_ok(paramater2), -EINVAL);
This makes our code a bit shorter and simpler, and also allows us to add
a _unlikely_() around the check.
Diffstat (limited to 'src/gudev/gudev-1.0.pc.in')
0 files changed, 0 insertions, 0 deletions