Export to GitHub

openjpeg - issue #61

integer constant is too large for 'long' type


Posted on Jan 30, 2011 by Happy Rabbit

ubuntu 64 bits, libjp3dvm/:

dwt.c:222: warning: integer constant is too large for 'long' type

jp3d.c:1526: warning: integer constant is too large for 'long' type

Comment #1

Posted on Feb 17, 2011 by Quick Dog

At least for the dwt.c the issue is that a pointer is cast into an integer type. Originally the pointer was being cast into an int which would cause a warning and potentially bugs on architectures in which a pointer and an int are not the same size. The currently committed fix is to cast the pointer into a long instead of and int. While this fixes the problem on the architecture I'm interested in (MacOSX/Darwin) where long is 4bytes when building in 32bit and 8bytes when building in 64bit, a better approach might be to use an integer type that is promised to track the pointer size such as size_t or intptr_t.

Cheers, Joël

Comment #2

Posted on Feb 17, 2011 by Happy Rabbit

Thanks Joël. I replaced the 'long' of r724 in dwt.c with 'size_t'.

However, it seems this issue (61) is related to another kind of problem specific to libjp3dvm.

Cheers,

Antonin

Comment #3

Posted on Jul 26, 2011 by Helpful Monkey

(No comment was entered for this change.)

Comment #4

Posted on May 29, 2012 by Helpful Giraffe

(No comment was entered for this change.)

Status: Accepted

Labels:
Type-Defect Priority-Low Milestone-openjpeg3d