mirror of https://github.com/axmolengine/axmol.git
Merge pull request #13487 from jianglong0156/fixopenglErrorSquash
fix opengl test error
This commit is contained in:
commit
5ef4f3159e
|
@ -187,8 +187,12 @@ bool jsval_to_int( JSContext *cx, JS::HandleValue vp, int *ret )
|
||||||
// Since this is called to cast uint64 to uint32,
|
// Since this is called to cast uint64 to uint32,
|
||||||
// it is needed to initialize the value to 0 first
|
// it is needed to initialize the value to 0 first
|
||||||
#ifdef __LP64__
|
#ifdef __LP64__
|
||||||
|
// When int size is 8 Bit (same as long), the following operation is needed
|
||||||
|
if (sizeof(int) == 8)
|
||||||
|
{
|
||||||
long *tmp = (long*)ret;
|
long *tmp = (long*)ret;
|
||||||
*tmp = 0;
|
*tmp = 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return jsval_to_int32(cx, vp, (int32_t*)ret);
|
return jsval_to_int32(cx, vp, (int32_t*)ret);
|
||||||
}
|
}
|
||||||
|
@ -243,8 +247,12 @@ bool jsval_to_uint( JSContext *cx, JS::HandleValue vp, unsigned int *ret )
|
||||||
// Since this is called to cast uint64 to uint32,
|
// Since this is called to cast uint64 to uint32,
|
||||||
// it is needed to initialize the value to 0 first
|
// it is needed to initialize the value to 0 first
|
||||||
#ifdef __LP64__
|
#ifdef __LP64__
|
||||||
|
// When unsigned int size is 8 Bit (same as long), the following operation is needed
|
||||||
|
if (sizeof(unsigned int)==8)
|
||||||
|
{
|
||||||
long *tmp = (long*)ret;
|
long *tmp = (long*)ret;
|
||||||
*tmp = 0;
|
*tmp = 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return jsval_to_int32(cx, vp, (int32_t*)ret);
|
return jsval_to_int32(cx, vp, (int32_t*)ret);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue