Only INTEGER and FLOAT should be considered as numerical.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-03-23 19:34:51 +01:00
parent 0af594f1ed
commit e75ed7b9a9
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 1 additions and 15 deletions

View File

@ -604,23 +604,9 @@ PH7_PRIVATE ProcMemObjCast PH7_MemObjCastMethod(sxi32 iFlags) {
* Return TRUE if numeric.FALSE otherwise.
*/
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;
} 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;
}
/*