Skip to content

Replace (void*) with EXR_CONST_CAST in extract_attr_float_vector - #2593

Open
cary-ilm wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
cary-ilm:const-cast-fix
Open

Replace (void*) with EXR_CONST_CAST in extract_attr_float_vector#2593
cary-ilm wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
cary-ilm:const-cast-fix

Conversation

@cary-ilm

Copy link
Copy Markdown
Member

The fix in #2582 obscured the const cast. Better to make it obvious that const is being cast away here, as it is in the scratch->sequential_read call a few lines before.

There's no functionality change here, just a clearer way of specifying the cast.

The call in question simply shuffles the bytes on the data just read into the const float* array on big-endian machines, which is why the const cast is acceptable in the first place.

The fix in AcademySoftwareFoundation#2582 obscured the const cast. Better to make it obvious
that const is being cast away here, as it is in the
`scratch->sequential_read` call a few lines before. This simply
shuffles the bytes on the data just read into the const float* array
on big-endian machines.

Signed-off-by: Cary Phillips <seabeepea@gmail.com>
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.

1 participant