(svn r26774) -Cleanup [Squirrel]: remove _SC macro
This commit is contained in:
42
src/3rdparty/squirrel/sqstdlib/sqstdmath.cpp
vendored
42
src/3rdparty/squirrel/sqstdlib/sqstdmath.cpp
vendored
@@ -26,7 +26,7 @@ static SQInteger math_srand(HSQUIRRELVM v)
|
||||
{
|
||||
SQInteger i;
|
||||
if(SQ_FAILED(sq_getinteger(v,2,&i)))
|
||||
return sq_throwerror(v,_SC("invalid param"));
|
||||
return sq_throwerror(v,"invalid param");
|
||||
srand((unsigned int)i);
|
||||
return 0;
|
||||
}
|
||||
@@ -62,28 +62,28 @@ SINGLE_ARG_FUNC(floor, 1)
|
||||
SINGLE_ARG_FUNC(ceil, 1)
|
||||
SINGLE_ARG_FUNC(exp, 100)
|
||||
|
||||
#define _DECL_FUNC(name,nparams,tycheck) {_SC(#name),math_##name,nparams,tycheck}
|
||||
#define _DECL_FUNC(name,nparams,tycheck) {#name,math_##name,nparams,tycheck}
|
||||
static SQRegFunction mathlib_funcs[] = {
|
||||
_DECL_FUNC(sqrt,2,_SC(".n")),
|
||||
_DECL_FUNC(sin,2,_SC(".n")),
|
||||
_DECL_FUNC(cos,2,_SC(".n")),
|
||||
_DECL_FUNC(asin,2,_SC(".n")),
|
||||
_DECL_FUNC(acos,2,_SC(".n")),
|
||||
_DECL_FUNC(log,2,_SC(".n")),
|
||||
_DECL_FUNC(log10,2,_SC(".n")),
|
||||
_DECL_FUNC(tan,2,_SC(".n")),
|
||||
_DECL_FUNC(atan,2,_SC(".n")),
|
||||
_DECL_FUNC(atan2,3,_SC(".nn")),
|
||||
_DECL_FUNC(pow,3,_SC(".nn")),
|
||||
_DECL_FUNC(floor,2,_SC(".n")),
|
||||
_DECL_FUNC(ceil,2,_SC(".n")),
|
||||
_DECL_FUNC(exp,2,_SC(".n")),
|
||||
_DECL_FUNC(sqrt,2,".n"),
|
||||
_DECL_FUNC(sin,2,".n"),
|
||||
_DECL_FUNC(cos,2,".n"),
|
||||
_DECL_FUNC(asin,2,".n"),
|
||||
_DECL_FUNC(acos,2,".n"),
|
||||
_DECL_FUNC(log,2,".n"),
|
||||
_DECL_FUNC(log10,2,".n"),
|
||||
_DECL_FUNC(tan,2,".n"),
|
||||
_DECL_FUNC(atan,2,".n"),
|
||||
_DECL_FUNC(atan2,3,".nn"),
|
||||
_DECL_FUNC(pow,3,".nn"),
|
||||
_DECL_FUNC(floor,2,".n"),
|
||||
_DECL_FUNC(ceil,2,".n"),
|
||||
_DECL_FUNC(exp,2,".n"),
|
||||
#ifdef EXPORT_DEFAULT_SQUIRREL_FUNCTIONS
|
||||
_DECL_FUNC(srand,2,_SC(".n")),
|
||||
_DECL_FUNC(srand,2,".n"),
|
||||
_DECL_FUNC(rand,1,NULL),
|
||||
#endif /* EXPORT_DEFAULT_SQUIRREL_FUNCTIONS */
|
||||
_DECL_FUNC(fabs,2,_SC(".n")),
|
||||
_DECL_FUNC(abs,2,_SC(".n")),
|
||||
_DECL_FUNC(fabs,2,".n"),
|
||||
_DECL_FUNC(abs,2,".n"),
|
||||
{0,0,0,0},
|
||||
};
|
||||
|
||||
@@ -103,11 +103,11 @@ SQRESULT sqstd_register_mathlib(HSQUIRRELVM v)
|
||||
i++;
|
||||
}
|
||||
#ifdef EXPORT_DEFAULT_SQUIRREL_FUNCTIONS
|
||||
sq_pushstring(v,_SC("RAND_MAX"),-1);
|
||||
sq_pushstring(v,"RAND_MAX",-1);
|
||||
sq_pushinteger(v,RAND_MAX);
|
||||
sq_createslot(v,-3);
|
||||
#endif /* EXPORT_DEFAULT_SQUIRREL_FUNCTIONS */
|
||||
sq_pushstring(v,_SC("PI"),-1);
|
||||
sq_pushstring(v,"PI",-1);
|
||||
sq_pushfloat(v,(SQFloat)M_PI);
|
||||
sq_createslot(v,-3);
|
||||
return SQ_OK;
|
||||
|
Reference in New Issue
Block a user