Skip to content

Commit

Permalink
- ged rid of empty omc_equationInfo_reverse_prof_index to be compilea…
Browse files Browse the repository at this point in the history
…ble with vs2010

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13500 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Oct 19, 2012
1 parent 7c1d635 commit 650bcf4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
29 changes: 13 additions & 16 deletions Compiler/Template/CodegenC.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,19 @@ template functionInitializeDataStruc2(ModelInfo modelInfo, list<SimEqSystem> all
<%eqnInfo%>
memcpy(data->modelData.equationInfo, &equationInfo, data->modelData.nEquations*sizeof(EQUATION_INFO));
data->modelData.nProfileBlocks = n_omc_equationInfo_reverse_prof_index;
data->modelData.nProfileBlocks = 0 <% allEquations |> eq => match eq
case SES_MIXED(__)
case SES_LINEAR(__)
case SES_NONLINEAR(__) then '+1'
%>;
data->modelData.equationInfo_reverse_prof_index = (int*) malloc(data->modelData.nProfileBlocks*sizeof(int));
memcpy(data->modelData.equationInfo_reverse_prof_index, omc_equationInfo_reverse_prof_index, data->modelData.nProfileBlocks*sizeof(int));
<%System.tmpTickReset(0)%>
<% allEquations |> eq hasindex i0 => match eq
case SES_MIXED(__)
case SES_LINEAR(__)
case SES_NONLINEAR(__) then 'data->modelData.equationInfo_reverse_prof_index[<%System.tmpTick()%>] = <%i0%>;<%\n%>'
; empty
%>
}
>>
end match
Expand Down Expand Up @@ -425,7 +435,7 @@ template globalDataVarInfoArray(String _name, list<SimVar> items, Integer offset
match items
case {} then
<<
const struct VAR_INFO <%_name%>[1] = {{-1,"","",omc_dummyFileInfo}};
const struct VAR_INFO <%_name%>[1] = {omc_dummyVarInfo};
>>
case items then
<<
Expand Down Expand Up @@ -8152,19 +8162,6 @@ template equationInfo(list<SimEqSystem> eqs, Text &eqnsDefines, Integer numEqns)
<<
<%preBuf%>
<%res%>
const int n_omc_equationInfo_reverse_prof_index = 0<% eqs |> eq => match eq
case SES_MIXED(__)
case SES_LINEAR(__)
case SES_NONLINEAR(__) then '+1'
%>;
const int omc_equationInfo_reverse_prof_index[] = {
<% eqs |> eq hasindex i0 => match eq
case SES_MIXED(__)
case SES_LINEAR(__)
case SES_NONLINEAR(__) then '<%i0%>,<%\n%>'
; empty
%>
};
>>
end equationInfo;

Expand Down
1 change: 0 additions & 1 deletion SimulationRuntime/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ ADD_SUBDIRECTORY(ModelicaExternalC)
ADD_SUBDIRECTORY(simulation)
ADD_SUBDIRECTORY(util)


# -------------------------------------------------------------
# MACRO definitions
# -------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/c/simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ SET(simulation_sources options.cpp simulation_input_xml.cpp simulation_runtime.
../linearization/linearize.cpp)

SET(simulation_headers options.h simulation_input_xml.h simulation_runtime.h
../linearization/linearize.h ../simulation_data.h)
../linearization/linearize.h ../simulation_data.h ../omc_inline.h ../omc_msvc.h ../openmodelica.h ../openmodelica_func.h)

# Library util
ADD_DEFINITIONS(/DNO_INTERACTIVE_DEPENDENCY)
Expand Down

0 comments on commit 650bcf4

Please sign in to comment.