mirror of https://github.com/axmolengine/axmol.git
Merge pull request #15754 from minggo/linux-compiling-error
use std::isnan instead of isnan to fix compiling errors
This commit is contained in:
commit
6f79082c6a
|
@ -5712,7 +5712,7 @@ bool js_cocos2dx_AutoPolygon_generatePolygon(JSContext *cx, uint32_t argc, jsval
|
||||||
double arg2;
|
double arg2;
|
||||||
ok &= jsval_to_std_string(cx, args.get(0), &arg0);
|
ok &= jsval_to_std_string(cx, args.get(0), &arg0);
|
||||||
ok &= jsval_to_ccrect(cx, args.get(1), &arg1);
|
ok &= jsval_to_ccrect(cx, args.get(1), &arg1);
|
||||||
ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2);
|
ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2);
|
||||||
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_AutoPolygon_generatePolygon : Error processing arguments");
|
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_AutoPolygon_generatePolygon : Error processing arguments");
|
||||||
cocos2d::PolygonInfo* ret = new (std::nothrow) cocos2d::PolygonInfo(cocos2d::AutoPolygon::generatePolygon(arg0, arg1, arg2));
|
cocos2d::PolygonInfo* ret = new (std::nothrow) cocos2d::PolygonInfo(cocos2d::AutoPolygon::generatePolygon(arg0, arg1, arg2));
|
||||||
jsval jsret = JSVAL_NULL;
|
jsval jsret = JSVAL_NULL;
|
||||||
|
@ -5729,8 +5729,8 @@ bool js_cocos2dx_AutoPolygon_generatePolygon(JSContext *cx, uint32_t argc, jsval
|
||||||
double arg3;
|
double arg3;
|
||||||
ok &= jsval_to_std_string(cx, args.get(0), &arg0);
|
ok &= jsval_to_std_string(cx, args.get(0), &arg0);
|
||||||
ok &= jsval_to_ccrect(cx, args.get(1), &arg1);
|
ok &= jsval_to_ccrect(cx, args.get(1), &arg1);
|
||||||
ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2);
|
ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2);
|
||||||
ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3);
|
ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3);
|
||||||
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_AutoPolygon_generatePolygon : Error processing arguments");
|
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_AutoPolygon_generatePolygon : Error processing arguments");
|
||||||
cocos2d::PolygonInfo* ret = new (std::nothrow) cocos2d::PolygonInfo(cocos2d::AutoPolygon::generatePolygon(arg0, arg1, arg2, arg3));
|
cocos2d::PolygonInfo* ret = new (std::nothrow) cocos2d::PolygonInfo(cocos2d::AutoPolygon::generatePolygon(arg0, arg1, arg2, arg3));
|
||||||
jsval jsret = JSVAL_NULL;
|
jsval jsret = JSVAL_NULL;
|
||||||
|
|
|
@ -56,7 +56,7 @@ bool jsval_to_animationInfo(JSContext* cx, JS::HandleValue vp, cocostudio::timel
|
||||||
JS::ToNumber(cx, jsStartId, &startIndex) &&
|
JS::ToNumber(cx, jsStartId, &startIndex) &&
|
||||||
JS::ToNumber(cx, jsEndId, &endIndex) &&
|
JS::ToNumber(cx, jsEndId, &endIndex) &&
|
||||||
jsval_to_std_string(cx, jsName, &name) &&
|
jsval_to_std_string(cx, jsName, &name) &&
|
||||||
!isnan(startIndex) && !isnan(endIndex);
|
!std::isnan(startIndex) && !std::isnan(endIndex);
|
||||||
|
|
||||||
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
||||||
|
|
||||||
|
|
|
@ -482,7 +482,7 @@ bool jsval_to_ushort( JSContext *cx, JS::HandleValue vp, unsigned short *outval
|
||||||
double dp;
|
double dp;
|
||||||
ok &= JS::ToNumber(cx, vp, &dp);
|
ok &= JS::ToNumber(cx, vp, &dp);
|
||||||
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
||||||
ok &= !isnan(dp);
|
ok &= !std::isnan(dp);
|
||||||
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
||||||
|
|
||||||
*outval = (unsigned short)dp;
|
*outval = (unsigned short)dp;
|
||||||
|
@ -496,7 +496,7 @@ bool jsval_to_int32( JSContext *cx, JS::HandleValue vp, int32_t *outval )
|
||||||
double dp;
|
double dp;
|
||||||
ok &= JS::ToNumber(cx, vp, &dp);
|
ok &= JS::ToNumber(cx, vp, &dp);
|
||||||
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
||||||
ok &= !isnan(dp);
|
ok &= !std::isnan(dp);
|
||||||
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
||||||
|
|
||||||
*outval = (int32_t)dp;
|
*outval = (int32_t)dp;
|
||||||
|
@ -510,7 +510,7 @@ bool jsval_to_uint32( JSContext *cx, JS::HandleValue vp, uint32_t *outval )
|
||||||
double dp;
|
double dp;
|
||||||
ok &= JS::ToNumber(cx, vp, &dp);
|
ok &= JS::ToNumber(cx, vp, &dp);
|
||||||
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
||||||
ok &= !isnan(dp);
|
ok &= !std::isnan(dp);
|
||||||
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
||||||
|
|
||||||
*outval = (uint32_t)dp;
|
*outval = (uint32_t)dp;
|
||||||
|
@ -524,7 +524,7 @@ bool jsval_to_uint16( JSContext *cx, JS::HandleValue vp, uint16_t *outval )
|
||||||
double dp;
|
double dp;
|
||||||
ok &= JS::ToNumber(cx, vp, &dp);
|
ok &= JS::ToNumber(cx, vp, &dp);
|
||||||
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
||||||
ok &= !isnan(dp);
|
ok &= !std::isnan(dp);
|
||||||
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
||||||
|
|
||||||
*outval = (uint16_t)dp;
|
*outval = (uint16_t)dp;
|
||||||
|
@ -675,7 +675,8 @@ bool jsval_to_quaternion( JSContext *cx, JS::HandleValue v, cocos2d::Quaternion*
|
||||||
JS::ToNumber(cx, y, &yy) &&
|
JS::ToNumber(cx, y, &yy) &&
|
||||||
JS::ToNumber(cx, z, &zz) &&
|
JS::ToNumber(cx, z, &zz) &&
|
||||||
JS::ToNumber(cx, w, &ww) &&
|
JS::ToNumber(cx, w, &ww) &&
|
||||||
!isnan(xx) && !isnan(yy) && !isnan(zz) && !isnan(ww);
|
!std::isnan(xx) && !std::isnan(yy) && !std::isnan(zz) && !std::
|
||||||
|
isnan(ww);
|
||||||
|
|
||||||
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
||||||
|
|
||||||
|
@ -1538,7 +1539,7 @@ bool jsval_to_vector2(JSContext *cx, JS::HandleValue vp, cocos2d::Vec2* ret)
|
||||||
JS_GetProperty(cx, tmp, "y", &jsy) &&
|
JS_GetProperty(cx, tmp, "y", &jsy) &&
|
||||||
JS::ToNumber(cx, jsx, &x) &&
|
JS::ToNumber(cx, jsx, &x) &&
|
||||||
JS::ToNumber(cx, jsy, &y) &&
|
JS::ToNumber(cx, jsy, &y) &&
|
||||||
!isnan(x) && !isnan(y);
|
!std::isnan(x) && !std::isnan(y);
|
||||||
|
|
||||||
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
||||||
|
|
||||||
|
@ -1562,7 +1563,7 @@ bool jsval_to_vector3(JSContext *cx, JS::HandleValue vp, cocos2d::Vec3* ret)
|
||||||
JS::ToNumber(cx, jsx, &x) &&
|
JS::ToNumber(cx, jsx, &x) &&
|
||||||
JS::ToNumber(cx, jsy, &y) &&
|
JS::ToNumber(cx, jsy, &y) &&
|
||||||
JS::ToNumber(cx, jsz, &z) &&
|
JS::ToNumber(cx, jsz, &z) &&
|
||||||
!isnan(x) && !isnan(y) && !isnan(z);
|
!std::isnan(x) && !std::isnan(y) && !std::isnan(z);
|
||||||
|
|
||||||
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
||||||
|
|
||||||
|
@ -1590,7 +1591,7 @@ bool jsval_to_vector4(JSContext *cx, JS::HandleValue vp, cocos2d::Vec4* ret)
|
||||||
JS::ToNumber(cx, jsy, &y) &&
|
JS::ToNumber(cx, jsy, &y) &&
|
||||||
JS::ToNumber(cx, jsz, &z) &&
|
JS::ToNumber(cx, jsz, &z) &&
|
||||||
JS::ToNumber(cx, jsw, &w) &&
|
JS::ToNumber(cx, jsw, &w) &&
|
||||||
!isnan(x) && !isnan(y) && !isnan(z) && !isnan(w);
|
!std::isnan(x) && !std::isnan(y) && !std::isnan(z) && !std::isnan(w);
|
||||||
|
|
||||||
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
||||||
|
|
||||||
|
@ -1657,7 +1658,7 @@ bool jsval_to_cctex2f(JSContext* cx, JS::HandleValue vp, cocos2d::Tex2F* ret)
|
||||||
JS_GetProperty(cx, tmp, "y", &jsy) &&
|
JS_GetProperty(cx, tmp, "y", &jsy) &&
|
||||||
JS::ToNumber(cx, jsx, &x) &&
|
JS::ToNumber(cx, jsx, &x) &&
|
||||||
JS::ToNumber(cx, jsy, &y) &&
|
JS::ToNumber(cx, jsy, &y) &&
|
||||||
!isnan(x) && !isnan(y);
|
!std::isnan(x) && !std::isnan(y);
|
||||||
|
|
||||||
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
|
||||||
|
|
||||||
|
|
|
@ -321,9 +321,9 @@ bool js_cocos2dx_physics3d_Physics3dShape_initHeightfield(JSContext *cx, uint32_
|
||||||
ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0);
|
ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0);
|
||||||
ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1);
|
ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1);
|
||||||
ok &= jsval_to_std_vector_float(cx, args.get(2), &arg2);
|
ok &= jsval_to_std_vector_float(cx, args.get(2), &arg2);
|
||||||
ok &= JS::ToNumber(cx, args.get(3), &arg3) && !isnan(arg3);
|
ok &= JS::ToNumber(cx, args.get(3), &arg3) && !std::isnan(arg3);
|
||||||
ok &= JS::ToNumber(cx, args.get(4), &arg4) && !isnan(arg4);
|
ok &= JS::ToNumber(cx, args.get(4), &arg4) && !std::isnan(arg4);
|
||||||
ok &= JS::ToNumber(cx, args.get(5), &arg5) && !isnan(arg5);
|
ok &= JS::ToNumber(cx, args.get(5), &arg5) && !std::isnan(arg5);
|
||||||
arg6 = JS::ToBoolean(args.get(6));
|
arg6 = JS::ToBoolean(args.get(6));
|
||||||
arg7 = JS::ToBoolean(args.get(7));
|
arg7 = JS::ToBoolean(args.get(7));
|
||||||
if (argc == 9)
|
if (argc == 9)
|
||||||
|
@ -363,9 +363,9 @@ bool js_cocos2dx_physics3d_Physics3dShape_createHeightfield(JSContext *cx, uint3
|
||||||
ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0);
|
ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0);
|
||||||
ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1);
|
ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1);
|
||||||
ok &= jsval_to_std_vector_float(cx, args.get(2), &arg2);
|
ok &= jsval_to_std_vector_float(cx, args.get(2), &arg2);
|
||||||
ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3);
|
ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3);
|
||||||
ok &= JS::ToNumber( cx, args.get(4), &arg4) && !isnan(arg4);
|
ok &= JS::ToNumber( cx, args.get(4), &arg4) && !std::isnan(arg4);
|
||||||
ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5);
|
ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5);
|
||||||
arg6 = JS::ToBoolean(args.get(6));
|
arg6 = JS::ToBoolean(args.get(6));
|
||||||
arg7 = JS::ToBoolean(args.get(7));
|
arg7 = JS::ToBoolean(args.get(7));
|
||||||
if(argc == 9)
|
if(argc == 9)
|
||||||
|
|
|
@ -422,7 +422,7 @@ bool js_cocos2dx_Effect3DOutline_setOutlineWidth(JSContext *cx, uint32_t argc, j
|
||||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Effect3DOutline_setOutlineWidth : Invalid Native Object");
|
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Effect3DOutline_setOutlineWidth : Invalid Native Object");
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
double arg0;
|
double arg0;
|
||||||
ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0);
|
ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0);
|
||||||
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Effect3DOutline_setOutlineWidth : Error processing arguments");
|
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Effect3DOutline_setOutlineWidth : Error processing arguments");
|
||||||
cobj->setOutlineWidth(arg0);
|
cobj->setOutlineWidth(arg0);
|
||||||
args.rval().setUndefined();
|
args.rval().setUndefined();
|
||||||
|
|
Loading…
Reference in New Issue