diff options
Diffstat (limited to 'liblss16.h')
-rw-r--r-- | liblss16.h | 44 |
1 files changed, 20 insertions, 24 deletions
@@ -6,6 +6,12 @@ #include <stdint.h> +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wpadded" +#endif + + /** * Image decoding state */ @@ -115,12 +121,7 @@ enum liblss16_encode_state { /** * Encodig done */ - LIBLSS16_ENCODE_DONE, - - /** - * Error occured while encoding - */ - LIBLSS16_ENCODE_ERROR + LIBLSS16_ENCODE_DONE }; @@ -139,12 +140,7 @@ enum liblss16_encode_error { * 6 bits, however at least one colour value * had at least one of it it high bits set */ - LIBLSS16_ENCODE_BAD_COLOUR, - - /** - * Colour index above 15 specified for a pixel - */ - LIBLSS16_ENCODE_BAD_COLOUR_INDEX + LIBLSS16_ENCODE_BAD_COLOUR }; @@ -270,10 +266,9 @@ void liblss16_decoder_init(struct liblss16_decoder *decoder); * is set to `LIBLSS16_DECODE_BAD_HEADER` */ enum liblss16_decode_state liblss16_decode_to_colour_index( - struct liblss16_decoder *decoder, - const void *data, size_t length, size_t *consumed_out, - uint8_t *pixels, size_t pixels_size, size_t *npixels_out, - enum liblss16_decode_error *error_out); + struct liblss16_decoder *decoder, const void *data, size_t length, + size_t *consumed_out, uint8_t *pixels, size_t pixels_size, + size_t *npixels_out, enum liblss16_decode_error *error_out); /** @@ -319,16 +314,13 @@ int liblss16_encoder_init(struct liblss16_encoder *encoder, const struct liblss1 * @param npixels The number of provided pixels * @param nconsumed_out Output parameter for the number of pixels consumed into * to state of the encoder - * @param error_out Output parameter for the error; only set if - * `LIBLSS16_ENCODE_ERROR` is returned; may be `NULL` * @return The processing state: normally `LIBLSS16_ENCODE_RUNNING`, - * but `LIBLSS16_ENCODE_DONE` when the image has been - * fully encoded, and `LIBLSS16_ENCODE_ERROR` on error + * but `LIBLSS16_ENCODE_DONE` when the image has been fully + * encoded */ enum liblss16_encode_state liblss16_encode_from_colour_index( - struct liblss16_encoder *encoder, void *buffer, size_t size, - size_t *written_out, const uint8_t *pixels, size_t npixels, - size_t *nconsumed_out, enum liblss16_encode_error *error_out); + struct liblss16_encoder *encoder, void *buffer, size_t size, size_t *written_out, + const uint8_t *pixels, size_t npixels, size_t *nconsumed_out); /** @@ -347,7 +339,7 @@ const char *liblss16_encode_strerror(enum liblss16_encode_error error); * Optimise and image * * @param header The image metadata - * @param pixel Buffer with pixels; the pixels are to encoded with the + * @param pixels Buffer with pixels; the pixels are to encoded with the * colour index of each pixel. Pixels are encoded primarily * from to the top down and secondarily from left to right. * @@ -357,4 +349,8 @@ const char *liblss16_encode_strerror(enum liblss16_encode_error error); void liblss16_optimise(struct liblss16_header *header, uint8_t *pixels); +#if defined(__clang__) +# pragma clang diagnostic pop +#endif + #endif |