Skip to content

Commit

Permalink
Code cleanup for the adevs backend
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18116 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
smiz committed Nov 13, 2013
1 parent a837809 commit e497155
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions Compiler/Template/CodegenAdevs.tpl
Expand Up @@ -352,7 +352,6 @@ case SIMCODE(modelInfo = MODELINFO(varInfo = vi as VARINFO(__))) then
delays(NULL),
eventFuncs(NULL)
{
push_memory_states(1); // Prep the OMC C Runtime memory pool
timeValue = 0.0;
if (numRelations() > 0)
zc = new int[numRelations()];
Expand Down Expand Up @@ -397,7 +396,6 @@ case SIMCODE(modelInfo = MODELINFO(varInfo = vi as VARINFO(__))) then
if (eventFuncs[i] != NULL) delete eventFuncs[i];
delete [] eventFuncs;
}
pop_memory_states(NULL); // Delete the OMC memory pool
}

<%makeExtraResiduals(allEquations,lastIdentOfPath(modelInfo.name))%>
Expand Down Expand Up @@ -970,9 +968,6 @@ case SIMCODE(modelInfo = MODELINFO(vars = vars as SIMVARS(__))) then
<<
void <%lastIdentOfPath(modelInfo.name)%>::calc_vars(const double* q, bool doReinit)
{
// Clear the memory pool to make room for new modelica
// array allocations.
clear_current_state();
bool reInit = false;
active_model = this;
if (atEvent || doReinit) clear_event_flags();
Expand Down Expand Up @@ -3458,8 +3453,7 @@ case RANGE(__) then
<%preExp%>
<%startVar%> = <%startValue%>; <%stepVar%> = <%stepValue%>; <%stopVar%> = <%stopValue%>;
if (!<%stepVar%>) {
omc_fileInfo info = omc_dummyFileInfo;
MODELICA_ASSERT(info, "assertion range step != 0 failed");
MODELICA_ASSERT(__FILE__,__LINE__,"assertion range step != 0 failed");
} else if (!(((<%stepVar%> > 0) && (<%startVar%> > <%stopVar%>)) || ((<%stepVar%> < 0) && (<%startVar%> < <%stopVar%>)))) {
<%type%> <%iterName%>;
for (<%iterName%> = <%startValue%>; in_range_<%shortType%>(<%iterName%>, <%startVar%>, <%stopVar%>); <%iterName%> += <%stepVar%>) {
Expand Down Expand Up @@ -5658,8 +5652,7 @@ template assertCommon(Exp condition, Exp message, Context context, Text &varDecl
<%preExpCond%>
if (!<%condVar%>) {
<%preExpMsg%>
omc_fileInfo info = {<%infoArgs(info)%>};
MODELICA_ASSERT(info, <%if acceptMetaModelicaGrammar() then 'MMC_STRINGDATA(<%msgVar%>)' else msgVar%>);
MODELICA_ASSERT(__FILE__,__LINE__,<%if acceptMetaModelicaGrammar() then 'MMC_STRINGDATA(<%msgVar%>)' else msgVar%>);
}
>>
end assertCommon;
Expand Down

0 comments on commit e497155

Please sign in to comment.