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

BIG_ENDIAN bug in jpwl.c #839

Closed
szukw000 opened this issue Sep 14, 2016 · 1 comment
Closed

BIG_ENDIAN bug in jpwl.c #839

szukw000 opened this issue Sep 14, 2016 · 1 comment
Labels
removed_components Issues that affect MJ2, JPWL or JP3D wontfix
Milestone

Comments

@szukw000
Copy link
Contributor

I compiled openjpeg2-git-2016-08-21 on a PPC64 machine:

Linux g5 3.16.0-4-powerpc64 #1 SMP Debian 3.16.7-ckt25-2+deb8u3 (2016-07-02) ppc64 GNU/Linux

The following error was reported:


/home/sources/LIB/OPENJPEG/openjpeg2-git-2016-08-21/src/bin/jpwl/convert.c:190:15: error:
unknown type name 'uint16_t'
static inline uint16_t swap16(uint16_t x)

/home/sources/LIB/OPENJPEG/openjpeg2-git-2016-08-21/src/bin/jpwl/convert.c:190:31: error:
unknown type name 'uint16_t'
static inline uint16_t swap16(uint16_t x)

make[2]: *** [src/bin/jpwl/CMakeFiles/opj_jpwl_compress.dir/convert.c.o] Error 1
make[1]: *** [src/bin/jpwl/CMakeFiles/opj_jpwl_compress.dir/all] Error 2
make: *** [all] Error 2


The report was triggered because of:

ifdef OPJ_BIG_ENDIAN

static inline uint16_t swap16(uint16_t x)
{
return(((x & 0x00ffU) << 8) | ((x & 0xff00U) >> 8));
}

endif

The patch is attached.

winfried
jpwl-dif.txt

@stweil
Copy link
Contributor

stweil commented Sep 14, 2016

The patch looks good. Do you want to send a pull request?

Using byteswap.h and the bswap_16 macro would be an alternative solution.

@malaterre malaterre added this to the OPJ v2.1.2 milestone Sep 20, 2016
@detonin detonin modified the milestones: OPJ v2.1.2, OPJ v2.1.3 Sep 29, 2016
@rouault rouault added wontfix removed_components Issues that affect MJ2, JPWL or JP3D labels May 6, 2021
@rouault rouault closed this as completed May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
removed_components Issues that affect MJ2, JPWL or JP3D wontfix
Projects
None yet
Development

No branches or pull requests

5 participants