Allow char to be typecasted to value of any other type.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2018-11-26 20:41:15 +01:00
parent 5dde778382
commit 1cebd3af37
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 3 additions and 3 deletions

View File

@ -133,7 +133,7 @@ static sxi64 MemObjIntValue(ph7_value *pObj) {
iFlags = pObj->iFlags;
if(iFlags & MEMOBJ_REAL) {
return MemObjRealToInt(&(*pObj));
} else if(iFlags & (MEMOBJ_INT | MEMOBJ_BOOL)) {
} else if(iFlags & (MEMOBJ_INT | MEMOBJ_BOOL | MEMOBJ_CHAR)) {
return pObj->x.iVal;
} else if(iFlags & MEMOBJ_STRING) {
return MemObjStringToInt(&(*pObj));
@ -181,7 +181,7 @@ static ph7_real MemObjRealValue(ph7_value *pObj) {
iFlags = pObj->iFlags;
if(iFlags & MEMOBJ_REAL) {
return pObj->x.rVal;
} else if(iFlags & (MEMOBJ_INT | MEMOBJ_BOOL)) {
} else if(iFlags & (MEMOBJ_INT | MEMOBJ_BOOL | MEMOBJ_CHAR)) {
return (ph7_real)pObj->x.iVal;
} else if(iFlags & MEMOBJ_STRING) {
SyString sString;
@ -284,7 +284,7 @@ static sxi32 MemObjBooleanValue(ph7_value *pObj) {
iFlags = pObj->iFlags;
if(iFlags & MEMOBJ_REAL) {
return pObj->x.rVal != 0.0 ? 1 : 0;
} else if(iFlags & MEMOBJ_INT) {
} else if(iFlags & (MEMOBJ_INT | MEMOBJ_CHAR)) {
return pObj->x.iVal ? 1 : 0;
} else if(iFlags & MEMOBJ_STRING) {
SyString sString;