[sane-devel] [SANE2 proposal] Error handling

Matto Marjanovic maddog at mir.com
Sun Nov 30 00:00:57 GMT 2003


 >If you want to save memory (4 bytes :) ) then use 
 >typedef SANE_Status
 >{
 >  short code;
 >  short backend-code;
 >} SANE_Status;
 >which is still 32 bits long.

[Chiming in from the void...]

That's 32 bits long *only* if the structure is packed, which generally 
 requires a special #pragma or __attribute__ (depending on the compiler).
 Otherwise, structure elements are generally aligned on word (i.e. 32-bit)
 boundaries.

Such a structure still needs to be marshalled/unmarshalled over the 
 network interface; there is the packing/unpacking issue, and the usual
 endian issue.

-matt m.




More information about the sane-devel mailing list