Remove all direct comparisons to 'NULL' for pointers.
Replace them with boolean-like 'if (ptr)' and 'if (!ptr)'.
This makes conditions shorter and easier to read.
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
Make code better readable by replacing `if (rsp->ccode > 0)`
and 'if (rsp->ccode != 0)' with just `if (rsp->ccode)` as
rsp->ccode is anyway an unsigned byte and can't be negative.
Also replace 'if (rsp->ccode == 0)' with 'if (!rsp->ccode)'.
All these changes make lines shorter and easier to read as
a non-zero ccode is an indication of some failure, and so !ccode
naturally reads as 'no error'.
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
There are lots of feature test macros like _POSIX_SOURCE,
_BSD_SOURCE, etc. chaotically placed at the beginning of
multiple files without apparent reason, sometime purely
erroneously.
This commit removes them all for the sake of cleaner code.
No new warnings are added due to that at least for gcc 5.4
on Linux with glibc 2.23.
Reworked event type code/sensor type parsing in order to support
VITA-specific extensions. Added VITA-specific sensor-specific event
types and VITA-specific sensor types.
Commit adds macros and #include in order to bring down the number of `warning:
implicit declaration of function 'X' [-Wimplicit-function-declaration]`
warnings.