From 83541df6fad9bedcb6e0d2fc622a95ecb924880a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= Date: Fri, 10 Sep 2021 18:58:16 +0300 Subject: [PATCH] include: map VLC_EGENERIC to INT_MIN VLC_EGENERIC has no equivalent in , so it should not alias any value. This maps it to INT_MIN. It works because -INT_MIN equals INT_MAX + 1, which is out of range of `int`. As a reminder codes in are positive integers. The convoluted definition is to avoid pulling into and from there all over the code base. --- include/vlc_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/vlc_common.h b/include/vlc_common.h index 32e029195d..6fb9f706e3 100644 --- a/include/vlc_common.h +++ b/include/vlc_common.h @@ -469,7 +469,7 @@ typedef union /** No error */ #define VLC_SUCCESS (-0) /** Unspecified error */ -#define VLC_EGENERIC (-1) +#define VLC_EGENERIC (-2 * (1 << (sizeof (int) * 8 - 2))) /* INT_MIN */ /** Not enough memory */ #define VLC_ENOMEM (-2) /** Timeout */