Skip to content

Commit

Permalink
- Inline listEmpty and STRUCT_HDR for records
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7220 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Nov 27, 2010
1 parent 8171d25 commit 27c54b9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion c_runtime/meta_modelica.c
Expand Up @@ -361,6 +361,7 @@ int mmc_boxes_equal(void* lhs, void* rhs)
EXIT(1);
}

/*
mmc__uniontype__metarecord__typedef__equal_rettype
mmc__uniontype__metarecord__typedef__equal(void* ut,int ex_ctor,int fieldNums)
{
Expand All @@ -373,13 +374,14 @@ mmc__uniontype__metarecord__typedef__equal(void* ut,int ex_ctor,int fieldNums)
numslots = MMC_HDRSLOTS(hdr);
ctor = 255 & (hdr >> 2);
if (numslots == fieldNums+1 && ctor == ex_ctor+3) { /* RECORD */
if (numslots == fieldNums+1 && ctor == ex_ctor+3) { // RECORD
desc = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(ut),1));
return 1;
} else {
return 0;
}
}
*/

void debug__print(const char* prefix, void* any)
{
Expand Down
3 changes: 2 additions & 1 deletion c_runtime/meta_modelica.h
Expand Up @@ -154,7 +154,8 @@ int mmc_boxes_equal(void*, void*);
void mmc__unbox(modelica_metatype box, void* res);

typedef modelica_boolean mmc__uniontype__metarecord__typedef__equal_rettype;
mmc__uniontype__metarecord__typedef__equal_rettype mmc__uniontype__metarecord__typedef__equal(void*,int,int);
#define mmc__uniontype__metarecord__typedef__equal(UT,CTOR,NFIELDS) (MMC_GETHDR(UT)==MMC_STRUCTHDR(NFIELDS+1,CTOR+3))
/* mmc__uniontype__metarecord__typedef__equal_rettype mmc__uniontype__metarecord__typedef__equal(void*,int,int); */

void debug__print(const char*,void*); /* For debugging */
void printAny(void*); /* For debugging */
Expand Down
2 changes: 2 additions & 0 deletions c_runtime/meta_modelica_builtin.cpp
Expand Up @@ -562,10 +562,12 @@ listRest_rettype listRest(modelica_metatype lst)
return MMC_CDR(lst);
}

/*
listEmpty_rettype listEmpty(modelica_metatype lst)
{
return MMC_NILTEST(lst) ? 1 : 0;
}
*/

listDelete_rettype listDelete(modelica_metatype lst, modelica_integer ix)
{
Expand Down
2 changes: 1 addition & 1 deletion c_runtime/meta_modelica_builtin.h
Expand Up @@ -188,7 +188,7 @@ listMember_rettype listMember(modelica_metatype, modelica_metatype);
listGet_rettype listGet(modelica_metatype, modelica_integer);
listNth_rettype listNth(modelica_metatype, modelica_integer);
listRest_rettype listRest(modelica_metatype);
listEmpty_rettype listEmpty(modelica_metatype);
#define listEmpty(LST) MMC_NILTEST(LST)
listDelete_rettype listDelete(modelica_metatype, modelica_integer);
#define cons(X,XS) mmc_mk_cons(X,XS)

Expand Down

0 comments on commit 27c54b9

Please sign in to comment.