FastLED 3.9.15
Loading...
Searching...
No Matches

◆ nsgif_strerror()

const char * fl::third_party::nsgif_strerror ( nsgif_error err)

Convert an error code to a string.

Parameters
[in]errThe error code to convert.
Returns
String representation of given error code.

Definition at line 2045 of file gif.cpp.hpp.

2046{
2047 static const char *const str[] = {
2048 "Success", /* NSGIF_OK */
2049 "Out of memory", /* NSGIF_ERR_OOM */
2050 "Invalid source data", /* NSGIF_ERR_DATA */
2051 "Requested frame does not exist", /* NSGIF_ERR_BAD_FRAME */
2052 "Invalid frame data", /* NSGIF_ERR_DATA_FRAME */
2053 "Unexpected end of GIF source data", /* NSGIF_ERR_END_OF_DATA */
2054 "Can't add data to completed GIF", /* NSGIF_ERR_DATA_COMPLETE */
2055 "Frame can't be displayed", /* NSGIF_ERR_FRAME_DISPLAY */
2056 "Animation complete", /* NSGIF_ERR_ANIMATION_END */
2057 };
2058
2059 if (err >= NSGIF_ARRAY_LEN(str) || str[err] == nullptr) {
2060 return "Unknown error";
2061 }
2062
2063 return str[err];
2064}
#define NSGIF_ARRAY_LEN(_a)
Helper macro to get number of elements in an array.
Definition gif.cpp.hpp:145

References FL_NOEXCEPT, and NSGIF_ARRAY_LEN.

Referenced by fl::third_party::SoftwareGifDecoder::decode(), fl::third_party::SoftwareGifDecoder::initializeDecoder(), and fl::third_party::SoftwareGifDecoder::loadMoreData().

+ Here is the caller graph for this function: