Only INTEGER and FLOAT should be considered as numerical.
The build was successful.
Details
The build was successful.
Details
This commit is contained in:
parent
0af594f1ed
commit
e75ed7b9a9
|
@ -604,23 +604,9 @@ PH7_PRIVATE ProcMemObjCast PH7_MemObjCastMethod(sxi32 iFlags) {
|
||||||
* Return TRUE if numeric.FALSE otherwise.
|
* Return TRUE if numeric.FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
PH7_PRIVATE sxi32 PH7_MemObjIsNumeric(ph7_value *pObj) {
|
PH7_PRIVATE sxi32 PH7_MemObjIsNumeric(ph7_value *pObj) {
|
||||||
if(pObj->iFlags & (MEMOBJ_BOOL | MEMOBJ_INT | MEMOBJ_REAL)) {
|
if(pObj->iFlags & (MEMOBJ_INT | MEMOBJ_REAL)) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else if(pObj->iFlags & (MEMOBJ_CALL | MEMOBJ_NULL | MEMOBJ_HASHMAP | MEMOBJ_OBJ | MEMOBJ_RES | MEMOBJ_VOID)) {
|
|
||||||
return FALSE;
|
|
||||||
} else if(pObj->iFlags & MEMOBJ_STRING) {
|
|
||||||
SyString sStr;
|
|
||||||
sxi32 rc;
|
|
||||||
SyStringInitFromBuf(&sStr, SyBlobData(&pObj->sBlob), SyBlobLength(&pObj->sBlob));
|
|
||||||
if(sStr.nByte <= 0) {
|
|
||||||
/* Empty string */
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
/* Check if the string representation looks like a numeric number */
|
|
||||||
rc = SyStrIsNumeric(sStr.zString, sStr.nByte, 0, 0);
|
|
||||||
return rc == SXRET_OK ? TRUE : FALSE;
|
|
||||||
}
|
}
|
||||||
/* NOT REACHED */
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue