From f92b2d0936a0ae11c59ae088f6f7ad4f00cfaeee Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Thu, 23 Feb 2017 17:00:54 +0100 Subject: [PATCH] core: don't use double underscores Symbols starting with a double underscore are reserved for the compiler. Private symbols in libgpiod should start with a single underscore. Signed-off-by: Bartosz Golaszewski --- include/gpiod.h | 6 +++--- src/lib/core.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/gpiod.h b/include/gpiod.h index f3c5950..12a7f28 100644 --- a/include/gpiod.h +++ b/include/gpiod.h @@ -70,13 +70,13 @@ struct gpiod_chip_iter; /** * @brief Private: offset for all libgpiod error numbers. */ -#define __GPIOD_ERRNO_OFFSET 10000 +#define _GPIOD_ERRNO_OFFSET 10000 /** * @brief libgpiod-specific error numbers. */ enum { - GPIOD_ESUCCESS = __GPIOD_ERRNO_OFFSET, + GPIOD_ESUCCESS = _GPIOD_ERRNO_OFFSET, /**< No error. */ GPIOD_EREQUEST, /**< The caller has no ownership of this line. */ @@ -88,7 +88,7 @@ enum { /**< This line is currently in use. */ GPIOD_ELINEMAX, /**< Number of lines in the request exceeds limit. */ - __GPIOD_MAX_ERR, + _GPIOD_MAX_ERR, /**< Private: number of libgpiod-specific error numbers. */ }; diff --git a/src/lib/core.c b/src/lib/core.c index b9689be..203e248 100644 --- a/src/lib/core.c +++ b/src/lib/core.c @@ -158,12 +158,12 @@ static const char * strerror_r_wrapper(int errnum, char *buf, size_t buflen) const char * gpiod_strerror(int errnum) { - if (errnum < __GPIOD_ERRNO_OFFSET) + if (errnum < _GPIOD_ERRNO_OFFSET) return strerror_r_wrapper(errnum, errmsg, sizeof(errmsg)); - else if (errnum > __GPIOD_MAX_ERR) + else if (errnum > _GPIOD_MAX_ERR) return "invalid error number"; else - return error_descr[errnum - __GPIOD_ERRNO_OFFSET]; + return error_descr[errnum - _GPIOD_ERRNO_OFFSET]; } const char * gpiod_last_strerror(void) -- 2.30.2