What to do about int's

Ray Osborn ROsborn at anl.gov
Mon Feb 14 15:28:43 GMT 2000


I would like some technical views from the NAPI team of the recent debate 
about int's.  Although I've made some progress in learning C, I realize that
I only know some things skin deep.  I'm sure you could clear up the
following points:

1) Is Brian Tieman right that typecasting could have added high-order bits
when calling the HDF routines?  I would have thought that converting an
integer from one length to another should be a standard typecast operation.
If he's not right, is the cause of the bug something else?

2) Is it valid to typecast array arguments in a function call, or does it
only work on scalar values?  I can understand how you can copy a value of
one type into one of another type, but it's less obvious how you pass an
array address, and expect the called routine to convert each of the array
values.

3) Do people agree with my comment last week that it is necessary to support
16-bit int's?

4) If so, what should our policy be?  It shouldn't take long to clear things
up in NAPI.C.  What we do depends on the answer to the above questions.  For
example, we could typecast scalars (passed by value) to HDF calls, but copy
all the rest into local int32 variables.  I certainly don't believe that we
should suddenly ask everyone who uses NAPI to rewrite their programs
converting all int's to int32's, unless someone can convince me it's really
necessary.

Please respond as soon as you can.  We must be able to act promptly to clear
up bugs when they are discovered, since more and more people are starting to
use the NeXus API.

Thanks,
Ray
--
Dr Ray Osborn                Tel: +1 (630) 252-9011
Materials Science Division   Fax: +1 (630) 252-7777
Argonne National Laboratory  E-mail: ROsborn at anl.gov
Argonne, IL 60439-4845




More information about the NeXus-developers mailing list