Skip to content

Commit

Permalink
Develop fix rogue pointer (#183)
Browse files Browse the repository at this point in the history
Signed-off-by: David P. Chassin <dchassin@slac.stanford.edu>
  • Loading branch information
David P. Chassin authored Mar 19, 2024
1 parent bfe8dd3 commit da8ae5b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion module/pypower/powerplant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ powerplant::powerplant(MODULE *module)
PT_char256, "naics_description", get_naics_description_offset(),
PT_DESCRIPTION, "Powerplant NAICS description",

PT_int16, "plant_code", get_plant_code(),
PT_char32, "plant_code", get_plant_code_offset(),
PT_DESCRIPTION, "Generator plant code number",

PT_set, "generator", get_generator_offset(),
Expand Down Expand Up @@ -176,6 +176,7 @@ int powerplant::init(OBJECT *parent_hdr)
PyDict_SetItemString(py_kwargs,"country",PyUnicode_FromString(get_country()));
PyDict_SetItemString(py_kwargs,"naics_code",PyUnicode_FromString(get_naics_code()));
PyDict_SetItemString(py_kwargs,"naics_description",PyUnicode_FromString(get_naics_description()));
PyDict_SetItemString(py_kwargs,"plant_code",PyUnicode_FromString(get_plant_code()));
PyDict_SetItemString(py_kwargs,"generator",PyLong_FromLong(get_generator()));
PyDict_SetItemString(py_kwargs,"fuel",PyLong_FromLong(get_fuel()));
PyDict_SetItemString(py_kwargs,"operating_capacity",PyFloat_FromDouble(get_operating_capacity()));
Expand Down
14 changes: 7 additions & 7 deletions module/pypower/powerplant.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ class powerplant : public gld_object

public:
// published properties
GL_STRING(char32,city);
GL_STRING(char32,state);
GL_STRING(char32,zipcode);
GL_STRING(char32,country);
GL_STRING(char32,naics_code);
GL_STRING(char256,naics_description);
GL_ATOMIC(int16,plant_code);
GL_ATOMIC(char32,city);
GL_ATOMIC(char32,state);
GL_ATOMIC(char32,zipcode);
GL_ATOMIC(char32,country);
GL_ATOMIC(char32,naics_code);
GL_ATOMIC(char256,naics_description);
GL_ATOMIC(char32,plant_code);
GL_ATOMIC(set,generator);
GL_ATOMIC(set,fuel);
GL_ATOMIC(enumeration,status)
Expand Down

0 comments on commit da8ae5b

Please sign in to comment.