Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare item of avifDecoderItemIsAlphaAux as const #1842

Conversation

wantehchang
Copy link
Collaborator

No description provided.

src/read.c Outdated
@@ -4251,7 +4251,7 @@ static avifBool avifDecoderItemShouldBeSkipped(const avifDecoderItem * item)
}

// Returns the primary color item if found, or NULL.
static avifDecoderItem * avifMetaFindColorItem(avifMeta * meta)
static avifDecoderItem * avifMetaFindColorItem(const avifMeta * meta)
{
for (uint32_t itemIndex = 0; itemIndex < meta->items.count; ++itemIndex) {
avifDecoderItem * item = meta->items.item[itemIndex];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be const too then.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. I missed it. I found that this variable must be non-const because we may return it as the return value. So I reverted the change to this function because conceptually the return value can be considered as part of the input parameter meta.

@wantehchang wantehchang force-pushed the add-const-to-avifMetaFindColorItem branch from 754813e to e475cb8 Compare December 4, 2023 01:40
@wantehchang wantehchang changed the title Add const to two input parameters Declare item of avifDecoderItemIsAlphaAux as const Dec 4, 2023
@wantehchang wantehchang merged commit a2ada7d into AOMediaCodec:main Dec 4, 2023
17 checks passed
@wantehchang wantehchang deleted the add-const-to-avifMetaFindColorItem branch December 4, 2023 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants