[tlbuild] proposed change to xdvi.c

Paul Vojta vojta at math.berkeley.edu
Tue Apr 17 16:58:27 CEST 2012


On Tue, Apr 17, 2012 at 08:39:21AM -0600, Nelson H. F. Beebe wrote:
> >> good catch, applied as r26011 (however, with long instead of double).
> 
> That works for IA-64, where we have (from my features-1.2.1 tests)
> 
> 	sizeof(char)                 	=    1
> 	sizeof(short)                	=    2
> 	sizeof(int)                  	=    4
> 	sizeof(long)                 	=    8
> 	sizeof(long long)            	=    8
> 
> However, there may be other platforms where the alignment of 8-byte
> boundary is needed by the X11 library, but sizeof(long) == 4.  That is
> why I intentionally used "double", which is guaranteed to be 8-byte
> aligned on all byte-addressed systems.  
> 
> No arithmetic is required, just addressing, so I think the type really
> should be "double", not the system- and compiler-dependent "long".

According to the man page, the variable should be a "long".

If you look at the source of libX11, XChangeProperty accesses that
particular argument as long * (and converts it to an array of 32-bit
integers on 64-bit platforms).  So "long" is correct and "double" is not.

But, I'll have to look at the code (in libX11) a bit more closely.  It
looks like xdvi is doing too much conversion that is already done by libX11.

--Paul Vojta, vojta at math.berkeley.edu


More information about the tlbuild mailing list