A
Alex Stapleton
from struct import pack2
Why does an unsigned char suddenly become 4 bytes long when you
include an unsigned int in the format string? It's consistent
behaviour but it's incorrect.
Also.
'\xff\xff\xff\x00\x00\x00\x00\x00' ####### That's 3 255's and 5(!?!?)
0's'\xff\xff\xff\xff\x00\x00\x00\x00' ######### 4 255's and 4 0's!
Which is all kinds of wrong.
BL should be 9
BBL should be 10
.....
Python 2.4.1 (#2, May 5 2005, 11:32:06)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2
Same behaviour on my PowerBook using
Python 2.3.5 (#1, Mar 20 2005, 20:38:20)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin
sizeof(unsigned long) should be 8 on both of these platforms
sizeof(unsigned char) should be 1 on both as well
So am I just being stupid and not specifying something I should be?
Or is struct really that broken?
Why does an unsigned char suddenly become 4 bytes long when you
include an unsigned int in the format string? It's consistent
behaviour but it's incorrect.
Also.
'\xff\xff\xff\x00\x00\x00\x00\x00' ####### That's 3 255's and 5(!?!?)
0's'\xff\xff\xff\xff\x00\x00\x00\x00' ######### 4 255's and 4 0's!
Which is all kinds of wrong.
BL should be 9
BBL should be 10
.....
Python 2.4.1 (#2, May 5 2005, 11:32:06)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2
Same behaviour on my PowerBook using
Python 2.3.5 (#1, Mar 20 2005, 20:38:20)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin
sizeof(unsigned long) should be 8 on both of these platforms
sizeof(unsigned char) should be 1 on both as well
So am I just being stupid and not specifying something I should be?
Or is struct really that broken?