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

Fix building on OpenBSD big endian hosts #1520

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/bin/jp2/convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ static int tga_readheader(FILE *fp, unsigned int *bits_per_pixel,

#ifdef OPJ_BIG_ENDIAN

static INLINE OPJ_UINT16 swap16(OPJ_UINT16 x)
static INLINE OPJ_UINT16 opj_swap16(OPJ_UINT16 x)
{
return (OPJ_UINT16)(((x & 0x00ffU) << 8) | ((x & 0xff00U) >> 8));
}
Expand Down Expand Up @@ -733,8 +733,8 @@ static int tga_writeheader(FILE *fp, int bits_per_pixel, int width, int height,
goto fails;
}
#else
image_w = swap16(image_w);
image_h = swap16(image_h);
image_w = opj_swap16(image_w);
image_h = opj_swap16(image_h);
if (fwrite(&image_w, 2, 1, fp) != 1) {
goto fails;
}
Expand Down