Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Fix issue with output of complex with invalid notation (#298)
Browse files Browse the repository at this point in the history
* Fix issue with output of complex with invalid notation coming from complex.h
* Update json.cpp
  • Loading branch information
David P. Chassin committed Aug 26, 2019
1 parent ef8b34b commit e5c7acc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions gldcore/complex.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,16 @@ inline DEPRECATED double complex_set_ang(C,D) {}; // TODO
// Method: Notation
inline CNOTATION & Notation(void) /**< access to notation */
{
switch (f)
{
case A:
case I:
case J:
case R:
break;
default:
f = I;
}
return f;
};

Expand Down
2 changes: 1 addition & 1 deletion gldcore/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ int GldJsonWriter::write_classes(FILE *fp)
if ( oclass->has_runtime ) TUPLE("runtime","%s",oclass->runtime);
if ( oclass->pmap != NULL )
len += write(",");
for ( prop = oclass->pmap ; prop != NULL ; prop=(prop->next?prop->next:(prop->oclass->parent?prop->oclass->parent->pmap:NULL)) )
for ( prop = oclass->pmap ; prop != NULL && prop->oclass == oclass ; prop=prop->next ) // note: do not output parent classes properties
{
KEYWORD *key;
const char *ptype = class_get_property_typename(prop->ptype);
Expand Down

0 comments on commit e5c7acc

Please sign in to comment.