core: don't use double underscores
authorBartosz Golaszewski <bartekgola@gmail.com>
Thu, 23 Feb 2017 16:00:54 +0000 (17:00 +0100)
committerBartosz Golaszewski <bartekgola@gmail.com>
Thu, 23 Feb 2017 16:00:54 +0000 (17:00 +0100)
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 <bartekgola@gmail.com>
include/gpiod.h
src/lib/core.c

index f3c5950f1679e54c600e287db0baf62e539efbec..12a7f2837643c081ad85503912f48ff5a2a6b6e8 100644 (file)
@@ -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. */
 };
 
index b9689be444ef043a9f4763c8254266d2e0e6aa76..203e248557c89527313520a450cbc9b0d91a67a9 100644 (file)
@@ -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)