Skip to content

Commit

Permalink
Adds const to a few global variables (#623)
Browse files Browse the repository at this point in the history
* Committing clang-format changes

* Adds consts to a few global variables

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
derobins and github-actions[bot] authored May 4, 2021
1 parent 3899e09 commit c7d45c2
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 65 deletions.
52 changes: 26 additions & 26 deletions src/H5Clog_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,32 +118,32 @@ static herr_t H5C__json_write_remove_entry_log_msg(void *udata, const H5C_cache_
/* Note that there's no cache set up call since that's the
* place where this struct is wired into the cache.
*/
static H5C_log_class_t H5C_json_log_class_g = {"json",
H5C__json_tear_down_logging,
NULL, /* start logging */
NULL, /* stop logging */
H5C__json_write_start_log_msg,
H5C__json_write_stop_log_msg,
H5C__json_write_create_cache_log_msg,
H5C__json_write_destroy_cache_log_msg,
H5C__json_write_evict_cache_log_msg,
H5C__json_write_expunge_entry_log_msg,
H5C__json_write_flush_cache_log_msg,
H5C__json_write_insert_entry_log_msg,
H5C__json_write_mark_entry_dirty_log_msg,
H5C__json_write_mark_entry_clean_log_msg,
H5C__json_write_mark_unserialized_entry_log_msg,
H5C__json_write_mark_serialized_entry_log_msg,
H5C__json_write_move_entry_log_msg,
H5C__json_write_pin_entry_log_msg,
H5C__json_write_create_fd_log_msg,
H5C__json_write_protect_entry_log_msg,
H5C__json_write_resize_entry_log_msg,
H5C__json_write_unpin_entry_log_msg,
H5C__json_write_destroy_fd_log_msg,
H5C__json_write_unprotect_entry_log_msg,
H5C__json_write_set_cache_config_log_msg,
H5C__json_write_remove_entry_log_msg};
static const H5C_log_class_t H5C_json_log_class_g = {"json",
H5C__json_tear_down_logging,
NULL, /* start logging */
NULL, /* stop logging */
H5C__json_write_start_log_msg,
H5C__json_write_stop_log_msg,
H5C__json_write_create_cache_log_msg,
H5C__json_write_destroy_cache_log_msg,
H5C__json_write_evict_cache_log_msg,
H5C__json_write_expunge_entry_log_msg,
H5C__json_write_flush_cache_log_msg,
H5C__json_write_insert_entry_log_msg,
H5C__json_write_mark_entry_dirty_log_msg,
H5C__json_write_mark_entry_clean_log_msg,
H5C__json_write_mark_unserialized_entry_log_msg,
H5C__json_write_mark_serialized_entry_log_msg,
H5C__json_write_move_entry_log_msg,
H5C__json_write_pin_entry_log_msg,
H5C__json_write_create_fd_log_msg,
H5C__json_write_protect_entry_log_msg,
H5C__json_write_resize_entry_log_msg,
H5C__json_write_unpin_entry_log_msg,
H5C__json_write_destroy_fd_log_msg,
H5C__json_write_unprotect_entry_log_msg,
H5C__json_write_set_cache_config_log_msg,
H5C__json_write_remove_entry_log_msg};

/*-------------------------------------------------------------------------
* Function: H5C__json_write_log_message
Expand Down
52 changes: 26 additions & 26 deletions src/H5Clog_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,32 +113,32 @@ static herr_t H5C__trace_write_remove_entry_log_msg(void *udata, const H5C_cache
/* Note that there's no cache set up call since that's the
* place where this struct is wired into the cache.
*/
static H5C_log_class_t H5C_trace_log_class_g = {"trace",
H5C__trace_tear_down_logging,
NULL, /* start logging */
NULL, /* stop logging */
NULL, /* write start message */
NULL, /* write stop message */
NULL, /* write create cache message */
NULL, /* write destroy cache message */
NULL, /* write evict cache message */
H5C__trace_write_expunge_entry_log_msg,
H5C__trace_write_flush_cache_log_msg,
H5C__trace_write_insert_entry_log_msg,
H5C__trace_write_mark_entry_dirty_log_msg,
H5C__trace_write_mark_entry_clean_log_msg,
H5C__trace_write_mark_unserialized_entry_log_msg,
H5C__trace_write_mark_serialized_entry_log_msg,
H5C__trace_write_move_entry_log_msg,
H5C__trace_write_pin_entry_log_msg,
H5C__trace_write_create_fd_log_msg,
H5C__trace_write_protect_entry_log_msg,
H5C__trace_write_resize_entry_log_msg,
H5C__trace_write_unpin_entry_log_msg,
H5C__trace_write_destroy_fd_log_msg,
H5C__trace_write_unprotect_entry_log_msg,
H5C__trace_write_set_cache_config_log_msg,
H5C__trace_write_remove_entry_log_msg};
static const H5C_log_class_t H5C_trace_log_class_g = {"trace",
H5C__trace_tear_down_logging,
NULL, /* start logging */
NULL, /* stop logging */
NULL, /* write start message */
NULL, /* write stop message */
NULL, /* write create cache message */
NULL, /* write destroy cache message */
NULL, /* write evict cache message */
H5C__trace_write_expunge_entry_log_msg,
H5C__trace_write_flush_cache_log_msg,
H5C__trace_write_insert_entry_log_msg,
H5C__trace_write_mark_entry_dirty_log_msg,
H5C__trace_write_mark_entry_clean_log_msg,
H5C__trace_write_mark_unserialized_entry_log_msg,
H5C__trace_write_mark_serialized_entry_log_msg,
H5C__trace_write_move_entry_log_msg,
H5C__trace_write_pin_entry_log_msg,
H5C__trace_write_create_fd_log_msg,
H5C__trace_write_protect_entry_log_msg,
H5C__trace_write_resize_entry_log_msg,
H5C__trace_write_unpin_entry_log_msg,
H5C__trace_write_destroy_fd_log_msg,
H5C__trace_write_unprotect_entry_log_msg,
H5C__trace_write_set_cache_config_log_msg,
H5C__trace_write_remove_entry_log_msg};

/*-------------------------------------------------------------------------
* Function: H5C__trace_write_log_message
Expand Down
14 changes: 7 additions & 7 deletions src/H5MF.c
Original file line number Diff line number Diff line change
Expand Up @@ -1442,13 +1442,13 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi
htri_t
H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size)
{
H5MF_free_section_t * node = NULL; /* Free space section pointer */
H5MF_sect_ud_t udata; /* User data for callback */
H5FS_section_class_t *sect_cls; /* Section class */
H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
H5AC_ring_t fsm_ring = H5AC_RING_INV; /* Ring of FSM */
H5F_mem_page_t fs_type; /* Free space type */
htri_t ret_value = FALSE; /* Return value */
H5MF_free_section_t * node = NULL; /* Free space section pointer */
H5MF_sect_ud_t udata; /* User data for callback */
const H5FS_section_class_t *sect_cls; /* Section class */
H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
H5AC_ring_t fsm_ring = H5AC_RING_INV; /* Ring of FSM */
H5F_mem_page_t fs_type; /* Free space type */
htri_t ret_value = FALSE; /* Return value */

FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL)
#ifdef H5MF_ALLOC_DEBUG
Expand Down
6 changes: 3 additions & 3 deletions src/H5MFpkg.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ typedef struct H5MF_fs_t {
/*****************************/

/* H5MF single section inherits serializable properties from H5FS_section_class_t */
H5_DLLVAR H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SIMPLE[1];
H5_DLLVAR H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1];
H5_DLLVAR H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1];
H5_DLLVAR const H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SIMPLE[1];
H5_DLLVAR const H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1];
H5_DLLVAR const H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1];

/******************************/
/* Package Private Prototypes */
Expand Down
6 changes: 3 additions & 3 deletions src/H5MFsection.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static herr_t H5MF__sect_large_shrink(H5FS_section_info_t **_sect, void *udata);
/*********************/

/* Class info for "simple" free space sections */
H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SIMPLE[1] = {{
const H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SIMPLE[1] = {{
/* Class variables */
H5MF_FSPACE_SECT_SIMPLE, /* Section type */
0, /* Extra serialized size */
Expand All @@ -107,7 +107,7 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SIMPLE[1] = {{
}};

/* Class info for "small" free space sections */
H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1] = {{
const H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1] = {{
/* Class variables */
H5MF_FSPACE_SECT_SMALL, /* Section type */
0, /* Extra serialized size */
Expand All @@ -133,7 +133,7 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1] = {{
}};

/* Class info for "large" free space sections */
H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1] = {{
const H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1] = {{
/* Class variables */
H5MF_FSPACE_SECT_LARGE, /* Section type */
0, /* Extra serialized size */
Expand Down

0 comments on commit c7d45c2

Please sign in to comment.