mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-09 05:58:01 +02: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.
|
* Returns: *p_val and sets *p_val to zero the same time.
|
||||||
* Accepts %NULL, in which case also numeric 0 will be returned.
|
* Accepts %NULL, in which case also numeric 0 will be returned.
|
||||||
*/
|
*/
|
||||||
#define nm_steal_int(p_val) \
|
#define nm_steal_int(p_val) \
|
||||||
({ \
|
({ \
|
||||||
typeof(p_val) const _p_val = (p_val); \
|
typeof(p_val) const _p_val = (p_val); \
|
||||||
typeof(*_p_val) _val = 0; \
|
typeof(*_p_val) _val = 0; \
|
||||||
\
|
\
|
||||||
if (_p_val && (_val = *_p_val)) { \
|
if (_p_val && ((_val = *_p_val) != 0)) { \
|
||||||
*_p_val = 0; \
|
*_p_val = 0; \
|
||||||
} \
|
} \
|
||||||
_val; \
|
_val; \
|
||||||
})
|
})
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue