diff --git a/acc/samples/common_header.h b/acc/samples/common_header.h index 5e4e4e6..a5b46d4 100644 --- a/acc/samples/common_header.h +++ b/acc/samples/common_header.h @@ -273,20 +273,20 @@ typedef enum { */ typedef enum { AC_FOR_INT_PARAM_TYPES(AC_GEN_ID), - NUM_INT_PARAM_TYPES + NUM_INT_PARAMS } AcIntParam; typedef enum { AC_FOR_REAL_PARAM_TYPES(AC_GEN_ID), - NUM_REAL_PARAM_TYPES + NUM_REAL_PARAMS } AcRealParam; extern const char* intparam_names[]; // Defined in astaroth.cu extern const char* realparam_names[]; // Defined in astaroth.cu typedef struct { - int int_params[NUM_INT_PARAM_TYPES]; - AcReal real_params[NUM_REAL_PARAM_TYPES]; + int int_params[NUM_INT_PARAMS]; + AcReal real_params[NUM_REAL_PARAMS]; } AcMeshInfo; /* diff --git a/src/standalone/config_loader.cc b/src/standalone/config_loader.cc index 3eb33a8..7a0a509 100644 --- a/src/standalone/config_loader.cc +++ b/src/standalone/config_loader.cc @@ -37,9 +37,9 @@ static inline void print(const AcMeshInfo& config) { - for (int i = 0; i < NUM_INT_PARAM_TYPES; ++i) + for (int i = 0; i < NUM_INT_PARAMS; ++i) printf("[%s]: %d\n", intparam_names[i], config.int_params[i]); - for (int i = 0; i < NUM_REAL_PARAM_TYPES; ++i) + for (int i = 0; i < NUM_REAL_PARAMS; ++i) printf("[%s]: %g\n", realparam_names[i], double(config.real_params[i])); } @@ -77,9 +77,9 @@ parse_config(const char* path, AcMeshInfo* config) continue; int idx = -1; - if ((idx = find_str(keyword, intparam_names, NUM_INT_PARAM_TYPES)) >= 0) + if ((idx = find_str(keyword, intparam_names, NUM_INT_PARAMS)) >= 0) config->int_params[idx] = atoi(value); - else if ((idx = find_str(keyword, realparam_names, NUM_REAL_PARAM_TYPES)) >= 0) + else if ((idx = find_str(keyword, realparam_names, NUM_REAL_PARAMS)) >= 0) config->real_params[idx] = AcReal(atof(value)); }