Re: using libjpeg



Syren Baran wrote:

Spoon wrote:

Syren Baran wrote:

Pretty sure you'll want to use int's and not long's. The typically
used ARGB consists of 32 bits.

What size do you expect an int to be?

32 bits, though I know that's not guaranteed by C.

Right.

<quote>
A "plain" int object has the natural size suggested by the architecture of the execution environment (large enough to contain any value in the range INT_MIN to INT_MAX).
</quote>

* minimum value for an object of type int INT_MIN -32767
* maximum value for an object of type int INT_MAX +32767

(There are platforms where an int is only 16 bits wide. AFAIU, there
are also platforms where an int is 64 bits wide.)

BTW, which language are you talking about, I might be able to give
you a definite answer.

I was thinking of ISO/IEC 9899:1990.

What size do you expect a long int to be?

In C, at least as long as int.

Right.

<quote>
There are four signed integer types, designated as signed char, short int, int, and long int. In the list of signed integer types above, the range of values of each type is a subrange of the values of the next type in the list.
</quote>

* minimum value for an object of type long int LONG_MIN -2147483647
* maximum value for an object of type long int LONG_MAX +2147483647

(A long int is never less than 32 bits wide. There are platforms
where a long int is 64 bits wide.)

Given the above, I do not understand your comment that the OP should
use ints instead of long ints. Could you clarify?

Regards.
.



Relevant Pages

  • Re: TR 24731 approved
    ... they're tied to a specific type, long int. ... long int was supposed to be the largest type in C90 (well, ... On such platforms it would have been meaningful to have a 64 bits long ... Implementations should probably have added their ...
    (comp.std.c)
  • Re: Thou shalt have no other gods before the ANSI C standard
    ... platforms, on DJB's list (other than 32-bit int)? ... programmers doing the porting to wacky platforms to deal with these ... this is the reality. ...
    (sci.crypt)
  • Re: Thou shalt have no other gods before the ANSI C standard
    ... > No, I've never written code aimed at platforms with 36-bit ints, ... I've just been assuming that it requires extra effort, ... on 64-bit int platforms, 48-bit int platforms, 16-bit ... When doing a security code review of legacy code, a bug that only ...
    (sci.crypt)
  • Re: 2.6.12-rc1-bk does not boot x86_64
    ... Only works to initialise the lock as unlocked on platforms whose unlock ... int proto_register ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: structure alignment
    ... > When i learned C i came across a section that showed the layout in memory ... > byte ordering for int is different on some platforms. ... you are using the right compiler options, ...
    (comp.os.linux.development.apps)