netcdf-hdf mailing list is no longer active. The list archives are made available for historical reasons.
> Ed: > > I think you are true. Indeed, yes. However, it is appropriate becuase you want to get that machine's native settings for the struct in memory. If you'd like to generate a "packed" compound type for storing the data on disk (which may not always be the best option, because it may require datatype conversions on more machines) you can use H5Tpack(). To generate a "native" compound datatype for a particular machine from a packed compound datatype, use H5Tget_native_type(). Quincey > Kent > At 08:13 AM 4/22/2005, you wrote: > >HDF5ers, > > > >When creating compound types, I rely on the HOFFSET macro: > > > > if (H5Tinsert(typeid, LIQUOR, HOFFSET(struct s2, i2), > > H5T_NATIVE_INT) < 0) ERR; > > > >I see that HOFFSET, in turn, is just using the C macro offsetof. > > > > >From reading around, it seems that offsetof might return different > >numbers on different platforms, since, as I understand it, the > >internal padding of structs is platform dependent. > > > >Is this true? Can HOFFSET give me one answer on one machine, and > >another on another machine, or with a different compiler? > > > >Any thoughts would be most appreciated. > > > >Thanks, > > > >Ed > > > >-- > >Ed Hartnett -- ed@xxxxxxxxxxxxxxxx > >