23 Jan
2015
23 Jan
'15
11:25 p.m.
On Fri, Jan 23, 2015 at 6:47 PM, Peter Dimov
read( header& h ) { unsigned char data[ 14 ]; fread data from file;
read_32_lsb( h.code, data + 0 ); read_32_lsb( h.length, data + 4 ); read_16_msb( h.version, data + 8 ); read_32_lsb( h.shape_type, data + 10 ); }
I've been looking for (standard) functions like that too, I think they'd be very useful. You'd probably want aligned variants too as they might offer better performance. Also got a question about the name endian_reverse: wouldn't reverse_endian make more sense? -- Olaf