Proposed rearrangement of "struct NeXusFile"

F.A.Akeroyd at rl.ac.uk F.A.Akeroyd at rl.ac.uk
Mon Oct 11 14:08:25 BST 1999


The order of elements in the definition of "struct NexusFile" are such that
the
structure is not naturally aligned, and this has caused a problem with Ray's

F90 NXbrowse as the F90 definition did not match up with the C one. I
propose
that we rearrange the structure to make it "naturally aligned" as far as
possible.
This would only break code that relied on a structure member being at a
given
byte offset, which i don't believe exists. The rearranged structure would
look something
like this:

   typedef struct __NexusFile {
    struct iStack {
      int32 *iRefDir;
      int32 *iTagDir;
      int32 iVref;
      int32 __iStack_pad;               /* for 64 bit alignment */
      int iNDir;
      int iCurDir;
    } iStack[NXMAXSTACK];
    struct iStack iAtt;
    int32 iVID;
    int32 iSID;
    int32 iCurrentVG;
    int32 iCurrentSDS;
    int iNXID;
    int iStackPtr;
    char iAccess[2];
  } NexusFile, *pNexusFile;

Anybody any thoughs?

Freddie



More information about the NeXus-developers mailing list