Skip to content

Commit 8bd272f

Browse files
committed
Have AVIF_FALSE and AVIF_TRUE be enums
1 parent bdcddd5 commit 8bd272f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

include/avif/avif.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,11 @@ extern "C" {
8585
((AVIF_VERSION_MAJOR * 1000000) + (AVIF_VERSION_MINOR * 10000) + (AVIF_VERSION_PATCH * 100) + AVIF_VERSION_DEVEL)
8686

8787
typedef int avifBool;
88-
#define AVIF_TRUE 1
89-
#define AVIF_FALSE 0
88+
enum avifTrueFalse
89+
{
90+
AVIF_FALSE = 0,
91+
AVIF_TRUE = 1
92+
};
9093

9194
#define AVIF_DIAGNOSTICS_ERROR_BUFFER_SIZE 256
9295

src/read.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3984,15 +3984,15 @@ static avifResult avifParseMovieBox(avifDecoderData * data,
39843984
static avifProperty * avifMetaCreateProperty(avifMeta * meta, const char * propertyType)
39853985
{
39863986
avifProperty * metaProperty = avifArrayPush(&meta->properties);
3987-
AVIF_CHECK(metaProperty);
3987+
AVIF_CHECKERR(metaProperty, NULL);
39883988
memcpy(metaProperty->type, propertyType, 4);
39893989
return metaProperty;
39903990
}
39913991

39923992
static avifProperty * avifDecoderItemAddProperty(avifDecoderItem * item, const avifProperty * metaProperty)
39933993
{
39943994
avifProperty * itemProperty = avifArrayPush(&item->properties);
3995-
AVIF_CHECK(itemProperty);
3995+
AVIF_CHECKERR(itemProperty, NULL);
39963996
*itemProperty = *metaProperty;
39973997
return itemProperty;
39983998
}

0 commit comments

Comments
 (0)