From e3a8e61c26cd280a74d27340ade9d34a51fdde94 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 24 Jun 2003 15:10:36 -0500 Subject: [svn-r7097] Purpose: Bug fix Description: Alignment of some types (namely 'short's) was still not being correctly detected on some Crays. Solution: Revert part of last change which accidentally got the offset of 'short's wrong on Crays Correct check for alignment of 'short's on Crays. Platforms tested: FreeBSD 4.8 (sleipnir) h5committest Cray SV1 (wind) Cray T3E (hubble) Cray T90 (gypsy) --- src/H5detect.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/H5detect.c b/src/H5detect.c index eb8f9ac..f0895b1 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -112,14 +112,14 @@ precision (detected_t *d) */ for (n=0; nsize && d->perm[n]<0; n++) /*void*/; d->precision = 8*(d->size-n); - d->offset = 8*n; + d->offset = 0; } else if (d->perm[d->size - 1] < 0) { /* * Higher addresses are padded. */ for (n=0; nsize && d->perm[d->size-(n+1)]; n++) /*void*/; d->precision = 8*(d->size-n); - d->offset = 0; + d->offset = 8*n; } else { /* * No padding. @@ -311,7 +311,7 @@ precision (detected_t *d) #if defined(H5_HAVE_LONGJMP) && defined(H5_HAVE_SIGNAL) #define ALIGNMENT(TYPE,INFO) { \ char *volatile _buf=NULL; \ - volatile TYPE _val=0; \ + volatile TYPE _val=1; \ volatile TYPE _val2; \ volatile size_t _ano=0; \ void (*_handler)(int) = signal(SIGBUS, sigbus_handler); \ @@ -322,17 +322,20 @@ precision (detected_t *d) if (_ano