avifFillAlpha and avifReformatAlpha do not need a return value. (#1656)
diff --git a/include/avif/internal.h b/include/avif/internal.h index 2d93238..af490e9 100644 --- a/include/avif/internal.h +++ b/include/avif/internal.h
@@ -137,8 +137,8 @@ } avifAlphaParams; -avifBool avifFillAlpha(const avifAlphaParams * params); -avifBool avifReformatAlpha(const avifAlphaParams * params); +void avifFillAlpha(const avifAlphaParams * params); +void avifReformatAlpha(const avifAlphaParams * params); typedef enum avifReformatMode {
diff --git a/src/alpha.c b/src/alpha.c index 3b7baea..97ed2c4 100644 --- a/src/alpha.c +++ b/src/alpha.c
@@ -6,7 +6,7 @@ #include <assert.h> #include <string.h> -avifBool avifFillAlpha(const avifAlphaParams * params) +void avifFillAlpha(const avifAlphaParams * params) { if (params->dstDepth > 8) { const uint16_t maxChannel = (uint16_t)((1 << params->dstDepth) - 1); @@ -28,10 +28,9 @@ } } } - return AVIF_TRUE; } -avifBool avifReformatAlpha(const avifAlphaParams * params) +void avifReformatAlpha(const avifAlphaParams * params) { const int srcMaxChannel = (1 << params->srcDepth) - 1; const int dstMaxChannel = (1 << params->dstDepth) - 1; @@ -113,8 +112,6 @@ } } } - - return AVIF_TRUE; } avifResult avifRGBImagePremultiplyAlpha(avifRGBImage * rgb)
diff --git a/src/reformat.c b/src/reformat.c index a9ac0a8..b4d63ba 100644 --- a/src/reformat.c +++ b/src/reformat.c
@@ -495,11 +495,11 @@ params.srcOffsetBytes = state.rgb.offsetBytesA; params.srcPixelBytes = state.rgb.pixelBytes; - AVIF_CHECKERR(avifReformatAlpha(¶ms), AVIF_RESULT_REFORMAT_FAILED); + avifReformatAlpha(¶ms); } else { // libyuv does not fill alpha when converting from RGB to YUV so // fill it regardless of the value of convertedWithLibYUV. - AVIF_CHECKERR(avifFillAlpha(¶ms), AVIF_RESULT_REFORMAT_FAILED); + avifFillAlpha(¶ms); } } return AVIF_RESULT_OK; @@ -1357,9 +1357,9 @@ params.srcOffsetBytes = 0; params.srcPixelBytes = state->yuv.channelBytes; - AVIF_CHECKERR(avifReformatAlpha(¶ms), AVIF_RESULT_REFORMAT_FAILED); + avifReformatAlpha(¶ms); } else { - AVIF_CHECKERR(avifFillAlpha(¶ms), AVIF_RESULT_REFORMAT_FAILED); + avifFillAlpha(¶ms); } }