Skip to content

Commit

Permalink
Committing clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 22, 2021
1 parent 7b15818 commit e6fe300
Show file tree
Hide file tree
Showing 7 changed files with 190 additions and 107 deletions.
9 changes: 6 additions & 3 deletions src/H5FDspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ H5FD__free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size)
HDassert(size > 0);

#ifdef H5FD_ALLOC_DEBUG
HDfprintf(stderr, "%s: type = %u, addr = " H5_PRINTF_HADDR_FMT ", size = " H5_PRINTF_HSIZE_FMT "\n", __func__, (unsigned)type, addr, size);
HDfprintf(stderr, "%s: type = %u, addr = " H5_PRINTF_HADDR_FMT ", size = " H5_PRINTF_HSIZE_FMT "\n",
__func__, (unsigned)type, addr, size);
#endif /* H5FD_ALLOC_DEBUG */

/* Sanity checking */
Expand Down Expand Up @@ -330,8 +331,10 @@ H5FD__free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size)
else {
/* leak memory */
#ifdef H5FD_ALLOC_DEBUG
HDfprintf(stderr, "%s: LEAKED MEMORY!!! type = %u, addr = " H5_PRINTF_HADDR_FMT ", size = " H5_PRINTF_HSIZE_FMT "\n", __func__, (unsigned)type,
addr, size);
HDfprintf(stderr,
"%s: LEAKED MEMORY!!! type = %u, addr = " H5_PRINTF_HADDR_FMT
", size = " H5_PRINTF_HSIZE_FMT "\n",
__func__, (unsigned)type, addr, size);
#endif /* H5FD_ALLOC_DEBUG */
} /* end else */

