From 7fc0836c2ba355162c8e8eb3242bc4d035b50998 Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Thu, 2 Apr 2015 10:58:10 +0200 Subject: [PATCH] gmio_stl: prefix enum values of gmio_stl_format with GMIO_STL_FORMAT --- src/gmio_stl/stl_format.c | 10 +++++----- src/gmio_stl/stl_format.h | 10 +++++----- src/gmio_stl/stl_io.c | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/gmio_stl/stl_format.c b/src/gmio_stl/stl_format.c index d853dc6..b8edfc2 100644 --- a/src/gmio_stl/stl_format.c +++ b/src/gmio_stl/stl_format.c @@ -34,7 +34,7 @@ gmio_stl_format_t gmio_stl_get_format(gmio_stream_t *stream) size_t read_size = 0; if (stream == NULL) - return GMIO_STL_UNKNOWN_FORMAT; + return GMIO_STL_FORMAT_UNKNOWN; /* Read a chunk of bytes from stream, then try to find format from that */ memset(fixed_buffer, 0, GMIO_FIXED_BUFFER_SIZE); @@ -54,7 +54,7 @@ gmio_stl_format_t gmio_stl_get_format(gmio_stream_t *stream) if ((GMIO_STLB_HEADER_SIZE + 4 + facet_count*GMIO_STLB_TRIANGLE_RAWSIZE) == stream_size) { - return GMIO_STL_BINARY_LE_FORMAT; + return GMIO_STL_FORMAT_BINARY_LE; } /* Try with byte-reverted facet count */ @@ -62,7 +62,7 @@ gmio_stl_format_t gmio_stl_get_format(gmio_stream_t *stream) if ((GMIO_STLB_HEADER_SIZE + 4 + facet_count*GMIO_STLB_TRIANGLE_RAWSIZE) == stream_size) { - return GMIO_STL_BINARY_BE_FORMAT; + return GMIO_STL_FORMAT_BINARY_BE; } } @@ -78,10 +78,10 @@ gmio_stl_format_t gmio_stl_get_format(gmio_stream_t *stream) && gmio_istarts_with(fixed_buffer + pos, "solid") && gmio_clocale_isspace(fixed_buffer[pos + 5])) { - return GMIO_STL_ASCII_FORMAT; + return GMIO_STL_FORMAT_ASCII; } } /* Fallback case */ - return GMIO_STL_UNKNOWN_FORMAT; + return GMIO_STL_FORMAT_UNKNOWN; } diff --git a/src/gmio_stl/stl_format.h b/src/gmio_stl/stl_format.h index 15ad658..a883853 100644 --- a/src/gmio_stl/stl_format.h +++ b/src/gmio_stl/stl_format.h @@ -26,10 +26,10 @@ /*! This enums defines the various STL formats */ enum gmio_stl_format { - GMIO_STL_ASCII_FORMAT, /*!< STL ASCII (text) */ - GMIO_STL_BINARY_LE_FORMAT, /*!< STL binary (little-endian) */ - GMIO_STL_BINARY_BE_FORMAT, /*!< STL binary (big-endian) */ - GMIO_STL_UNKNOWN_FORMAT + GMIO_STL_FORMAT_UNKNOWN = 0, /*!< Unknown STL format */ + GMIO_STL_FORMAT_ASCII, /*!< STL ASCII (text) */ + GMIO_STL_FORMAT_BINARY_LE, /*!< STL binary (little-endian) */ + GMIO_STL_FORMAT_BINARY_BE /*!< STL binary (big-endian) */ }; typedef enum gmio_stl_format gmio_stl_format_t; @@ -41,7 +41,7 @@ GMIO_C_LINKAGE_BEGIN * It will try to read 512 bytes from \p stream into a buffer and then * analyses this data to guess the format. * - * \retval GMIO_STL_UNKNOWN_FORMAT in case of error. + * \retval GMIO_STL_FORMAT_UNKNOWN in case of error. */ GMIO_LIBSTL_EXPORT gmio_stl_format_t gmio_stl_get_format(gmio_stream_t* stream); diff --git a/src/gmio_stl/stl_io.c b/src/gmio_stl/stl_io.c index cf78a76..1bba65e 100644 --- a/src/gmio_stl/stl_io.c +++ b/src/gmio_stl/stl_io.c @@ -56,19 +56,19 @@ int gmio_stl_read(gmio_transfer_t *trsf, gmio_stl_mesh_creator_t *creator) const gmio_stl_format_t stl_format = gmio_stl_get_format(&trsf->stream); switch (stl_format) { - case GMIO_STL_ASCII_FORMAT: { + case GMIO_STL_FORMAT_ASCII: { error = gmio_stla_read(trsf, creator); break; } - case GMIO_STL_BINARY_BE_FORMAT: { + case GMIO_STL_FORMAT_BINARY_BE: { error = gmio_stlb_read(trsf, creator, GMIO_ENDIANNESS_BIG); break; } - case GMIO_STL_BINARY_LE_FORMAT: { + case GMIO_STL_FORMAT_BINARY_LE: { error = gmio_stlb_read(trsf, creator, GMIO_ENDIANNESS_LITTLE); break; } - case GMIO_STL_UNKNOWN_FORMAT: { + case GMIO_STL_FORMAT_UNKNOWN: { error = GMIO_STL_ERROR_UNKNOWN_FORMAT; } } /* end switch() */