mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
Using C-types only in capi function definitions.
This commit is contained in:
parent
54df651888
commit
520b07a131
2 changed files with 4 additions and 4 deletions
|
|
@ -1085,14 +1085,14 @@ openmc_cell_get_temperature(int32_t index, const int32_t* instance, double* T)
|
|||
|
||||
//! Get the name of a cell
|
||||
extern "C" int
|
||||
openmc_cell_get_name(int32_t index, char*& name) {
|
||||
openmc_cell_get_name(int32_t index, char** name) {
|
||||
if (index < 0 || index >= model::cells.size()) {
|
||||
strcpy(openmc_err_msg, "Index in cells array is out of bounds.");
|
||||
return OPENMC_E_OUT_OF_BOUNDS;
|
||||
}
|
||||
|
||||
auto name_str = model::cells[index]->name_;
|
||||
strcpy(name, name_str.c_str());
|
||||
strcpy(*name, name_str.c_str());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1382,14 +1382,14 @@ openmc_material_set_id(int32_t index, int32_t id)
|
|||
}
|
||||
|
||||
extern "C" int
|
||||
openmc_material_get_name(int32_t index, char*& name) {
|
||||
openmc_material_get_name(int32_t index, char** name) {
|
||||
if (index < 0 || index >= model::materials.size()) {
|
||||
strcpy(openmc_err_msg, "Index in materials array is out of bounds.");
|
||||
return OPENMC_E_OUT_OF_BOUNDS;
|
||||
}
|
||||
|
||||
auto name_str = model::materials[index]->name();
|
||||
strcpy(name, name_str.c_str());
|
||||
strcpy(*name, name_str.c_str());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue