mansoor-ahmed / openjpeg

Automatically exported from code.google.com/p/openjpeg
Other
0 stars 0 forks source link

integer constant is too large for 'long' type #61

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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

Original issue reported on code.google.com by antonin on 30 Jan 2011 at 3:30

GoogleCodeExporter commented 9 years ago
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

Original comment by spa...@gmail.com on 17 Feb 2011 at 1:48

GoogleCodeExporter commented 9 years ago
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

Original comment by antonin on 17 Feb 2011 at 9:11

GoogleCodeExporter commented 9 years ago

Original comment by vincent....@gmail.com on 26 Jul 2011 at 7:38

GoogleCodeExporter commented 9 years ago

Original comment by mathieu.malaterre on 29 May 2012 at 5:07