From 39d2e30fa271a218b2171a88c48e5aac9772d8b5 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 5 Dec 2023 09:19:07 -0700 Subject: [PATCH] EXODUS: Address static analyzer suggestions --- .../exodus/src/ex__get_glob_vars_multi_time.c | 16 +-- .../exodus/src/ex__get_nodal_var_multi_time.c | 23 ++-- .../seacas/libraries/exodus/src/ex_copy.c | 27 ++-- .../seacas/libraries/exodus/src/ex_inquire.c | 122 +++++++++--------- 4 files changed, 93 insertions(+), 95 deletions(-) diff --git a/packages/seacas/libraries/exodus/src/ex__get_glob_vars_multi_time.c b/packages/seacas/libraries/exodus/src/ex__get_glob_vars_multi_time.c index f5bd51e450..1a1886985e 100644 --- a/packages/seacas/libraries/exodus/src/ex__get_glob_vars_multi_time.c +++ b/packages/seacas/libraries/exodus/src/ex__get_glob_vars_multi_time.c @@ -33,18 +33,16 @@ int exi_get_glob_vars_multi_time(int exoid, int num_glob_vars, int beg_time_step, int end_time_step, void *glob_var_vals) { - int varid; - int status; - size_t start[2], count[2]; - char errmsg[MAX_ERR_LENGTH]; - EX_FUNC_ENTER(); if (exi_check_valid_file_id(exoid, __func__) == EX_FATAL) { EX_FUNC_LEAVE(EX_FATAL); } /* inquire previously defined variable */ + int varid; + int status; if ((status = nc_inq_varid(exoid, VAR_GLO_VAR, &varid)) != NC_NOERR) { + char errmsg[MAX_ERR_LENGTH]; snprintf(errmsg, MAX_ERR_LENGTH, "Warning: failed to locate global variables in file id %d", exoid); ex_err_fn(exoid, __func__, errmsg, status); @@ -52,11 +50,8 @@ int exi_get_glob_vars_multi_time(int exoid, int num_glob_vars, int beg_time_step } /* read values of global variables */ - start[0] = --beg_time_step; - start[1] = 0; - - count[0] = end_time_step - beg_time_step; - count[1] = num_glob_vars; + size_t start[] = {--beg_time_step, 0}; + size_t count[] = {end_time_step - beg_time_step, num_glob_vars}; if (exi_comp_ws(exoid) == 4) { status = nc_get_vara_float(exoid, varid, start, count, glob_var_vals); @@ -66,6 +61,7 @@ int exi_get_glob_vars_multi_time(int exoid, int num_glob_vars, int beg_time_step } if (status != NC_NOERR) { + char errmsg[MAX_ERR_LENGTH]; snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to get global variable values from file id %d", exoid); ex_err_fn(exoid, __func__, errmsg, status); diff --git a/packages/seacas/libraries/exodus/src/ex__get_nodal_var_multi_time.c b/packages/seacas/libraries/exodus/src/ex__get_nodal_var_multi_time.c index a9f190b66a..9bb94d1fe2 100644 --- a/packages/seacas/libraries/exodus/src/ex__get_nodal_var_multi_time.c +++ b/packages/seacas/libraries/exodus/src/ex__get_nodal_var_multi_time.c @@ -67,29 +67,28 @@ error = exi_get_nodal_var_multi_time(exoid, var_index, num_nodes, int exi_get_nodal_var_multi_time(int exoid, int nodal_var_index, int64_t num_nodes, int beg_time_step, int end_time_step, void *nodal_var_vals) { - int varid; - int status; - size_t start[3], count[3]; - char errmsg[MAX_ERR_LENGTH]; - if (exi_check_valid_file_id(exoid, __func__) == EX_FATAL) { EX_FUNC_LEAVE(EX_FATAL); } /* inquire previously defined variable */ - /* Need to see how this works in the parallel-aware exodus... */ if (num_nodes == 0) { - return (EX_NOERR); + return EX_NOERR; } + size_t start[3]; + size_t count[3]; + int status; + int varid; if (ex_large_model(exoid) == 0) { /* read values of the nodal variable */ if ((status = nc_inq_varid(exoid, VAR_NOD_VAR, &varid)) != NC_NOERR) { + char errmsg[MAX_ERR_LENGTH]; snprintf(errmsg, MAX_ERR_LENGTH, "Warning: could not find nodal variables in file id %d", exoid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_WARN); + return EX_WARN; } start[0] = --beg_time_step; @@ -104,10 +103,11 @@ int exi_get_nodal_var_multi_time(int exoid, int nodal_var_index, int64_t num_nod /* read values of the nodal variable -- stored as separate variables... */ /* Get the varid.... */ if ((status = nc_inq_varid(exoid, VAR_NOD_VAR_NEW(nodal_var_index), &varid)) != NC_NOERR) { + char errmsg[MAX_ERR_LENGTH]; snprintf(errmsg, MAX_ERR_LENGTH, "Warning: could not find nodal variable %d in file id %d", nodal_var_index, exoid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_WARN); + return EX_WARN; } start[0] = --beg_time_step; @@ -125,9 +125,10 @@ int exi_get_nodal_var_multi_time(int exoid, int nodal_var_index, int64_t num_nod } if (status != NC_NOERR) { + char errmsg[MAX_ERR_LENGTH]; snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to get nodal variables in file id %d", exoid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_FATAL); + return EX_FATAL; } - return (EX_NOERR); + return EX_NOERR; } diff --git a/packages/seacas/libraries/exodus/src/ex_copy.c b/packages/seacas/libraries/exodus/src/ex_copy.c index 878c9b11f8..e7807dc9d4 100644 --- a/packages/seacas/libraries/exodus/src/ex_copy.c +++ b/packages/seacas/libraries/exodus/src/ex_copy.c @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2022 National Technology & Engineering Solutions + * Copyright(C) 1999-2023 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -173,7 +173,7 @@ int ex_copy_transient(int in_exoid, int out_exoid) } /*! \cond INTERNAL */ -int cpy_variable_data(int in_exoid, int out_exoid, int in_large, int mesh_only) +static int cpy_variable_data(int in_exoid, int out_exoid, int in_large, int mesh_only) { int nvars; /* number of variables */ EXCHECKI(nc_inq(in_exoid, NULL, &nvars, NULL, NULL)); @@ -212,7 +212,7 @@ int cpy_variable_data(int in_exoid, int out_exoid, int in_large, int mesh_only) } /*! \cond INTERNAL */ -int cpy_variables(int in_exoid, int out_exoid, int in_large, int mesh_only) +static int cpy_variables(int in_exoid, int out_exoid, int in_large, int mesh_only) { int recdimid; /* id of unlimited dimension */ int nvars; /* number of variables */ @@ -253,7 +253,7 @@ int cpy_variables(int in_exoid, int out_exoid, int in_large, int mesh_only) /*! \endcond */ /*! \cond INTERNAL */ -int cpy_dimension(int in_exoid, int out_exoid, int mesh_only) +static int cpy_dimension(int in_exoid, int out_exoid, int mesh_only) { int dim_out_id; /* dimension id */ @@ -339,7 +339,7 @@ int cpy_dimension(int in_exoid, int out_exoid, int mesh_only) } /*! \cond INTERNAL */ -int cpy_global_att(int in_exoid, int out_exoid) +static int cpy_global_att(int in_exoid, int out_exoid) { struct ncatt att; /* attribute */ @@ -389,7 +389,7 @@ int cpy_global_att(int in_exoid, int out_exoid) /*! \endcond */ /*! \cond INTERNAL */ -int cpy_att(int in_id, int out_id, int var_in_id, int var_out_id) +static int cpy_att(int in_id, int out_id, int var_in_id, int var_out_id) { /* Routine to copy all the attributes from the input netCDF file to the output netCDF file. If var_in_id == NC_GLOBAL, @@ -418,7 +418,7 @@ int cpy_att(int in_id, int out_id, int var_in_id, int var_out_id) /*! \endcond */ /*! \internal */ -int cpy_coord_def(int in_id, int out_id, int rec_dim_id, char *var_nm, int in_large) +static int cpy_coord_def(int in_id, int out_id, int rec_dim_id, char *var_nm, int in_large) { /* Handle easiest situation first: in_large matches out_large (1) */ if (in_large == 1) { @@ -476,7 +476,7 @@ int cpy_coord_def(int in_id, int out_id, int rec_dim_id, char *var_nm, int in_la /*! \endcond */ /*! \internal */ -int cpy_var_def(int in_id, int out_id, int rec_dim_id, char *var_nm) +static int cpy_var_def(int in_id, int out_id, int rec_dim_id, char *var_nm) { /* Routine to copy the variable metadata from an input netCDF file * to an output netCDF file. @@ -547,7 +547,7 @@ int cpy_var_def(int in_id, int out_id, int rec_dim_id, char *var_nm) } /* end cpy_var_def() */ /*! \internal */ -int cpy_var_val(int in_id, int out_id, char *var_nm) +static int cpy_var_val(int in_id, int out_id, char *var_nm) { void *void_ptr = NULL; /* Routine to copy the variable data from an input netCDF file @@ -727,7 +727,7 @@ int cpy_var_val(int in_id, int out_id, char *var_nm) } /* end cpy_var_val() */ /*! \internal */ -int cpy_coord_val(int in_id, int out_id, char *var_nm, int in_large) +static int cpy_coord_val(int in_id, int out_id, char *var_nm, int in_large) { /* Routine to copy the coordinate data from an input netCDF file * to an output netCDF file. @@ -794,7 +794,7 @@ int cpy_coord_val(int in_id, int out_id, char *var_nm, int in_large) } /* end cpy_coord_val() */ /*! \internal */ -void update_structs(int out_exoid) +static void update_structs(int out_exoid) { update_internal_structs(out_exoid, EX_INQ_EDGE_BLK, exi_get_counter_list(EX_EDGE_BLOCK)); update_internal_structs(out_exoid, EX_INQ_FACE_BLK, exi_get_counter_list(EX_FACE_BLOCK)); @@ -815,7 +815,8 @@ void update_structs(int out_exoid) } /*! \internal */ -void update_internal_structs(int out_exoid, ex_inquiry inqcode, struct exi_list_item **ctr_list) +static void update_internal_structs(int out_exoid, ex_inquiry inqcode, + struct exi_list_item **ctr_list) { int64_t number = ex_inquire_int(out_exoid, inqcode); if (number > 0) { @@ -825,7 +826,7 @@ void update_internal_structs(int out_exoid, ex_inquiry inqcode, struct exi_list_ } } -size_t type_size(nc_type type) +static size_t type_size(nc_type type) { if (type == NC_CHAR) { return sizeof(char); /* OK */ diff --git a/packages/seacas/libraries/exodus/src/ex_inquire.c b/packages/seacas/libraries/exodus/src/ex_inquire.c index 0c521b2ec1..b104dbb420 100644 --- a/packages/seacas/libraries/exodus/src/ex_inquire.c +++ b/packages/seacas/libraries/exodus/src/ex_inquire.c @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2022 National Technology & Engineering Solutions + * Copyright(C) 1999-2023 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -19,13 +19,13 @@ static int exi_get_dimension_value(int exoid, int64_t *var, int default_value, if ((status = nc_inq_dimid(exoid, dimension_name, &dimid)) != NC_NOERR) { *var = default_value; if (missing_ok) { - return (EX_NOERR); + return EX_NOERR; } char errmsg[MAX_ERR_LENGTH]; snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to retrieve dimension %s for file id %d", dimension_name, exoid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_FATAL); + return EX_FATAL; } size_t idum; if ((status = nc_inq_dimlen(exoid, dimid, &idum)) != NC_NOERR) { @@ -35,10 +35,10 @@ static int exi_get_dimension_value(int exoid, int64_t *var, int default_value, "ERROR: failed to retrieve value for dimension %s for file id %d", dimension_name, exoid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_FATAL); + return EX_FATAL; } *var = idum; - return (EX_NOERR); + return EX_NOERR; } static int ex_get_concat_set_len(int exoid, int64_t *set_length, const char *set_name, @@ -56,7 +56,7 @@ static int ex_get_concat_set_len(int exoid, int64_t *set_length, const char *set snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to get number of %s sets in file id %d", set_name, exoid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_FATAL); + return EX_FATAL; } /* Allocate space for stat array */ @@ -68,7 +68,7 @@ static int ex_get_concat_set_len(int exoid, int64_t *set_length, const char *set "array for file id %d", set_name, exoid); ex_err_fn(exoid, __func__, errmsg, EX_MEMFAIL); - return (EX_FATAL); + return EX_FATAL; } /* get variable id of status array */ @@ -82,7 +82,7 @@ static int ex_get_concat_set_len(int exoid, int64_t *set_length, const char *set snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to get %s set status array from file id %d", set_name, exoid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_FATAL); + return EX_FATAL; } } else { /* default: status is true */ @@ -104,14 +104,14 @@ static int ex_get_concat_set_len(int exoid, int64_t *set_length, const char *set else { *set_length = 0; free(stat_vals); - return (EX_FATAL); + return EX_FATAL; } } else { if (nc_inq_dimlen(exoid, dimid, &idum) != NC_NOERR) { *set_length = 0; free(stat_vals); - return (EX_FATAL); + return EX_FATAL; } } @@ -120,7 +120,7 @@ static int ex_get_concat_set_len(int exoid, int64_t *set_length, const char *set free(stat_vals); } - return (EX_NOERR); + return EX_NOERR; } static void flt_cvt(float *xptr, double x) { *xptr = (float)x; } @@ -138,7 +138,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float int num_var; if (exi_check_valid_file_id(exoid, __func__) == EX_FATAL) { - return (EX_FATAL); + return EX_FATAL; } if (ret_char) { @@ -147,7 +147,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float if (!ret_int) { snprintf(errmsg, MAX_ERR_LENGTH, "Warning: integer argument is NULL which is not allowed."); ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); - return (EX_FATAL); + return EX_FATAL; } int rootid = exoid & EX_FILE_ID_MASK; @@ -156,10 +156,10 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float case EX_INQ_FILE_TYPE: /* obsolete call */ - /*returns "r" for regular EXODUS file or "h" for history EXODUS file*/ + /*return "r" for regular EXODUS file or "h" for history EXODUS file*/ snprintf(errmsg, MAX_ERR_LENGTH, "Warning: file type inquire is obsolete"); ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); - return (EX_WARN); + return EX_WARN; case EX_INQ_API_VERS: /* returns the EXODUS API version number */ @@ -168,7 +168,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float "Warning: float argument is NULL for EX_INQ_API_VERS " "which is not allowed."); ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); - return (EX_FATAL); + return EX_FATAL; } if (nc_get_att_float(rootid, NC_GLOBAL, ATT_API_VERSION, ret_float) != @@ -178,7 +178,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to get EXODUS API version for file id %d", rootid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_FATAL); + return EX_FATAL; } } @@ -191,14 +191,14 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float "Warning: float argument is NULL for EX_INQ_DB_VERS " "which is not allowed."); ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); - return (EX_FATAL); + return EX_FATAL; } if ((status = nc_get_att_float(rootid, NC_GLOBAL, ATT_VERSION, ret_float)) != NC_NOERR) { snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to get EXODUS database version for file id %d", rootid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_FATAL); + return EX_FATAL; } break; @@ -230,7 +230,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to get name string length in file id %d", exoid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_FATAL); + return EX_FATAL; } *ret_int = name_length - 1; @@ -288,7 +288,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float "for file id %d", rootid); ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); - return (EX_FATAL); + return EX_FATAL; } else { /* returns the title of the database */ @@ -299,7 +299,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to get database title for file id %d", exoid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_FATAL); + return EX_FATAL; } ex_copy_string(ret_char, tmp_title, MAX_LINE_LENGTH + 1); } @@ -309,7 +309,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float /* returns the dimensionality (2 or 3, for 2-d or 3-d) of the database */ if (exi_get_dimension(exoid, DIM_NUM_DIM, "database dimensionality", &ldum, &dimid, __func__) != NC_NOERR) { - return (EX_FATAL); + return EX_FATAL; } *ret_int = ldum; break; @@ -402,7 +402,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to get number of node sets in file id %d", exoid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_FATAL); + return EX_FATAL; } for (size_t i = 0; i < num_sets; i++) { @@ -417,7 +417,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float "ERROR: failed to locate number of dist fact for %zu'th node set in file id %d", i, exoid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_FATAL); + return EX_FATAL; } } else { @@ -427,7 +427,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float "ERROR: failed to locate number of nodes in %zu'th node set in file id %d", i, exoid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_FATAL); + return EX_FATAL; } if ((status = nc_inq_dimlen(exoid, dimid, &idum)) != NC_NOERR) { *ret_int = 0; @@ -435,7 +435,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float "ERROR: failed to get number of nodes in %zu'th node set in file id %d", i, exoid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_FATAL); + return EX_FATAL; } } *ret_int += idum; @@ -465,7 +465,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to get number of side sets in file id %d", exoid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_FATAL); + return EX_FATAL; } int *ids = NULL; @@ -474,14 +474,14 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to allocate memory for side set ids for file id %d", exoid); ex_err_fn(exoid, __func__, errmsg, EX_MEMFAIL); - return (EX_FATAL); + return EX_FATAL; } if (ex_get_ids(exoid, EX_SIDE_SET, ids) == EX_FATAL) { snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to get side set ids in file id %d", exoid); ex_err_fn(exoid, __func__, errmsg, EX_LASTERR); free(ids); - return (EX_FATAL); + return EX_FATAL; } /* allocate space for stat array */ @@ -492,7 +492,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float "array for file id %d", exoid); ex_err_fn(exoid, __func__, errmsg, EX_MEMFAIL); - return (EX_FATAL); + return EX_FATAL; } /* get variable id of status array */ if (nc_inq_varid(exoid, VAR_SS_STAT, &varid) == NC_NOERR) { @@ -505,7 +505,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to get element block status array from file id %d", exoid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_FATAL); + return EX_FATAL; } } else { /* default: status is true */ @@ -546,7 +546,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float ex_err_fn(exoid, __func__, errmsg, status); free(stat_vals); free(ids); - return (EX_FATAL); + return EX_FATAL; } } @@ -583,7 +583,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to get number of side sets in file id %d", exoid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_FATAL); + return EX_FATAL; } for (size_t i = 0; i < num_sets; i++) { @@ -598,7 +598,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float "ERROR: failed to locate number of dist fact for %zu'th side set in file id %d", i, exoid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_FATAL); + return EX_FATAL; } } else { @@ -608,7 +608,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float "ERROR: failed to get number of dist factors in %zu'th side set in file id %d", i, exoid); ex_err_fn(exoid, __func__, errmsg, status); - return (EX_FATAL); + return EX_FATAL; } } *ret_int += ldum; @@ -640,7 +640,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float case EX_INQ_TIME: /* returns the number of time steps stored in the database */ if (exi_get_dimension(exoid, DIM_TIME, "time dimension", &ldum, &dimid, __func__) != NC_NOERR) { - return (EX_FATAL); + return EX_FATAL; } *ret_int = ldum; break; @@ -693,21 +693,21 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float case EX_INQ_EDGE: /* returns the number of edges (defined across all edge blocks). */ if (exi_get_dimension_value(exoid, ret_int, 0, DIM_NUM_EDGE, 1) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } break; case EX_INQ_EDGE_BLK: /* returns the number of edge blocks. */ if (exi_get_dimension_value(exoid, ret_int, 0, DIM_NUM_ED_BLK, 1) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } break; case EX_INQ_EDGE_SETS: /* returns the number of edge sets. */ if (exi_get_dimension_value(exoid, ret_int, 0, DIM_NUM_ES, 1) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } break; @@ -737,21 +737,21 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float case EX_INQ_FACE: /* returns the number of faces (defined across all face blocks). */ if (exi_get_dimension_value(exoid, ret_int, 0, DIM_NUM_FACE, 1) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } break; case EX_INQ_FACE_BLK: /* returns the number of face blocks. */ if (exi_get_dimension_value(exoid, ret_int, 0, DIM_NUM_FA_BLK, 1) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } break; case EX_INQ_FACE_SETS: /* returns the number of face sets. */ if (exi_get_dimension_value(exoid, ret_int, 0, DIM_NUM_FS, 1) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } break; @@ -781,7 +781,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float case EX_INQ_ELEM_SETS: /* returns the number of element sets. */ if (exi_get_dimension_value(exoid, ret_int, 0, DIM_NUM_ELS, 1) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } break; @@ -804,83 +804,83 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float case EX_INQ_EDGE_MAP: /* returns the number of edge maps. */ if (exi_get_dimension_value(exoid, ret_int, 0, DIM_NUM_EDM, 1) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } break; case EX_INQ_FACE_MAP: /* returns the number of face maps. */ if (exi_get_dimension_value(exoid, ret_int, 0, DIM_NUM_FAM, 1) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } break; case EX_INQ_NUM_NODE_VAR: if (ex_get_variable_param(exoid, EX_NODAL, &num_var) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } *ret_int = num_var; break; case EX_INQ_NUM_EDGE_BLOCK_VAR: if (ex_get_variable_param(exoid, EX_EDGE_BLOCK, &num_var) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } *ret_int = num_var; break; case EX_INQ_NUM_FACE_BLOCK_VAR: if (ex_get_variable_param(exoid, EX_FACE_BLOCK, &num_var) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } *ret_int = num_var; break; case EX_INQ_NUM_ELEM_BLOCK_VAR: if (ex_get_variable_param(exoid, EX_ELEM_BLOCK, &num_var) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } *ret_int = num_var; break; case EX_INQ_NUM_NODE_SET_VAR: if (ex_get_variable_param(exoid, EX_NODE_SET, &num_var) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } *ret_int = num_var; break; case EX_INQ_NUM_EDGE_SET_VAR: if (ex_get_variable_param(exoid, EX_EDGE_SET, &num_var) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } *ret_int = num_var; break; case EX_INQ_NUM_FACE_SET_VAR: if (ex_get_variable_param(exoid, EX_FACE_SET, &num_var) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } *ret_int = num_var; break; case EX_INQ_NUM_ELEM_SET_VAR: if (ex_get_variable_param(exoid, EX_ELEM_SET, &num_var) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } *ret_int = num_var; break; case EX_INQ_NUM_SIDE_SET_VAR: if (ex_get_variable_param(exoid, EX_SIDE_SET, &num_var) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } *ret_int = num_var; break; case EX_INQ_NUM_GLOBAL_VAR: if (ex_get_variable_param(exoid, EX_GLOBAL, &num_var) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } *ret_int = num_var; break; @@ -888,7 +888,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float case EX_INQ_COORD_FRAMES: /* return the number of coordinate frames */ if (exi_get_dimension_value(exoid, ret_int, 0, DIM_NUM_CFRAMES, 1) != EX_NOERR) { - return (EX_FATAL); + return EX_FATAL; } break; @@ -936,7 +936,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float "null for file id %d", exoid); ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); - return (EX_FATAL); + return EX_FATAL; } #if NC_HAS_HDF5 nc_inq_grpname(exoid, ret_char); @@ -968,7 +968,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float "null for file id %d", exoid); ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); - return (EX_FATAL); + return EX_FATAL; } #if NC_HAS_HDF5 nc_inq_grpname_full(exoid, NULL, ret_char); @@ -990,9 +990,9 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float *ret_int = 0; snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: invalid inquiry %d", req_info); ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); - return (EX_FATAL); + return EX_FATAL; } - return (EX_NOERR); + return EX_NOERR; } /*!