[sane-devel] New magicolor backend for inclusion in git

Reinhold Kainhofer reinhold at kainhofer.com
Sat Jan 22 10:54:29 UTC 2011

Am Donnerstag, 20. Januar 2011, um 21:26:42 schrieb m. allan noah:
> What if you make the pointer unsigned char instead?

If I use "unsigned char*", then I get no warning. However, I fail to see why 
using an additional variable makes a difference...

This does not work (&b[0] is a pointer to an unsigned char, right?):
   unsigned char b[4];
   htole32a(&b[0], value);

while this does:
   unsigned char b[4];
   unsigned char *bp=&b[0];
   htole32a(bp, value);

Anyway, I have a local patch that gets rid of all the byteorder.h macros and 
instead copies all little-endian encoded values manually byte-by-byte. I'm 
currently away from home, so I cant test it with my magicolor scanner. I'll 
commit it as soon as I'm back home (probably tomorrow).

Sorry for the breakage!

Reinhold Kainhofer, reinhold at kainhofer.com, http://reinhold.kainhofer.com/
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org

More information about the sane-devel mailing list