Re: [ROOT] Bug in star/inc/TTable.h and star/src/TTable.cxx

From: Valery Fine (fine@bnl.gov)
Date: Wed Sep 20 2000 - 15:35:58 MEST


Hi,  Christian

Thank you very much for your report.
 I did think Long_t is 4 bytes.
Now I've looked up the Rtypes.h file and discovered things were changed.
That ROOT header file says now:

#ifdef R__B64
typedef int            Seek_t;      //File pointer
typedef long           Long_t;      //Signed long integer 4 bytes
typedef unsigned long  ULong_t;     //Unsigned long integer 4 bytes
#else
typedef int            Seek_t;      //File pointer
typedef long           Long_t;      //Signed long integer 8 bytes
typedef unsigned long  ULong_t;     //Unsigned long integer 8 bytes
#endif

Now one has to check what happens with ROOT I/O at this point. Does ROOT cast
Long_t (8 bytes) on Alpha to the "regular" Long_t (4 bytes)  when it streams the object ?

Mean time the workaround is to introduce #ifdef R_B64 for TTable class as well.

  Thank you,
                                        Valery

                    Valery

----- Original Message -----
From: Christian Holm Christensen <cholm@hehi03.nbi.dk>
To: <roottalk@pcroot.cern.ch>
Sent: 19 ñåíòÿáðÿ 2000 ã. 17:45
Subject: [ROOT] Bug in star/inc/TTable.h and star/src/TTable.cxx


> Hi ROOT'ers (I guess in particular René Brun, Fons Rademarkers, and
> Valeri Fine),
>
> There seems to be a bug in star/inc/TTable.h and star/src/TTable.cxx.
>
> When I try to compile this class on Digital Unix (OSF1 V4.0 alpha)
> with GCC 2.91.66 (EGCS 1.1.2), it complains about the lines 1181 and
> 1183 in star/src/TTable.cxx. I've tracked it down to the fact that in
> a switch expression, the following two (redundant) case statements
> appears:
>
>   case kLong4Bytes:
>   case kDouble8Bytes:
>
> where the definitions of kLong4Bytes and kDouble8Bytes in
> star/inc/TTable.h is:
>
>   kLong4Bytes   = sizeof(Long_t)
>   kDouble8Bytes = sizeof(Double_t)
>
> which both evaluates to 8 on Digital Unix on a Alpha chip. For the
> record: kLong4Bytes is 4, and kDouble8Bytes is 8 on Linux (Redhat
> 6.1). This strikes me as somewhat odd, since I thought the idea of
> Long_t was to have a OS independt size for long's (i.e., either 4 or 8
> bytes).
>
> Thought you'd like to know.
>
> Christian  -----------------------------------------------------------
> Holm Christensen                             Phone:  (+45) 35 35 96 91
>   Sankt Hansgade 23, 1. th.                  Office: (+45) 353  25 305
>   DK-2200 Copenhagen N                       Web:    www.nbi.dk/~cholm
>   Denmark                                    Email:       cholm@nbi.dk
>
>



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:33 MET