Skip to content

Commit

Permalink
- getOptionValue is changed to isOptionNone.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@9703 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Aug 26, 2011
1 parent de132dc commit d618069
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
22 changes: 2 additions & 20 deletions c_runtime/meta/meta_modelica.c
Expand Up @@ -604,27 +604,9 @@ char* getRecordElementName(void* any, int element) {
/*
* Used by MDT for debugging just return whether Option type contain something or not.
* */
char* getOptionValue(void* any)
int isOptionNone(void* any)
{
mmc_uint_t hdr;
int numslots;
unsigned ctor;

initializeStringBuffer();

hdr = MMC_HDR_UNMARK(MMC_GETHDR(any));
numslots = MMC_HDRSLOTS(hdr);
ctor = MMC_HDRCTOR(hdr);

if (numslots==0 && ctor==1) /* NONE() */ {
checkAnyStringBufSize(0,7);
sprintf(anyStringBuf, "NONE()");
}
else if (numslots==1 && ctor==1) /* SOME(x) */ {
checkAnyStringBufSize(0,7);
sprintf(anyStringBuf, "SOME()");
}
return strdup(anyStringBuf);
return MMC_OPTIONNONE(any);
}

unsigned long mmc_prim_hash(void *p)
Expand Down
3 changes: 2 additions & 1 deletion c_runtime/meta/meta_modelica.h
Expand Up @@ -124,6 +124,7 @@ typedef int mmc_sint_t;
#define MMC_STRUCTDATA(x) (((struct mmc_struct*)MMC_UNTAGPTR(x))->data)
#define MMC_ARRAY_TAG 255
#define MMC_STRLEN(x) (MMC_HDRSTRLEN(MMC_GETHDR(x)))
#define MMC_OPTIONNONE(x) (0==MMC_HDRSLOTS(MMC_GETHDR(x)) ? 1 : 0)

/*
* adrpo: if a structure has pointers
Expand Down Expand Up @@ -430,7 +431,7 @@ void printAny(void*); /* For debugging */
void printTypeOfAny(void*); /* For debugging */
char* getTypeOfAny(void*); /* For debugging */
char* getRecordElementName(void*, int); /* For debugging */
char* getOptionValue(void*); /* For debugging */
int isOptionNone(void*); /* For debugging */

/*
* Generated (Meta)Records should access a static, constant value of
Expand Down

0 comments on commit d618069

Please sign in to comment.