Skip to content

Commit

Permalink
- Added SimCodeC.tpl error when we fail to write an initial value to …
Browse files Browse the repository at this point in the history
…the text-file

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@8594 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Apr 12, 2011
1 parent 81b7d98 commit 3220594
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Compiler/susan_codegen/SimCode/SimCodeC.tpl
Expand Up @@ -2364,7 +2364,7 @@ template initVal(Exp initialValue)
case SCONST(__) then '"<%Util.escapeModelicaStringToCString(string)%>"'
case BCONST(__) then if bool then "true" else "false"
case ENUM_LITERAL(__) then '<%index%>/*ENUM:<%dotPath(name)%>*/'
else "*ERROR* initial value of unknown type"
else error(sourceInfo(), 'initial value of unknown type: <%printExpStr(initialValue)%>')
end initVal;

template commonHeader()
Expand Down Expand Up @@ -2820,6 +2820,7 @@ template functionHeaderImpl(String fname, list<Variable> fargs, list<Variable> o
DLLExport
int in_<%fname%>(type_description * inArgs, type_description * outVar);
>>

if outVars then <<
<%outVars |> _ hasindex i1 fromindex 1 => '#define <%fname%>_rettype<%boxStr%>_<%i1%> targ<%i1%>' ;separator="\n"%>
typedef struct <%fname%>_rettype<%boxStr%>_s
Expand Down Expand Up @@ -5850,6 +5851,7 @@ match exp
case CONS(__) then
let tmp = tempDecl("modelica_metatype", &varDecls /*BUFD*/)
let carExp = daeExp(car, context, &preExp /*BUFC*/, &varDecls /*BUFD*/)

let cdrExp = daeExp(cdr, context, &preExp /*BUFC*/, &varDecls /*BUFD*/)
let &preExp += '<%tmp%> = mmc_mk_cons(<%carExp%>, <%cdrExp%>);<%\n%>'
tmp
Expand Down

0 comments on commit 3220594

Please sign in to comment.