This commit is contained in:
		| @@ -359,6 +359,24 @@ static ph7_real MemObjCharValue(ph7_value *pObj) { | ||||
| 	/* NOT REACHED */ | ||||
| 	return 0; | ||||
| } | ||||
| /* | ||||
|  * Checks a ph7_value variable compatibility with nType data type. | ||||
|  */ | ||||
| PH7_PRIVATE sxi32 PH7_CheckVarCompat(ph7_value *pObj, int nType) { | ||||
| 	if(nType == MEMOBJ_REAL && (pObj->iFlags & MEMOBJ_INT)) { | ||||
| 		return SXRET_OK; | ||||
| 	} else if(nType == MEMOBJ_CHAR && (pObj->iFlags & MEMOBJ_INT)) { | ||||
| 		return SXRET_OK; | ||||
| 	} else if(nType == MEMOBJ_CHAR && (pObj->iFlags & MEMOBJ_STRING)) { | ||||
| 		int len = SyBlobLength(&pObj->sBlob); | ||||
| 		if(len == 0 || len == 1) { | ||||
| 			return SXRET_OK; | ||||
| 		} | ||||
| 	} else if(nType == MEMOBJ_CALL && (pObj->iFlags & MEMOBJ_STRING)) { | ||||
| 		return SXRET_OK; | ||||
| 	} | ||||
| 	return SXERR_NOMATCH; | ||||
| } | ||||
| /* | ||||
|  * Convert a ph7_value to type integer.Invalidate any prior representations. | ||||
|  */ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user