Skip to content

Commit

Permalink
ticket:4144 Use anyString to print the Integer values.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 authored and OpenModelica-Hudson committed Nov 17, 2016
1 parent 901d152 commit 33b3b8e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions SimulationRuntime/c/meta/meta_modelica.c
Expand Up @@ -846,9 +846,15 @@ char* getMetaTypeElement(modelica_metatype arr, modelica_integer i, metaType mt)
}
ty = malloc(strlen(anyStringBuf) + 1);
strcpy(ty, anyStringBuf);

/* format the anyStringBuf as array to return it */
if (mt == record_metaType) {
/* if Integer then unbox the pointer */
if (strcmp(ty, "Integer") == 0) {
name = (char*)anyString(name);
formatString = "^done,omc_element={name=\"%s\",displayName=\"%s\",type=\"%s\"}";
if (-1 == GC_asprintf(&formattedString, formatString, name, displayName, ty)) {
assert(0);
}
} else if (mt == record_metaType) {
formatString = "^done,omc_element={name=\"%ld\",displayName=\"%s\",type=\"%s\"}";
if (-1 == GC_asprintf(&formattedString, formatString, (mmc_uint_t)name, displayName, ty)) {
assert(0);
Expand Down

0 comments on commit 33b3b8e

Please sign in to comment.