Esempio n. 1
0
dao_integer DaoValue_GetInteger( DaoValue *self )
{
	switch( self->type ){
	case DAO_NONE    : return 0;
	case DAO_BOOLEAN : return self->xBoolean.value;
	case DAO_INTEGER : return self->xInteger.value;
	case DAO_FLOAT   : return self->xFloat.value;
	case DAO_COMPLEX : return self->xComplex.value.real;
	case DAO_STRING  : return DString_ToInteger( self->xString.value );
	case DAO_ENUM    : return self->xEnum.value;
	default : break;
	}
	return 0;
}
Esempio n. 2
0
daoint DaoValue_GetInteger( DaoValue *self )
{
	switch( self->type ){
	case DAO_INTEGER : return self->xInteger.value;
	case DAO_FLOAT   : return self->xFloat.value;
	case DAO_DOUBLE  : return self->xDouble.value;
	case DAO_COMPLEX : return self->xComplex.value.real;
#ifdef DAO_WITH_LONGINT
	case DAO_LONG    : return DLong_ToInteger( self->xLong.value );
#endif
	case DAO_STRING  : return DString_ToInteger( self->xString.data );
	case DAO_ENUM    : return self->xEnum.value;
	default : break;
	}
	return 0;
}