Expand Down
37 changes: 22 additions & 15 deletions src/H5FS.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ H5FS_create(H5F_t *f, haddr_t *fs_addr, const H5FS_create_t *fs_create, uint16_t
/* Set the return value */
ret_value = fspace;
#ifdef H5FS_DEBUG
HDfprintf(stderr, "%s: fspace = %p, fspace->addr = " H5_PRINTF_HADDR_FMT "\n", __func__, (void *)fspace, fspace->addr);
HDfprintf(stderr, "%s: fspace = %p, fspace->addr = " H5_PRINTF_HADDR_FMT "\n", __func__, (void *)fspace,
fspace->addr);
#endif /* H5FS_DEBUG */

done:
Expand Down Expand Up @@ -180,8 +181,8 @@ H5FS_open(H5F_t *f, haddr_t fs_addr, uint16_t nclasses, const H5FS_section_class

FUNC_ENTER_NOAPI(NULL)
#ifdef H5FS_DEBUG
HDfprintf(stderr, "%s: Opening free space manager, fs_addr = " H5_PRINTF_HADDR_FMT ", nclasses = %Zu\n", __func__, fs_addr,
nclasses);
HDfprintf(stderr, "%s: Opening free space manager, fs_addr = " H5_PRINTF_HADDR_FMT ", nclasses = %Zu\n",
__func__, fs_addr, nclasses);
#endif /* H5FS_DEBUG */

/* Check arguments. */
Expand All @@ -203,7 +204,8 @@ H5FS_open(H5F_t *f, haddr_t fs_addr, uint16_t nclasses, const H5FS_section_class
#ifdef H5FS_DEBUG
HDfprintf(stderr, "%s: fspace->sect_addr = " H5_PRINTF_HADDR_FMT "\n", __func__, fspace->sect_addr);
HDfprintf(stderr, "%s: fspace->sect_size = " H5_PRINTF_HSIZE_FMT "\n", __func__, fspace->sect_size);
HDfprintf(stderr, "%s: fspace->alloc_sect_size = " H5_PRINTF_HSIZE_FMT "\n", __func__, fspace->alloc_sect_size);
HDfprintf(stderr, "%s: fspace->alloc_sect_size = " H5_PRINTF_HSIZE_FMT "\n", __func__,
fspace->alloc_sect_size);
HDfprintf(stderr, "%s: fspace->sinfo = %p\n", __func__, (void *)fspace->sinfo);
HDfprintf(stderr, "%s: fspace->rc = %u\n", __func__, fspace->rc);
#endif /* H5FS_DEBUG */
Expand Down Expand Up @@ -248,7 +250,8 @@ H5FS_delete(H5F_t *f, haddr_t fs_addr)

FUNC_ENTER_NOAPI(FAIL)
#ifdef H5FS_DEBUG
HDfprintf(stderr, "%s: Deleting free space manager, fs_addr = " H5_PRINTF_HADDR_FMT "\n", __func__, fs_addr);
HDfprintf(stderr, "%s: Deleting free space manager, fs_addr = " H5_PRINTF_HADDR_FMT "\n", __func__,
fs_addr);
#endif /* H5FS_DEBUG */

/* Check arguments. */
Expand Down Expand Up @@ -404,20 +407,24 @@ H5FS_close(H5F_t *f, H5FS_t *fspace)
HDassert(f);
HDassert(fspace);
#ifdef H5FS_DEBUG
HDfprintf(stderr, "%s: Entering, fspace = %p, fspace->addr = " H5_PRINTF_HADDR_FMT ", fspace->sinfo = %p\n", __func__, (void *)fspace,
fspace->addr, (void *)fspace->sinfo);
HDfprintf(stderr,
"%s: Entering, fspace = %p, fspace->addr = " H5_PRINTF_HADDR_FMT ", fspace->sinfo = %p\n",
__func__, (void *)fspace, fspace->addr, (void *)fspace->sinfo);
#endif /* H5FS_DEBUG */

/* Check if section info is valid */
/* (i.e. the header "owns" the section info and it's not in the cache) */
if (fspace->sinfo) {
#ifdef H5FS_DEBUG
HDfprintf(stderr,
"%s: fspace->tot_sect_count = " H5_PRINTF_HSIZE_FMT ", fspace->serial_sect_count = " H5_PRINTF_HSIZE_FMT ", fspace->sect_addr = "
H5_PRINTF_HADDR_FMT ", fspace->rc = %u\n",
"%s: fspace->tot_sect_count = " H5_PRINTF_HSIZE_FMT
", fspace->serial_sect_count = " H5_PRINTF_HSIZE_FMT
", fspace->sect_addr = " H5_PRINTF_HADDR_FMT ", fspace->rc = %u\n",
__func__, fspace->tot_sect_count, fspace->serial_sect_count, fspace->sect_addr, fspace->rc);
HDfprintf(stderr, "%s: fspace->alloc_sect_size = " H5_PRINTF_HSIZE_FMT ", fspace->sect_size = " H5_PRINTF_HSIZE_FMT "\n", __func__,
fspace->alloc_sect_size, fspace->sect_size);
HDfprintf(stderr,
"%s: fspace->alloc_sect_size = " H5_PRINTF_HSIZE_FMT
", fspace->sect_size = " H5_PRINTF_HSIZE_FMT "\n",
__func__, fspace->alloc_sect_size, fspace->sect_size);
#endif /* H5FS_DEBUG */
/* If there are sections to serialize, update them */
/* (if the free space manager is persistent) */
Expand Down Expand Up @@ -708,8 +715,8 @@ H5FS__incr(H5FS_t *fspace)

FUNC_ENTER_PACKAGE
#ifdef H5FS_DEBUG
HDfprintf(stderr, "%s: Entering, fpace->addr = " H5_PRINTF_HADDR_FMT ", fspace->rc = %u\n", __func__, fspace->addr,
fspace->rc);
HDfprintf(stderr, "%s: Entering, fpace->addr = " H5_PRINTF_HADDR_FMT ", fspace->rc = %u\n", __func__,
fspace->addr, fspace->rc);
#endif /* H5FS_DEBUG */

/*
Expand Down Expand Up @@ -748,8 +755,8 @@ H5FS__decr(H5FS_t *fspace)

FUNC_ENTER_PACKAGE
#ifdef H5FS_DEBUG
HDfprintf(stderr, "%s: Entering, fpace->addr = " H5_PRINTF_HADDR_FMT ", fspace->rc = %u\n", __func__, fspace->addr,
fspace->rc);
HDfprintf(stderr, "%s: Entering, fpace->addr = " H5_PRINTF_HADDR_FMT ", fspace->rc = %u\n", __func__,
fspace->addr, fspace->rc);
#endif /* H5FS_DEBUG */

/*
Expand Down
63 changes: 42 additions & 21 deletions src/H5FSsection.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ H5FS__sinfo_new(H5F_t *f, H5FS_t *fspace)
sinfo->sect_off_size = (fspace->max_sect_addr + 7) / 8;
sinfo->sect_len_size = H5VM_limit_enc_size((uint64_t)fspace->max_sect_size);
#ifdef H5FS_SINFO_DEBUG
HDfprintf(stderr, "%s: fspace->max_sect_size = " H5_PRINTF_HSIZE_FMT "\n", __func__, fspace->max_sect_size);
HDfprintf(stderr, "%s: fspace->max_sect_size = " H5_PRINTF_HSIZE_FMT "\n", __func__,
fspace->max_sect_size);
HDfprintf(stderr, "%s: fspace->max_sect_addr = %u\n", __func__, fspace->max_sect_addr);
HDfprintf(stderr, "%s: sinfo->nbins = %u\n", __func__, sinfo->nbins);
HDfprintf(stderr, "%s: sinfo->sect_off_size = %u, sinfo->sect_len_size = %u\n", __func__,
Expand Down Expand Up @@ -200,10 +201,14 @@ H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode)
FUNC_ENTER_STATIC

#ifdef H5FS_SINFO_DEBUG
HDfprintf(stderr, "%s: Called, fspace->addr = " H5_PRINTF_HADDR_FMT ", fspace->sinfo = %p, fspace->sect_addr = " H5_PRINTF_HADDR_FMT "\n", __func__,
fspace->addr, (void *)fspace->sinfo, fspace->sect_addr);
HDfprintf(stderr, "%s: fspace->alloc_sect_size = " H5_PRINTF_HSIZE_FMT ", fspace->sect_size = " H5_PRINTF_HSIZE_FMT "\n", __func__,
fspace->alloc_sect_size, fspace->sect_size);
HDfprintf(stderr,
"%s: Called, fspace->addr = " H5_PRINTF_HADDR_FMT
", fspace->sinfo = %p, fspace->sect_addr = " H5_PRINTF_HADDR_FMT "\n",
__func__, fspace->addr, (void *)fspace->sinfo, fspace->sect_addr);
HDfprintf(stderr,
"%s: fspace->alloc_sect_size = " H5_PRINTF_HSIZE_FMT
", fspace->sect_size = " H5_PRINTF_HSIZE_FMT "\n",
__func__, fspace->alloc_sect_size, fspace->sect_size);
#endif /* H5FS_SINFO_DEBUG */

/* Check arguments. */
Expand Down Expand Up @@ -251,8 +256,9 @@ H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode)
HDassert(H5F_addr_defined(fspace->addr));

#ifdef H5FS_SINFO_DEBUG
HDfprintf(stderr, "%s: Reading in existing sections, fspace->sect_addr = " H5_PRINTF_HADDR_FMT "\n", __func__,
fspace->sect_addr);
HDfprintf(stderr,
"%s: Reading in existing sections, fspace->sect_addr = " H5_PRINTF_HADDR_FMT "\n",
__func__, fspace->sect_addr);
#endif /* H5FS_SINFO_DEBUG */
/* Protect the free space sections */
cache_udata.f = f;
Expand Down Expand Up @@ -289,10 +295,14 @@ H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode)

done:
#ifdef H5FS_SINFO_DEBUG
HDfprintf(stderr, "%s: Leaving, fspace->addr = " H5_PRINTF_HADDR_FMT ", fspace->sinfo = %p, fspace->sect_addr = " H5_PRINTF_HADDR_FMT "\n",
HDfprintf(stderr,
"%s: Leaving, fspace->addr = " H5_PRINTF_HADDR_FMT
", fspace->sinfo = %p, fspace->sect_addr = " H5_PRINTF_HADDR_FMT "\n",
__func__, fspace->addr, (void *)fspace->sinfo, fspace->sect_addr);
HDfprintf(stderr, "%s: fspace->alloc_sect_size = " H5_PRINTF_HSIZE_FMT ", fspace->sect_size = " H5_PRINTF_HSIZE_FMT "\n", __func__,
fspace->alloc_sect_size, fspace->sect_size);
HDfprintf(stderr,
"%s: fspace->alloc_sect_size = " H5_PRINTF_HSIZE_FMT
", fspace->sect_size = " H5_PRINTF_HSIZE_FMT "\n",
__func__, fspace->alloc_sect_size, fspace->sect_size);
#endif /* H5FS_SINFO_DEBUG */
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FS__sinfo_lock() */
Expand Down Expand Up @@ -331,14 +341,18 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified)

FUNC_ENTER_STATIC
#ifdef H5FS_SINFO_DEBUG
HDfprintf(stderr, "%s: Called, modified = %d, fspace->addr = " H5_PRINTF_HADDR_FMT ", fspace->sect_addr = " H5_PRINTF_HADDR_FMT "\n", __func__,
modified, fspace->addr, fspace->sect_addr);
HDfprintf(stderr,
"%s: Called, modified = %d, fspace->addr = " H5_PRINTF_HADDR_FMT
", fspace->sect_addr = " H5_PRINTF_HADDR_FMT "\n",
__func__, modified, fspace->addr, fspace->sect_addr);
HDfprintf(
stderr,
"%s: fspace->sinfo_lock_count = %u, fspace->sinfo_modified = %d, fspace->sinfo_protected = %d\n",
__func__, fspace->sinfo_lock_count, fspace->sinfo_modified, fspace->sinfo_protected);
HDfprintf(stderr, "%s: fspace->alloc_sect_size = " H5_PRINTF_HSIZE_FMT ", fspace->sect_size = " H5_PRINTF_HSIZE_FMT "\n", __func__,
fspace->alloc_sect_size, fspace->sect_size);
HDfprintf(stderr,
"%s: fspace->alloc_sect_size = " H5_PRINTF_HSIZE_FMT
", fspace->sect_size = " H5_PRINTF_HSIZE_FMT "\n",
__func__, fspace->alloc_sect_size, fspace->sect_size);
#endif /* H5FS_SINFO_DEBUG */

/* Check arguments. */
Expand Down Expand Up @@ -490,7 +504,8 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified)

#ifdef H5FS_SINFO_DEBUG
HDfprintf(stderr,
"%s: Freeing section info on disk, old_sect_addr = " H5_PRINTF_HADDR_FMT ", old_alloc_sect_size = " H5_PRINTF_HSIZE_FMT "\n",
"%s: Freeing section info on disk, old_sect_addr = " H5_PRINTF_HADDR_FMT
", old_alloc_sect_size = " H5_PRINTF_HSIZE_FMT "\n",
__func__, old_sect_addr, old_alloc_sect_size);
#endif /* H5FS_SINFO_DEBUG */
/* Release space for section info in file */
Expand Down Expand Up @@ -1343,7 +1358,8 @@ H5FS_sect_add(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flag
FUNC_ENTER_NOAPI(FAIL)

#ifdef H5FS_SINFO_DEBUG
HDfprintf(stderr, "%s: *sect = {" H5_PRINTF_HADDR_FMT ", " H5_PRINTF_HSIZE_FMT ", %u, %s}\n", __func__, sect->addr, sect->size, sect->type,
HDfprintf(stderr, "%s: *sect = {" H5_PRINTF_HADDR_FMT ", " H5_PRINTF_HSIZE_FMT ", %u, %s}\n", __func__,
sect->addr, sect->size, sect->type,
(sect->state == H5FS_SECT_LIVE ? "H5FS_SECT_LIVE" : "H5FS_SECT_SERIALIZED"));
#endif /* H5FS_SINFO_DEBUG */

Expand Down Expand Up @@ -1429,8 +1445,10 @@ H5FS_sect_try_extend(H5F_t *f, H5FS_t *fspace, haddr_t addr, hsize_t size, hsize
FUNC_ENTER_NOAPI(FAIL)

#ifdef H5FS_SINFO_DEBUG
HDfprintf(stderr, "%s: addr = " H5_PRINTF_HADDR_FMT ", size = " H5_PRINTF_HSIZE_FMT ", extra_requested = " H5_PRINTF_HSIZE_FMT "\n", __func__, addr, size,
extra_requested);
HDfprintf(stderr,
"%s: addr = " H5_PRINTF_HADDR_FMT ", size = " H5_PRINTF_HSIZE_FMT
", extra_requested = " H5_PRINTF_HSIZE_FMT "\n",
__func__, addr, size, extra_requested);
#endif /* H5FS_SINFO_DEBUG */

/* Check arguments. */
Expand All @@ -1442,9 +1460,12 @@ H5FS_sect_try_extend(H5F_t *f, H5FS_t *fspace, haddr_t addr, hsize_t size, hsize

/* Check for any sections on free space list */
#ifdef H5FS_SINFO_DEBUG
HDfprintf(stderr, "%s: fspace->tot_sect_count = " H5_PRINTF_HSIZE_FMT "\n", __func__, fspace->tot_sect_count);
HDfprintf(stderr, "%s: fspace->serial_sect_count = " H5_PRINTF_HSIZE_FMT "\n", __func__, fspace->serial_sect_count);
HDfprintf(stderr, "%s: fspace->ghost_sect_count = " H5_PRINTF_HSIZE_FMT "\n", __func__, fspace->ghost_sect_count);
HDfprintf(stderr, "%s: fspace->tot_sect_count = " H5_PRINTF_HSIZE_FMT "\n", __func__,
fspace->tot_sect_count);
HDfprintf(stderr, "%s: fspace->serial_sect_count = " H5_PRINTF_HSIZE_FMT "\n", __func__,
fspace->serial_sect_count);
HDfprintf(stderr, "%s: fspace->ghost_sect_count = " H5_PRINTF_HSIZE_FMT "\n", __func__,
fspace->ghost_sect_count);
#endif /* H5FS_SINFO_DEBUG */
if (fspace->tot_sect_count > 0) {
H5FS_section_info_t *sect; /* Temporary free space section */
Expand Down
Loading

0 comments on commit e6fe300

Please sign in to comment.