mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 22:50:08 +01:00
std-aux: minor cleanup in nm_steal_int() to compare number explicitly against zero
This commit is contained in:
parent
6b3862e39a
commit
a3ca768fbc
1 changed files with 9 additions and 9 deletions
|
|
@ -1007,15 +1007,15 @@ _nm_auto_fclose(FILE **pfd)
|
|||
* Returns: *p_val and sets *p_val to zero the same time.
|
||||
* Accepts %NULL, in which case also numeric 0 will be returned.
|
||||
*/
|
||||
#define nm_steal_int(p_val) \
|
||||
({ \
|
||||
typeof(p_val) const _p_val = (p_val); \
|
||||
typeof(*_p_val) _val = 0; \
|
||||
\
|
||||
if (_p_val && (_val = *_p_val)) { \
|
||||
*_p_val = 0; \
|
||||
} \
|
||||
_val; \
|
||||
#define nm_steal_int(p_val) \
|
||||
({ \
|
||||
typeof(p_val) const _p_val = (p_val); \
|
||||
typeof(*_p_val) _val = 0; \
|
||||
\
|
||||
if (_p_val && ((_val = *_p_val) != 0)) { \
|
||||
*_p_val = 0; \
|
||||
} \
|
||||
_val; \
|
||||
})
|
||||
|
||||
static inline int
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue