Re: TIP #129 and 64 Bit platforms
Date: Mon, 08 Dec 2003 18:46:36 +0100
Matthias.Rohr@SturmIT.de (Matthias Rohr) writes:
> What I need are integer types, that are the same size on all
> platforms, something like Tcl_Int2, Tcl_Int4. Tcl_Int8.
Why? I use int or short as "at-least-16-bits", long as
"at-least-32-bits" and long long (or a typedef if I have to support
VC) for "at-least-64-bits". I never use built-in types as overlays
for byte arrays, so I never need exact-sized types. Instead I use
unsigned version of all types and bit shift, binary "and" and binary
"or" to convert from byte array to number and back. Keeps my code
portable with ease and without unnecessary #ifdefs.
- Re: byte order
... casting objects to arrays of bytes, and guarantees that such an array ... The standard also gives the possibility of integer types containing ... padding bits, and it is not specified how such bits can be detected. ... code that cares about endianness, so it's not really an issue. ...
- Re: [C] functions and 2D arrays?
... >>This works, and I like the idea of using typedef, but to solidify ... 'int ' for every instance of 'foo bar' in the code. ... to arrays of arrays of int, when you could be passing pointers ...
- Re: size of a typedef with arrays of unsigned char
... arrays of unsigned char, the sum of the size of the arrays? ... The reference to typedef is irrelevant. ... in a record consisting of arbitrary byte-sized chunks, ...
- Re: byte order
... casting objects to arrays of bytes, and guarantees that such an array ... The standard also gives the possibility of integer types containing ... padding bits, and it is not specified how such bits can be detected. ... Bound variables, free programmers. ...
- Re: Returning structs containing arrays
... > of ints and an int. ... contains two pointers and an integer. ... arrays if you initialize them to point to allocated memory. ... The typedef "arrays" doesn't name a structure type; ...