Skip to content

Commit

Permalink
change const for list and remove free function
Browse files Browse the repository at this point in the history
  • Loading branch information
pnorbert authored and vicentebolea committed Aug 1, 2023
1 parent 0879d08 commit 29b9b68
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
8 changes: 3 additions & 5 deletions source/adios2/core/adios2_libinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static const char *aae[] = {"BP3",
"Skeleton",
nullptr};

void adios2_available_engines(int *nentries, char const ***list)
void adios2_available_engines(int *nentries, char const *const **list)
{
int ne = 0;
while (aae[ne] != nullptr)
Expand Down Expand Up @@ -99,7 +99,7 @@ static const char *aao[] = {
"None",
nullptr};

void adios2_available_operators(int *nentries, char const ***list)
void adios2_available_operators(int *nentries, char const *const **list)
{
int no = 0;
while (aao[no] != nullptr)
Expand Down Expand Up @@ -148,7 +148,7 @@ static const char *aaf[] = {
#endif
nullptr};

void adios2_available_features(int *nentries, char const ***list)
void adios2_available_features(int *nentries, char const *const **list)
{
int nf = 0;
while (aaf[nf] != nullptr)
Expand All @@ -158,8 +158,6 @@ void adios2_available_features(int *nentries, char const ***list)
return;
}

void adios2_free_list(int nentries, char const ***list) {}

#ifdef __cplusplus
} // end extern C
#endif
11 changes: 3 additions & 8 deletions source/adios2/core/adios2_libinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,13 @@ extern const int adios2_version_patch;
extern const char *const adios2_version_str;

/** Return the list of available Engines in the installed adios2 library */
void adios2_available_engines(int *nentries, char const ***list);
void adios2_available_engines(int *nentries, char const *const **list);

/** Return the list of available Engines in the installed adios2 library */
void adios2_available_operators(int *nentries, char const ***list);
void adios2_available_operators(int *nentries, char const *const **list);

/** Return the list of available features in the installed adios2 library */
void adios2_available_features(int *nentries, char const ***list);

/** Free function for list returned by adios2_available_engines() and
* adios2_available_operators()
*/
void adios2_free_list(int nentries, char const ***list);
void adios2_available_features(int *nentries, char const *const **list);

#ifdef __cplusplus
} // end extern C
Expand Down
9 changes: 3 additions & 6 deletions source/utils/bpls/bpls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ void print_bpls_version()
printf("Target Arch: %s\n", ADIOS_INFO_ARCH);

int nengines;
char const **list_engines;
char const *const *list_engines;
adios2_available_engines(&nengines, &list_engines);
printf("Available engines = %d:", nengines);
for (int i = 0; i < nengines; ++i)
Expand All @@ -260,10 +260,9 @@ void print_bpls_version()
}
}
printf("\n");
adios2_free_list(nengines, &list_engines);

int noperators;
char const **list_operators;
char const *const *list_operators;
adios2_available_operators(&noperators, &list_operators);
printf("Available operators = %d:", noperators);
for (int i = 0; i < noperators; ++i)
Expand All @@ -275,10 +274,9 @@ void print_bpls_version()
}
}
printf("\n");
adios2_free_list(noperators, &list_operators);

int nfeatures;
char const **list_features;
char const *const *list_features;
adios2_available_features(&nfeatures, &list_features);
printf("Available features = %d:", nfeatures);
for (int i = 0; i < nfeatures; ++i)
Expand All @@ -290,7 +288,6 @@ void print_bpls_version()
}
}
printf("\n");
adios2_free_list(nfeatures, &list_features);
}
}

Expand Down

0 comments on commit 29b9b68

Please sign in to comment.