Skip to content

Commit

Permalink
- Keep listNth in simulation runtime until we have a new tar-ball.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23482 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
perost committed Nov 20, 2014
1 parent c70276b commit d6fbc97
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions SimulationRuntime/c/meta/meta_modelica_builtin.c
Expand Up @@ -512,6 +512,11 @@ modelica_metatype boxptr_listGet(threadData_t *threadData,modelica_metatype lst,
MMC_THROW_INTERNAL(); /* List was not long enough */
}

modelica_metatype boxptr_listNth(threadData_t *threadData,modelica_metatype lst, modelica_metatype i)
{
return boxptr_listGet(threadData,lst,mmc_mk_icon(mmc_unbox_integer(i)+1));
}

modelica_metatype boxptr_listDelete(threadData_t *threadData, modelica_metatype lst, modelica_metatype iix)
{
/* TODO: If we assume the index exists we can do this in a much better way */
Expand Down
1 change: 1 addition & 0 deletions SimulationRuntime/c/meta/meta_modelica_builtin.h
Expand Up @@ -103,6 +103,7 @@ extern modelica_integer listLength(modelica_metatype);
#define isNone(X) MMC_OPTIONNONE(X)
#define isSome(X) MMC_OPTIONSOME(X)

extern modelica_metatype boxptr_listNth(threadData_t*,modelica_metatype,modelica_metatype);
extern modelica_metatype boxptr_listGet(threadData_t*,modelica_metatype,modelica_metatype);
extern modelica_metatype boxptr_listDelete(threadData_t*,modelica_metatype,modelica_metatype);
extern modelica_metatype boxptr_listRest(threadData_t*,modelica_metatype);
Expand Down
2 changes: 2 additions & 0 deletions SimulationRuntime/c/meta/meta_modelica_builtin_boxvar.h
Expand Up @@ -81,6 +81,8 @@ static const MMC_DEFSTRUCTLIT(boxvar_lit_listLength,2,0) {(modelica_metatype)box
#define boxvar_listLength MMC_REFSTRUCTLIT(boxvar_lit_listLength)
static const MMC_DEFSTRUCTLIT(boxvar_lit_listMember,2,0) {(modelica_metatype)boxptr_listMember,0}};
#define boxvar_listMember MMC_REFSTRUCTLIT(boxvar_lit_listMember)
static const MMC_DEFSTRUCTLIT(boxvar_lit_listNth,2,0) {(modelica_metatype)boxptr_listNth,0}};
#define boxvar_listNth MMC_REFSTRUCTLIT(boxvar_lit_listNth)
static const MMC_DEFSTRUCTLIT(boxvar_lit_listRest,2,0) {(modelica_metatype)boxptr_listRest,0}};
#define boxvar_listRest MMC_REFSTRUCTLIT(boxvar_lit_listRest)
static const MMC_DEFSTRUCTLIT(boxvar_lit_listReverse,2,0) {(modelica_metatype)boxptr_listReverse,0}};
Expand Down
1 change: 1 addition & 0 deletions SimulationRuntime/c/meta/meta_modelica_gen_boxvar.py
Expand Up @@ -42,6 +42,7 @@
'listHead',
'listLength',
'listMember',
'listNth',
'listRest',
'listReverse',
'listReverseInPlace',
Expand Down

0 comments on commit d6fbc97

Please sign in to comment.