include: use negated standard error codes

This commit is contained in:
Rémi Denis-Courmont 2021-07-12 20:51:43 +03:00
parent 83541df6fa
commit 2d80a67524
1 changed files with 15 additions and 10 deletions

View File

@ -44,6 +44,7 @@
*****************************************************************************/
#include <stdlib.h>
#include <stdarg.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
@ -463,25 +464,29 @@ typedef union
} vlc_value_t;
/*****************************************************************************
* Error values (shouldn't be exposed)
*****************************************************************************/
/**
* \defgroup errors Error codes
* \ingroup cext
* @{
*/
/** No error */
#define VLC_SUCCESS (-0)
#define VLC_SUCCESS 0
/** Unspecified error */
#define VLC_EGENERIC (-2 * (1 << (sizeof (int) * 8 - 2))) /* INT_MIN */
/** Not enough memory */
#define VLC_ENOMEM (-2)
#define VLC_ENOMEM (-ENOMEM)
/** Timeout */
#define VLC_ETIMEOUT (-3)
#define VLC_ETIMEOUT (-ETIMEDOUT)
/** Not found */
#define VLC_ENOENT (-4)
#define VLC_ENOENT (-ENOENT)
/** Bad variable value */
#define VLC_EINVAL (-7)
#define VLC_EINVAL (-EINVAL)
/** Operation forbidden */
#define VLC_EACCES (-9)
#define VLC_EACCES (-EACCES)
/** Operation not supported */
#define VLC_ENOTSUP (-10)
#define VLC_ENOTSUP (-ENOTSUP)
/** @} */
/*****************************************************************************
* Variable callbacks: called when the value is modified