Allow char to be typecasted to value of any other type.
The build was successful.
Details
The build was successful.
Details
This commit is contained in:
parent
5dde778382
commit
1cebd3af37
|
@ -133,7 +133,7 @@ static sxi64 MemObjIntValue(ph7_value *pObj) {
|
||||||
iFlags = pObj->iFlags;
|
iFlags = pObj->iFlags;
|
||||||
if(iFlags & MEMOBJ_REAL) {
|
if(iFlags & MEMOBJ_REAL) {
|
||||||
return MemObjRealToInt(&(*pObj));
|
return MemObjRealToInt(&(*pObj));
|
||||||
} else if(iFlags & (MEMOBJ_INT | MEMOBJ_BOOL)) {
|
} else if(iFlags & (MEMOBJ_INT | MEMOBJ_BOOL | MEMOBJ_CHAR)) {
|
||||||
return pObj->x.iVal;
|
return pObj->x.iVal;
|
||||||
} else if(iFlags & MEMOBJ_STRING) {
|
} else if(iFlags & MEMOBJ_STRING) {
|
||||||
return MemObjStringToInt(&(*pObj));
|
return MemObjStringToInt(&(*pObj));
|
||||||
|
@ -181,7 +181,7 @@ static ph7_real MemObjRealValue(ph7_value *pObj) {
|
||||||
iFlags = pObj->iFlags;
|
iFlags = pObj->iFlags;
|
||||||
if(iFlags & MEMOBJ_REAL) {
|
if(iFlags & MEMOBJ_REAL) {
|
||||||
return pObj->x.rVal;
|
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;
|
return (ph7_real)pObj->x.iVal;
|
||||||
} else if(iFlags & MEMOBJ_STRING) {
|
} else if(iFlags & MEMOBJ_STRING) {
|
||||||
SyString sString;
|
SyString sString;
|
||||||
|
@ -284,7 +284,7 @@ static sxi32 MemObjBooleanValue(ph7_value *pObj) {
|
||||||
iFlags = pObj->iFlags;
|
iFlags = pObj->iFlags;
|
||||||
if(iFlags & MEMOBJ_REAL) {
|
if(iFlags & MEMOBJ_REAL) {
|
||||||
return pObj->x.rVal != 0.0 ? 1 : 0;
|
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;
|
return pObj->x.iVal ? 1 : 0;
|
||||||
} else if(iFlags & MEMOBJ_STRING) {
|
} else if(iFlags & MEMOBJ_STRING) {
|
||||||
SyString sString;
|
SyString sString;
|
||||||
|
|
Loading…
Reference in New Issue