Re: Epson backend

David Mosberger-Tang (David.Mosberger@acm.org)
Sun, 28 Feb 1999 13:19:55 -0800

>>>>> On Sat, 27 Feb 1999 21:53:42 +0100, Svend Daugaard Pedersen <sdp@vip.cybercity.dk> said:

Svend> I have not made the "final" solution to this problem. Since
Svend> my version of the code is to be used on M680x0 I swapped the
Svend> to bytes in the 16 bit word

Svend> wordSwap(head->count);

Svend> by using this macro:

Svend> #define wordSwap(X) {u_char b;u_char*
Svend> bp=(u_char*)&(X);b=*bp;*( bp++)=*bp;*bp=b;}

This is just as non-portable as the original code. What you should do
is change the struture declaration to use:

u_char count[2]

instead of u_short count. Then you can get the count using the expression:

(head->count[0] | (head->count[1] << 8))

--david

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com