Skip to content

Commit

Permalink
replace specialized string arrays with a converter for external "C"
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25735 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
rfranke committed Apr 24, 2015
1 parent 2d119c7 commit d8ec3c1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 414 deletions.
8 changes: 5 additions & 3 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -4501,7 +4501,7 @@ case SIMEXTARG(cref=c, isInput =iI, outputIndex=oi, isArray=true, type_=t)then
let dimsStr = checkDimension(dims)
let elType = expTypeShort(ty)
let extType = extType2(ty, true, false)
let extCStr = if stringEq(elType, "string") then '.getCStrData()'
let extCStr = if stringEq(elType, "string") then 'CStrArray'
if boolOr(intGt(listLength(dims), 1), stringEq(elType, "bool")) then
let tmp = match dimsStr
case "" then
Expand All @@ -4510,9 +4510,11 @@ case SIMEXTARG(cref=c, isInput =iI, outputIndex=oi, isArray=true, type_=t)then
tempDecl('StatArrayDim<%dimStr%><<%extType%>, <%dimsStr%>>', &varDecls /*BUFD*/)
let &inputAssign += 'convertArrayLayout(<%name%>, <%tmp%>);'
let &outputAssign += if intGt(oi, 0) then 'convertArrayLayout(<%tmp%>, <%name%>);'
'<%tmp%>.getData()<%extCStr%>'
let arg = if extCStr then 'CStrArray(<%tmp%>)' else '<%tmp%>.getData()'
'<%arg%>'
else
'<%name%>.getData()<%extCStr%>'
let arg = if extCStr then 'CStrArray(<%name%>)' else '<%name%>.getData()'
'<%arg%>'
end extCArrayArg;


Expand Down

0 comments on commit d8ec3c1

Please sign in to comment.