Skip to content

Commit

Permalink
- Force nogen for Interactive.getComponents
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10072 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Oct 10, 2011
1 parent ad6d3ae commit aea416c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
18 changes: 17 additions & 1 deletion Compiler/Script/Interactive.mo
Expand Up @@ -10810,6 +10810,22 @@ algorithm
end getNthComponent2;

public function getComponents
"function: getComponents
This function takes a `ComponentRef\', a `Program\' and an int and returns
a list of all components, as returned by get_nth_component."
input Absyn.ComponentRef cr;
input SymbolTable st;
output String outString;
output SymbolTable outSt;
protected
Boolean nogen;
algorithm
nogen := RTOpts.setDebugFlag("nogen",true);
(outString,outSt) := getComponents2(cr,st);
_ := RTOpts.setDebugFlag("nogen",nogen);
end getComponents;

protected function getComponents2
"function: getComponents
This function takes a `ComponentRef\', a `Program\' and an int and returns
a list of all components, as returned by get_nth_component."
Expand Down Expand Up @@ -10856,7 +10872,7 @@ algorithm
(res,st);
case (_,_) then ("Error",st);
end matchcontinue;
end getComponents;
end getComponents2;

protected function getComponentAnnotations "function: getComponentAnnotations
This function takes a `ComponentRef\', a `Program\' and
Expand Down
6 changes: 3 additions & 3 deletions Compiler/Util/RTOpts.mo
Expand Up @@ -82,10 +82,10 @@ end debugFlag;

public function setDebugFlag
input String inString;
input Integer value;
output Boolean str;
input Boolean value;
output Boolean oldval;

external "C" str = RTOpts_setDebugFlag(inString,value) annotation(Library = "omcruntime");
external "C" oldval = RTOpts_setDebugFlag(inString,value) annotation(Library = "omcruntime");
end setDebugFlag;

public function noProc
Expand Down
10 changes: 5 additions & 5 deletions Compiler/runtime/rtoptsimpl.c
Expand Up @@ -158,7 +158,7 @@ static int set_debug_flags(const char *flagstr)
debug_all=1;
}
if (flag!=flagc) {
fprintf(stderr, "Error in setting flags.\n",flag,flagc);
fprintf(stderr, "Error in setting flags.\n");
return -1;
}

Expand All @@ -183,7 +183,7 @@ static int set_debug_flag(char const* strdata, long value)
{
debug_flags[i] = (char*) "";
// TODO: realloc memory when count(empty_entries) > _const
return 0;
return 1;
}
return 1;
}
Expand All @@ -194,7 +194,7 @@ static int set_debug_flag(char const* strdata, long value)
debug_flagc+=1;
debug_flags = (char**)realloc(debug_flags, debug_flagc * sizeof(char*));
debug_flags[debug_flagc-1] = (char*)strdata;
return 1;
return 0;
}

int check_debug_flag(char const* strdata)
Expand Down Expand Up @@ -270,7 +270,7 @@ static int set_preOptModules(const char *flagstr)
}
}
if (flag!=flagc) {
fprintf(stderr, "Error in setting preOptModule flags.\n",flag,flagc);
fprintf(stderr, "Error in setting preOptModule flags.\n");
return -1;
}

Expand Down Expand Up @@ -320,7 +320,7 @@ static int set_pastOptModules(const char *flagstr)
}
}
if (flag!=flagc) {
fprintf(stderr, "Error in setting pastOptModule flags.\n",flag,flagc);
fprintf(stderr, "Error in setting pastOptModule flags.\n");
return -1;
}

Expand Down

0 comments on commit aea416c

Please sign in to comment.