2022-07-31 17:15:32 +02:00
|
|
|
#include "val.h"
|
2018-05-14 23:30:48 +02:00
|
|
|
|
2022-07-31 17:15:32 +02:00
|
|
|
cw_Val_t * cw_ktv_cast(cw_Val_t *v,const cw_Type_t * type)
|
2018-05-14 23:30:48 +02:00
|
|
|
{
|
|
|
|
if (strcmp(v->type->name,type->name)==0)
|
|
|
|
return v;
|
|
|
|
if (type->cast==NULL)
|
|
|
|
return NULL;
|
|
|
|
if (!type->cast(v))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
|