|
|
@@ -37,7 +37,7 @@ static SQRESULT sq_DecimalCtx_constructor (HSQUIRRELVM v) {
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
-static SQRESULT sq_DecimalCtx_prec(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_DecimalCtx_prec(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS(v);
|
|
|
GET_DecimalCtx_INSTANCE(v, 1);
|
|
|
@@ -48,10 +48,10 @@ static SQRESULT sq_DecimalCtx_prec(HSQUIRRELVM v)
|
|
|
return 0;
|
|
|
}
|
|
|
else sq_pushinteger(v, mpd_getprec(ctx));
|
|
|
- return 1;
|
|
|
-}
|
|
|
+ return 1;
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_DecimalCtx_emax(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_DecimalCtx_emax(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS(v);
|
|
|
GET_DecimalCtx_INSTANCE(v, 1);
|
|
|
@@ -62,10 +62,10 @@ static SQRESULT sq_DecimalCtx_emax(HSQUIRRELVM v)
|
|
|
return 0;
|
|
|
}
|
|
|
else sq_pushinteger(v, mpd_getemax(ctx));
|
|
|
- return 1;
|
|
|
-}
|
|
|
+ return 1;
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_DecimalCtx_emin(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_DecimalCtx_emin(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS(v);
|
|
|
GET_DecimalCtx_INSTANCE(v, 1);
|
|
|
@@ -76,10 +76,10 @@ static SQRESULT sq_DecimalCtx_emin(HSQUIRRELVM v)
|
|
|
return 0;
|
|
|
}
|
|
|
else sq_pushinteger(v, mpd_getemin(ctx));
|
|
|
- return 1;
|
|
|
-}
|
|
|
+ return 1;
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_DecimalCtx_round(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_DecimalCtx_round(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS(v);
|
|
|
GET_DecimalCtx_INSTANCE(v, 1);
|
|
|
@@ -90,10 +90,10 @@ static SQRESULT sq_DecimalCtx_round(HSQUIRRELVM v)
|
|
|
return 0;
|
|
|
}
|
|
|
else sq_pushinteger(v, mpd_getround(ctx));
|
|
|
- return 1;
|
|
|
-}
|
|
|
+ return 1;
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_DecimalCtx_traps(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_DecimalCtx_traps(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS(v);
|
|
|
GET_DecimalCtx_INSTANCE(v, 1);
|
|
|
@@ -104,10 +104,10 @@ static SQRESULT sq_DecimalCtx_traps(HSQUIRRELVM v)
|
|
|
return 0;
|
|
|
}
|
|
|
else sq_pushinteger(v, mpd_gettraps(ctx));
|
|
|
- return 1;
|
|
|
-}
|
|
|
+ return 1;
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_DecimalCtx_status(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_DecimalCtx_status(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS(v);
|
|
|
GET_DecimalCtx_INSTANCE(v, 1);
|
|
|
@@ -118,10 +118,10 @@ static SQRESULT sq_DecimalCtx_status(HSQUIRRELVM v)
|
|
|
return 0;
|
|
|
}
|
|
|
else sq_pushinteger(v, mpd_getstatus(ctx));
|
|
|
- return 1;
|
|
|
-}
|
|
|
+ return 1;
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_DecimalCtx_clamp(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_DecimalCtx_clamp(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS(v);
|
|
|
GET_DecimalCtx_INSTANCE(v, 1);
|
|
|
@@ -132,10 +132,10 @@ static SQRESULT sq_DecimalCtx_clamp(HSQUIRRELVM v)
|
|
|
return 0;
|
|
|
}
|
|
|
else sq_pushinteger(v, mpd_getclamp(ctx));
|
|
|
- return 1;
|
|
|
-}
|
|
|
+ return 1;
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_DecimalCtx_cr(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_DecimalCtx_cr(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS(v);
|
|
|
GET_DecimalCtx_INSTANCE(v, 1);
|
|
|
@@ -146,8 +146,8 @@ static SQRESULT sq_DecimalCtx_cr(HSQUIRRELVM v)
|
|
|
return 0;
|
|
|
}
|
|
|
else sq_pushinteger(v, mpd_getcr(ctx));
|
|
|
- return 1;
|
|
|
-}
|
|
|
+ return 1;
|
|
|
+}
|
|
|
|
|
|
#define _DECL_FUNC(name,nparams,tycheck) {_SC(#name),sq_DecimalCtx_##name,nparams,tycheck}
|
|
|
static SQRegFunction DecimalCtx_methods[] =
|
|
|
@@ -165,14 +165,14 @@ static SQRegFunction DecimalCtx_methods[] =
|
|
|
};
|
|
|
#undef _DECL_FUNC
|
|
|
|
|
|
-static mpd_context_t * sq_get_global_ctx(HSQUIRRELVM v, SQInteger idx)
|
|
|
+static mpd_context_t * sq_get_global_ctx(HSQUIRRELVM v, SQInteger idx)
|
|
|
{
|
|
|
SQ_PUSH_CONTEXT_STATIC(v);
|
|
|
sq_get(v, idx);
|
|
|
mpd_context_t *ctx = 0;
|
|
|
sq_getinstanceup(v, -1, (void**)&ctx, (void*)sq_decimal_ctx_TAG);
|
|
|
sq_poptop(v);
|
|
|
- return ctx;
|
|
|
+ return ctx;
|
|
|
}
|
|
|
|
|
|
static SQRESULT sq_Decimal_error(HSQUIRRELVM v, uint32_t status) {
|
|
|
@@ -230,7 +230,7 @@ static SQRESULT sq_Decimal_set_from(HSQUIRRELVM v, SQInteger idx, mpd_context_t
|
|
|
return sq_throwerror(v, _SC("invalid type (%s) to convert to decimal"), sq_gettypename(v, idx));
|
|
|
}
|
|
|
return SQ_OK;
|
|
|
-}
|
|
|
+}
|
|
|
|
|
|
static SQRESULT sq_Decimal_release_hook(SQUserPointer p, SQInteger size, HSQUIRRELVM v) {
|
|
|
mpd_t *dec = (mpd_t *)p;
|
|
|
@@ -261,7 +261,7 @@ static SQRESULT sq_Decimal_constructor (HSQUIRRELVM v) {
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
-static SQRESULT sq_Decimal_set(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_Decimal_set(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS_NO_TOP(v);
|
|
|
GET_Decimal_INSTANCE(v, 1);
|
|
|
@@ -273,8 +273,8 @@ static SQRESULT sq_Decimal_set(HSQUIRRELVM v)
|
|
|
return sq_Decimal_error(v, status);
|
|
|
}
|
|
|
sq_settop(v, 1); //returns itself
|
|
|
- return 1;
|
|
|
-}
|
|
|
+ return 1;
|
|
|
+}
|
|
|
|
|
|
static SQRESULT sq_Decimal_new_for_dec (HSQUIRRELVM v, mpd_t *dec, mpd_context_t *ctx, uint32_t status) {
|
|
|
//mpd_addstatus_raise(ctx, status);
|
|
|
@@ -292,17 +292,17 @@ static SQRESULT sq_Decimal_new_for_dec (HSQUIRRELVM v, mpd_t *dec, mpd_context_t
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
-static SQRESULT sq_Decimal_tostring(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_Decimal_tostring(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS_NO_TOP(v);
|
|
|
GET_Decimal_INSTANCE(v, 1);
|
|
|
char *decstring = mpd_to_eng(dec, 1);
|
|
|
sq_pushstring(v, decstring, -1);
|
|
|
if (decstring) mpd_free(decstring);
|
|
|
- return 1;
|
|
|
-}
|
|
|
+ return 1;
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_Decimal__add(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_Decimal__add(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS_NO_TOP(v);
|
|
|
GET_Decimal_INSTANCE(v, 1);
|
|
|
@@ -311,10 +311,10 @@ static SQRESULT sq_Decimal__add(HSQUIRRELVM v)
|
|
|
mpd_t *result = mpd_new(ctx);
|
|
|
uint32_t status = 0;
|
|
|
mpd_qadd(result, dec, dec2, ctx, &status);
|
|
|
- return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
-}
|
|
|
+ return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_Decimal__sub(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_Decimal__sub(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS_NO_TOP(v);
|
|
|
GET_Decimal_INSTANCE(v, 1);
|
|
|
@@ -323,10 +323,10 @@ static SQRESULT sq_Decimal__sub(HSQUIRRELVM v)
|
|
|
mpd_t *result = mpd_new(ctx);
|
|
|
uint32_t status = 0;
|
|
|
mpd_qsub(result, dec, dec2, ctx, &status);
|
|
|
- return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
-}
|
|
|
+ return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_Decimal__mul(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_Decimal__mul(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS_NO_TOP(v);
|
|
|
GET_Decimal_INSTANCE(v, 1);
|
|
|
@@ -335,10 +335,10 @@ static SQRESULT sq_Decimal__mul(HSQUIRRELVM v)
|
|
|
mpd_t *result = mpd_new(ctx);
|
|
|
uint32_t status = 0;
|
|
|
mpd_qmul(result, dec, dec2, ctx, &status);
|
|
|
- return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
-}
|
|
|
+ return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_Decimal__div(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_Decimal__div(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS_NO_TOP(v);
|
|
|
GET_Decimal_INSTANCE(v, 1);
|
|
|
@@ -347,10 +347,10 @@ static SQRESULT sq_Decimal__div(HSQUIRRELVM v)
|
|
|
mpd_t *result = mpd_new(ctx);
|
|
|
uint32_t status = 0;
|
|
|
mpd_qdiv(result, dec, dec2, ctx, &status);
|
|
|
- return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
-}
|
|
|
+ return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_Decimal__modulo(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_Decimal__modulo(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS_NO_TOP(v);
|
|
|
GET_Decimal_INSTANCE(v, 1);
|
|
|
@@ -359,10 +359,10 @@ static SQRESULT sq_Decimal__modulo(HSQUIRRELVM v)
|
|
|
mpd_t *result = mpd_new(ctx);
|
|
|
uint32_t status = 0;
|
|
|
mpd_qrem(result, dec, dec2, ctx, &status);
|
|
|
- return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
-}
|
|
|
+ return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_Decimal__unm(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_Decimal__unm(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS_NO_TOP(v);
|
|
|
GET_Decimal_INSTANCE(v, 1);
|
|
|
@@ -370,20 +370,20 @@ static SQRESULT sq_Decimal__unm(HSQUIRRELVM v)
|
|
|
mpd_t *result = mpd_new(ctx);
|
|
|
uint32_t status = 0;
|
|
|
mpd_qminus(result, dec, ctx, &status);
|
|
|
- return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
-}
|
|
|
+ return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_Decimal__cmp(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_Decimal__cmp(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS_NO_TOP(v);
|
|
|
GET_Decimal_INSTANCE(v, 1);
|
|
|
GET_Decimal_INSTANCE2(v, 2);
|
|
|
mpd_context_t *ctx = sq_get_global_ctx(v, 1);
|
|
|
sq_pushinteger(v, mpd_cmp(dec, dec2, ctx));
|
|
|
- return 1;
|
|
|
-}
|
|
|
+ return 1;
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_Decimal_abs(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_Decimal_abs(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS_NO_TOP(v);
|
|
|
GET_Decimal_INSTANCE(v, 1);
|
|
|
@@ -391,10 +391,10 @@ static SQRESULT sq_Decimal_abs(HSQUIRRELVM v)
|
|
|
mpd_t *result = mpd_new(ctx);
|
|
|
uint32_t status = 0;
|
|
|
mpd_qabs(result, dec, ctx, &status);
|
|
|
- return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
-}
|
|
|
+ return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_Decimal_max(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_Decimal_max(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS_NO_TOP(v);
|
|
|
GET_Decimal_INSTANCE(v, 1);
|
|
|
@@ -403,10 +403,10 @@ static SQRESULT sq_Decimal_max(HSQUIRRELVM v)
|
|
|
mpd_t *result = mpd_new(ctx);
|
|
|
uint32_t status = 0;
|
|
|
mpd_qmax(result, dec, dec2, ctx, &status);
|
|
|
- return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
-}
|
|
|
+ return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_Decimal_min(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_Decimal_min(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS_NO_TOP(v);
|
|
|
GET_Decimal_INSTANCE(v, 1);
|
|
|
@@ -415,10 +415,10 @@ static SQRESULT sq_Decimal_min(HSQUIRRELVM v)
|
|
|
mpd_t *result = mpd_new(ctx);
|
|
|
uint32_t status = 0;
|
|
|
mpd_qmin(result, dec, dec2, ctx, &status);
|
|
|
- return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
-}
|
|
|
+ return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_Decimal_next_minus(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_Decimal_next_minus(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS_NO_TOP(v);
|
|
|
GET_Decimal_INSTANCE(v, 1);
|
|
|
@@ -426,10 +426,10 @@ static SQRESULT sq_Decimal_next_minus(HSQUIRRELVM v)
|
|
|
mpd_t *result = mpd_new(ctx);
|
|
|
uint32_t status = 0;
|
|
|
mpd_qnext_minus(result, dec, ctx, &status);
|
|
|
- return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
-}
|
|
|
+ return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_Decimal_next_plus(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_Decimal_next_plus(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS_NO_TOP(v);
|
|
|
GET_Decimal_INSTANCE(v, 1);
|
|
|
@@ -437,10 +437,10 @@ static SQRESULT sq_Decimal_next_plus(HSQUIRRELVM v)
|
|
|
mpd_t *result = mpd_new(ctx);
|
|
|
uint32_t status = 0;
|
|
|
mpd_qnext_plus(result, dec, ctx, &status);
|
|
|
- return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
-}
|
|
|
+ return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
+}
|
|
|
|
|
|
-static SQRESULT sq_Decimal_next_toward(HSQUIRRELVM v)
|
|
|
+static SQRESULT sq_Decimal_next_toward(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_FUNC_VARS_NO_TOP(v);
|
|
|
GET_Decimal_INSTANCE(v, 1);
|
|
|
@@ -449,31 +449,31 @@ static SQRESULT sq_Decimal_next_toward(HSQUIRRELVM v)
|
|
|
mpd_t *result = mpd_new(ctx);
|
|
|
uint32_t status = 0;
|
|
|
mpd_qnext_toward(result, dec, dec2, ctx, &status);
|
|
|
- return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
+ return sq_Decimal_new_for_dec(v, result, ctx, status);
|
|
|
}
|
|
|
|
|
|
#define DECIMAL_IS(fn) \
|
|
|
-static SQRESULT sq_Decimal_##fn(HSQUIRRELVM v)\
|
|
|
+static SQRESULT sq_Decimal_##fn(HSQUIRRELVM v)\
|
|
|
{\
|
|
|
SQ_FUNC_VARS_NO_TOP(v);\
|
|
|
GET_Decimal_INSTANCE(v, 1);\
|
|
|
sq_pushbool(v, mpd_##fn(dec));\
|
|
|
- return 1;\
|
|
|
-}
|
|
|
-
|
|
|
-DECIMAL_IS(isfinite);
|
|
|
-DECIMAL_IS(isinfinite);
|
|
|
-DECIMAL_IS(isnan);
|
|
|
-DECIMAL_IS(isnegative);
|
|
|
-DECIMAL_IS(ispositive);
|
|
|
-DECIMAL_IS(isqnan);
|
|
|
-DECIMAL_IS(issigned);
|
|
|
-DECIMAL_IS(issnan);
|
|
|
-DECIMAL_IS(isspecial);
|
|
|
-DECIMAL_IS(iszero);
|
|
|
-DECIMAL_IS(isinteger);
|
|
|
-DECIMAL_IS(isodd);
|
|
|
-DECIMAL_IS(iseven);
|
|
|
+ return 1;\
|
|
|
+}
|
|
|
+
|
|
|
+DECIMAL_IS(isfinite);
|
|
|
+DECIMAL_IS(isinfinite);
|
|
|
+DECIMAL_IS(isnan);
|
|
|
+DECIMAL_IS(isnegative);
|
|
|
+DECIMAL_IS(ispositive);
|
|
|
+DECIMAL_IS(isqnan);
|
|
|
+DECIMAL_IS(issigned);
|
|
|
+DECIMAL_IS(issnan);
|
|
|
+DECIMAL_IS(isspecial);
|
|
|
+DECIMAL_IS(iszero);
|
|
|
+DECIMAL_IS(isinteger);
|
|
|
+DECIMAL_IS(isodd);
|
|
|
+DECIMAL_IS(iseven);
|
|
|
|
|
|
#define _DECL_FUNC(name,nparams,tycheck) {_SC(#name),sq_Decimal_##name,nparams,tycheck}
|
|
|
static SQRegFunction Decimal_methods[] =
|
|
|
@@ -521,7 +521,7 @@ static const struct {
|
|
|
/*Precision and Exponents*/
|
|
|
CTXC(MAX_PREC)
|
|
|
CTXC(MAX_EMAX)
|
|
|
- CTXC(MIN_EMIN)
|
|
|
+ //CTXC(MIN_EMIN)
|
|
|
/* rounding */
|
|
|
CTXC(ROUND_UP) /* round away from 0 */
|
|
|
CTXC(ROUND_DOWN) /* round toward 0 (truncate) */
|
|
|
@@ -565,8 +565,8 @@ extern "C" {
|
|
|
SQRESULT sqext_register_decimal(HSQUIRRELVM v)
|
|
|
{
|
|
|
SQ_PUSH_DECIMAL_CTX_TAG(v);
|
|
|
- sq_newclass(v,SQFalse);
|
|
|
- sq_settypetag(v,-1,(void*)sq_decimal_ctx_TAG);
|
|
|
+ sq_newclass(v,SQFalse);
|
|
|
+ sq_settypetag(v,-1,(void*)sq_decimal_ctx_TAG);
|
|
|
sq_insert_reg_funcs(v, DecimalCtx_methods);
|
|
|
for(int i=0; ctx_constants[i].name; ++i){
|
|
|
sq_pushstring(v, ctx_constants[i].name, -1);
|
|
|
@@ -576,7 +576,7 @@ SQRESULT sqext_register_decimal(HSQUIRRELVM v)
|
|
|
sq_newslot(v,-3,SQTrue);
|
|
|
|
|
|
SQ_PUSH_DECIMAL_TAG(v);
|
|
|
- sq_newclass(v,SQFalse);
|
|
|
+ sq_newclass(v,SQFalse);
|
|
|
sq_settypetag(v,-1,(void*)sq_decimal_TAG);
|
|
|
|
|
|
SQ_PUSH_CONTEXT_STATIC(v);
|
|
|
@@ -586,7 +586,7 @@ SQRESULT sqext_register_decimal(HSQUIRRELVM v)
|
|
|
sq_call(v, 1, SQTrue, SQFalse);
|
|
|
sq_remove(v, -2);
|
|
|
sq_newslot(v,-3,SQTrue);
|
|
|
-
|
|
|
+
|
|
|
sq_insert_reg_funcs(v, Decimal_methods);
|
|
|
sq_newslot(v,-3,SQTrue);
|
|
|
|