summaryrefslogtreecommitdiffstats
path: root/src/H5FDmulti.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>1999-11-17 21:59:53 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>1999-11-17 21:59:53 (GMT)
commit9e014467b62df66322de63e21be565ed59a079b3 (patch)
treee6b01ab36a0f2a67c1e3a68b5be10dc5e15f481d /src/H5FDmulti.c
parentcd313a16456934b336902ca509d10187b4d975de (diff)
downloadhdf5-9e014467b62df66322de63e21be565ed59a079b3.zip
hdf5-9e014467b62df66322de63e21be565ed59a079b3.tar.gz
hdf5-9e014467b62df66322de63e21be565ed59a079b3.tar.bz2
[svn-r1836] Mainly fixed a bug in VL datatype comparisons which was causing non-equal
VL types to compare as equal. Added some asserts to make certain nothing slips through again. Also cleaned up a few warnings from the SGI compiler.
Diffstat (limited to 'src/H5FDmulti.c')
-rw-r--r--src/H5FDmulti.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index 59c8f99..73ceb74 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -40,7 +40,7 @@
hbool_t _seen[H5FD_MEM_NTYPES]; \
\
memset(_seen, 0, sizeof _seen); \
- for (_unmapped=1; _unmapped<H5FD_MEM_NTYPES; _unmapped++) { \
+ for (_unmapped=H5FD_MEM_SUPER; _unmapped<H5FD_MEM_NTYPES; _unmapped++) { \
LOOPVAR = MAP[_unmapped]; \
if (H5FD_MEM_DEFAULT==LOOPVAR) LOOPVAR=_unmapped; \
assert(LOOPVAR>0 && LOOPVAR<H5FD_MEM_NTYPES); \
@@ -49,14 +49,14 @@
#define MAPPED_MEMBERS(MAP,LOOPVAR) { \
H5FD_mem_t _unmapped, LOOPVAR; \
\
- for (_unmapped=1; _unmapped<H5FD_MEM_NTYPES; _unmapped++) { \
+ for (_unmapped=H5FD_MEM_SUPER; _unmapped<H5FD_MEM_NTYPES; _unmapped++) { \
LOOPVAR = MAP[_unmapped]; \
if (H5FD_MEM_DEFAULT==LOOPVAR) LOOPVAR=_unmapped; \
assert(LOOPVAR>0 && LOOPVAR<H5FD_MEM_NTYPES);
#define ALL_MEMBERS(LOOPVAR) { \
H5FD_mem_t LOOPVAR; \
- for (LOOPVAR=0; LOOPVAR<H5FD_MEM_NTYPES; LOOPVAR++) {
+ for (LOOPVAR=H5FD_MEM_DEFAULT; LOOPVAR<H5FD_MEM_NTYPES; LOOPVAR++) {
#define END_MEMBERS }}
@@ -247,7 +247,7 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id,
H5Eclear();
/* Initialize */
- for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
memb_map[mt] = (H5FD_MEM_DRAW==mt?mt:H5FD_MEM_SUPER);
memb_fapl[mt] = -1;
memb_name[mt] = NULL;
@@ -375,33 +375,33 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map,
if (H5P_FILE_ACCESS!=H5Pget_class(fapl_id))
H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "not a file access property list", -1);
if (!memb_map) {
- for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
_memb_map[mt] = H5FD_MEM_DEFAULT;
}
memb_map = _memb_map;
}
if (!memb_fapl) {
- for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
_memb_fapl[mt] = H5P_DEFAULT;
}
memb_fapl = _memb_fapl;
}
if (!memb_name) {
assert(strlen(letters)==H5FD_MEM_NTYPES);
- for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
sprintf(_memb_name[mt], "%%s-%c.h5", letters[mt]);
_memb_name_ptrs[mt] = _memb_name[mt];
}
memb_name = _memb_name_ptrs;
}
if (!memb_addr) {
- for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
_memb_addr[mt] = (mt?mt-1:0) * HADDR_MAX/H5FD_MEM_NTYPES;
}
memb_addr = _memb_addr;
}
- for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
/* Map usage type */
mmt = memb_map[mt];
if (mmt<0 || mmt>=H5FD_MEM_NTYPES)
@@ -476,7 +476,7 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/,
memcpy(memb_map, fa->memb_map, H5FD_MEM_NTYPES*sizeof(H5FD_mem_t));
}
if (memb_fapl) {
- for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
if (fa->memb_fapl[mt]>=0) {
memb_fapl[mt] = H5Pcopy(fa->memb_fapl[mt]);
} else {
@@ -485,7 +485,7 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/,
}
}
if (memb_name) {
- for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
if (fa->memb_name[mt]) {
memb_name[mt] = malloc(strlen(fa->memb_name[mt])+1);
strcpy(memb_name[mt], fa->memb_name[mt]);
@@ -541,7 +541,7 @@ H5Pset_dxpl_multi(hid_t dxpl_id, const hid_t *memb_dxpl)
H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1);
if (!memb_dxpl)
H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "invalid pointer", -1);
- for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
if (H5P_DEFAULT!=memb_dxpl[mt] &&
H5P_DATA_XFER!=H5Pget_class(memb_dxpl[mt]))
H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1);
@@ -590,7 +590,7 @@ H5Pget_dxpl_multi(hid_t dxpl_id, hid_t *memb_dxpl/*out*/)
H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "bad VFL driver info", -1);
if (memb_dxpl) {
- for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
if (dx->memb_dxpl[mt]>=0) {
memb_dxpl[mt] = H5Pcopy(dx->memb_dxpl[mt]);
} else {
@@ -692,7 +692,7 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/,
strcpy(name, "NCSAmulti");
assert(7==H5FD_MEM_NTYPES);
- for (m=1; m<H5FD_MEM_NTYPES; m++) {
+ for (m=H5FD_MEM_SUPER; m<H5FD_MEM_NTYPES; m++) {
buf[m-1] = file->fa.memb_map[m];
}
buf[7] = 0;
@@ -789,8 +789,8 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
*/
memset(map, 0, sizeof map);
for (i=0; i<6; i++) {
- map[i+1] = buf[i];
- if (file->fa.memb_map[i+1]!=map[i+1]) map_changed=TRUE;
+ map[i+1] = (H5FD_mem_t)buf[i];
+ if (file->fa.memb_map[i+1]!=map[i+1]) map_changed=TRUE;
}
UNIQUE_MEMBERS(map, mt) {
nseen++;
@@ -950,7 +950,7 @@ H5FD_multi_fapl_copy(const void *_old_fa)
H5Eclear();
memcpy(new_fa, old_fa, sizeof(H5FD_multi_fapl_t));
- for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
if (old_fa->memb_fapl[mt]>=0) {
new_fa->memb_fapl[mt] = H5Pcopy(old_fa->memb_fapl[mt]);
if (new_fa->memb_fapl[mt]<0) nerrors++;
@@ -963,7 +963,7 @@ H5FD_multi_fapl_copy(const void *_old_fa)
}
if (nerrors) {
- for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
if (new_fa->memb_fapl[mt]>=0) H5Pclose(new_fa->memb_fapl[mt]);
if (new_fa->memb_name[mt]) free(new_fa->memb_name[mt]);
}
@@ -999,7 +999,7 @@ H5FD_multi_fapl_free(void *_fa)
/* Clear the error stack */
H5Eclear();
- for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
if (fa->memb_fapl[mt]>=0) H5Pclose(fa->memb_fapl[mt]);
if (fa->memb_name[mt]) free(fa->memb_name[mt]);
}
@@ -1039,7 +1039,7 @@ H5FD_multi_dxpl_copy(const void *_old_dx)
H5Eclear();
memcpy(new_dx, old_dx, sizeof(H5FD_multi_dxpl_t));
- for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
if (old_dx->memb_dxpl[mt]>=0) {
new_dx->memb_dxpl[mt] = H5Pcopy(old_dx->memb_dxpl[mt]);
if (new_dx->memb_dxpl[mt]<0) nerrors++;
@@ -1047,7 +1047,7 @@ H5FD_multi_dxpl_copy(const void *_old_dx)
}
if (nerrors) {
- for (mt=0; mt<H5FD_MEM_NTYPES; mt++)
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++)
H5Pclose(new_dx->memb_dxpl[mt]);
free(new_dx);
H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "invalid freespace objects", NULL);
@@ -1081,7 +1081,7 @@ H5FD_multi_dxpl_free(void *_dx)
/* Clear the error stack */
H5Eclear();
- for (mt=0; mt<H5FD_MEM_NTYPES; mt++)
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++)
if (dx->memb_dxpl[mt]>=0)
H5Pclose(dx->memb_dxpl[mt]);
free(dx);
@@ -1284,7 +1284,7 @@ H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
/* Clear the error stack */
H5Eclear();
- for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
if (f1->memb[mt] && f2->memb[mt]) break;
if (!cmp) {
if (f1->memb[mt]) cmp = -1;
@@ -1359,7 +1359,7 @@ H5FD_multi_set_eoa(H5FD_t *_file, haddr_t eoa)
H5Eclear();
/* Find the subfile in which the new EOA value falls */
- for (mt=1; mt<H5FD_MEM_NTYPES; mt++) {
+ for (mt=H5FD_MEM_SUPER; mt<H5FD_MEM_NTYPES; mt++) {
mmt = file->fa.memb_map[mt];
if (H5FD_MEM_DEFAULT==mmt) mmt = mt;
assert(mmt>0 && mmt<H5FD_MEM_NTYPES);
@@ -1549,7 +1549,7 @@ H5FD_multi_read(H5FD_t *_file, hid_t dxpl_id, haddr_t addr, hsize_t size,
}
/* Find the file to which this address belongs */
- for (mt=1; mt<H5FD_MEM_NTYPES; mt++) {
+ for (mt=H5FD_MEM_SUPER; mt<H5FD_MEM_NTYPES; mt++) {
mmt = file->fa.memb_map[mt];
if (H5FD_MEM_DEFAULT==mmt) mmt = mt;
assert(mmt>0 && mmt<H5FD_MEM_NTYPES);
@@ -1604,7 +1604,7 @@ H5FD_multi_write(H5FD_t *_file, hid_t dxpl_id, haddr_t addr, hsize_t size,
}
/* Find the file to which this address belongs */
- for (mt=1; mt<H5FD_MEM_NTYPES; mt++) {
+ for (mt=H5FD_MEM_SUPER; mt<H5FD_MEM_NTYPES; mt++) {
mmt = file->fa.memb_map[mt];
if (H5FD_MEM_DEFAULT==mmt) mmt = mt;
assert(mmt>0 && mmt<H5FD_MEM_NTYPES);
@@ -1683,7 +1683,7 @@ H5FD_multi_flush(H5FD_t *_file)
H5Eclear();
/* Flush each file */
- for (mt=1; mt<H5FD_MEM_NTYPES; mt++) {
+ for (mt=H5FD_MEM_SUPER; mt<H5FD_MEM_NTYPES; mt++) {
if (file->memb[mt]) {
H5E_BEGIN_TRY {
if (H5FDflush(file->memb[mt])<0) nerrors++;