[Nexus-developers] Problem in current napi5.c
Peterson, Peter F.
petersonpf at ornl.gov
Mon Sep 18 19:39:51 BST 2006
Freddie,
That seems to fix things (I checked in the change). It turns out that
somebody (looks like you) altered the tests to look for the wrong number
of attributes to keep this bug hidden.
We need to talk about more thorough documentation of the API including
these private functions. Without it we are stuck without a handful of
people staying involved (Mark and Freddie are high on the list). Another
topic for the meeting.
P^2
-----Original Message-----
From: nexus-developers-bounces at anl.gov
[mailto:nexus-developers-bounces at anl.gov] On Behalf Of Akeroyd, FA
(Freddie)
Sent: Monday, September 18, 2006 1:05 PM
To: nexus-developers at anl.gov
Subject: RE: [Nexus-developers] Problem in current napi5.c
Peter,
I'm not an expert on that part of the code, but my guess is that
pFile->iCurrentG is only zero for a global attribute and non-zero when
inside both a group and a dataset/SDS within a group; hence the "-1" is
to remove counting of the "nexus_class" group attribute that is
automatically added by the API. The problem would then be caused by the
code subtracting one from the dataset attributes count that satisfies
(pFile->iCurrentG > 0 && pFile->iCurrentD > 0)
as well as from group attributes count (where it is needed). If I am
correct in my understanding of iCurrentG and iCurrentD then the fix is
to change line 1951 of napi5.c (Revision: 1.24) from
if (pFile->iCurrentG > 0)
to
if (pFile->iCurrentG > 0 && pFile->iCurrentD == 0)
Regards,
Freddie
-----Original Message-----
From: nexus-developers-bounces at anl.gov
[mailto:nexus-developers-bounces at anl.gov] On Behalf Of Peterson, Peter
F.
Sent: 14 September 2006 21:40
To: nexus-developers at anl.gov
Subject: [Nexus-developers] Problem in current napi5.c
"napi5.c" is reporting the wrong number of attributes in the function
"NX5getattrinfo". It reports back one less attribute than actually
exists in the file (when compared to NEXUS_3_0_1_BETA tag). As far as I
can tell the comparison "(pFile->iCurrentG > 0)" is always returning
true.
Can somebody please fix this?
P^2
_______________________________________________
NeXus-developers mailing list
NeXus-developers at anl.gov
http://www.neutron.anl.gov/mailman/listinfo/nexus-developers
_______________________________________________
NeXus-developers mailing list
NeXus-developers at anl.gov
http://www.neutron.anl.gov/mailman/listinfo/nexus-developers
More information about the NeXus-developers
mailing list