Skip to content

Commit

Permalink
- fix broken tests by including generic_array.h :)
Browse files Browse the repository at this point in the history
  well, C thinks is something returning int if is not defined and it actually returns void*.
- beautify some stuff in CodegenC.tpl

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17315 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Sep 21, 2013
1 parent 1e96fdd commit 293c06d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Compiler/Template/CodegenC.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8036,12 +8036,12 @@ case ARRAY(array = array, scalar = scalar, ty = T_ARRAY(ty = t as T_COMPLEX(__))
let arrayTypeStr = expTypeArray(ty)
let arrayVar = tempDecl(arrayTypeStr, &varDecls /*BUFD*/)
let rec_name = expTypeShort(t)
let &preExp += 'alloc_generic_array(&<%arrayVar%>, sizeof(<%rec_name%>), 1, <%listLength(array)%>);<%\n%>'
let &preExp += '<%\n%>alloc_generic_array(&<%arrayVar%>, sizeof(<%rec_name%>), 1, <%listLength(array)%>);<%\n%>'
let params = (array |> e hasindex i1 fromindex 1 =>
let prefix = if scalar then '(<%expTypeFromExpModelica(e)%>)' else '&'
'(*((<%rec_name%>*)generic_array_element_addr(&<%arrayVar%>, sizeof(<%rec_name%>), 1, <%i1%>))) = <%prefix%><%daeExp(e, context, &preExp /*BUFC*/, &varDecls /*BUFD*/)%>;'
;separator="\n")
let &preExp += '<%params%>'
let &preExp += '<%params%><%\n%>'
arrayVar
case ARRAY(array={}) then
let arrayTypeStr = expTypeArray(ty)
Expand Down
1 change: 1 addition & 0 deletions SimulationRuntime/c/util/modelica.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ extern "C" {

#include "real_array.h"
#include "integer_array.h"
#include "generic_array.h"

#include "utility.h"
#include "division.h"
Expand Down

0 comments on commit 293c06d

Please sign in to comment.