diff options
Diffstat (limited to 'src/H5FD.c')
-rw-r--r-- | src/H5FD.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -2029,9 +2029,9 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz /* Check if this information is in the metadata accumulator */ if((file->feature_flags&H5FD_FEAT_ACCUMULATE_METADATA) && - ((addr>=file->accum_loc && addr <=(file->accum_loc+file->accum_size)) - || ((addr+size)>=file->accum_loc && (addr+size)<=(file->accum_loc+file->accum_size)) - || (addr<file->accum_loc && (addr+size)>(file->accum_loc+file->accum_size)))) { + ((addr>=file->accum_loc && addr <(file->accum_loc+file->accum_size)) + || ((addr+size)>file->accum_loc && (addr+size)<=(file->accum_loc+file->accum_size)) + || (addr<file->accum_loc && (addr+size)>file->accum_loc))) { unsigned char *read_buf=(unsigned char *)buf; /* Pointer to the buffer being read in */ size_t amount_read; /* Amount to read at a time */ @@ -2055,7 +2055,7 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz size-=amount_read; } /* end if */ - /* Read the part overlapping the metadata accumulator */ + /* Copy the part overlapping the metadata accumulator */ if(size>0 && (addr>=file->accum_loc && addr<(file->accum_loc+file->accum_size))) { /* Set the offset to "read" from */ read_off=addr-file->accum_loc; @@ -2192,9 +2192,9 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si /* Check if there is already metadata in the accumulator */ if(file->accum_size>0) { /* Check if the piece of metadata being written adjoins or is inside the metadata accumulator */ - if((addr>=file->accum_loc && addr <=(file->accum_loc+file->accum_size)) - || ((addr+size)>=file->accum_loc && (addr+size)<=(file->accum_loc+file->accum_size)) - || (addr<file->accum_loc && (addr+size)>(file->accum_loc+file->accum_size))) { + if((addr>=file->accum_loc && addr <(file->accum_loc+file->accum_size)) + || ((addr+size)>file->accum_loc && (addr+size)<=(file->accum_loc+file->accum_size)) + || (addr<file->accum_loc && (addr+size)>file->accum_loc)) { /* Check if the new metadata adjoins the beginning of the current accumulator */ if((addr+size)==file->accum_loc) { @@ -2284,7 +2284,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si /* Check if the new metadata overlaps the end of the current accumulator */ else if(addr>=file->accum_loc && (addr+size)>(file->accum_loc+file->accum_size)) { /* Calculate the new accumulator size, based on the amount of overlap */ - new_size=file->accum_size+((addr+size)-(file->accum_loc+file->accum_size)); + new_size=(addr-file->accum_loc)+size; /* Check if we need more buffer space */ if(new_size>file->accum_buf_size) { |