Esempio n. 1
0
ScriptVariant *ScriptVariant_Boolean_Not(ScriptVariant * svar) {
	static ScriptVariant retvar;
	retvar.vt = VT_INTEGER;

	retvar.lVal = !ScriptVariant_IsTrue(svar);

	ScriptVariant_Copy(svar, &retvar);
	return &retvar;
}
Esempio n. 2
0
void Symbol_Init(Symbol * symbol, LPCSTR theName, DWORD flags, ScriptVariant * pvar, Instruction * theRef) {
	memset(symbol, 0, sizeof(Symbol));
	if(theName)
		strcpy(symbol->name, theName);
	else
		symbol->name[0] = 0;
	symbol->dwFlags = flags;
	ScriptVariant_Init(&(symbol->var));
	if(pvar)
		ScriptVariant_Copy(&(symbol->var), pvar);
	symbol->theRef = theRef;
}
Esempio n. 3
0
ScriptVariant *ScriptVariant_Neg(ScriptVariant * svar) {
	static ScriptVariant retvar;
	memcpy(&retvar, svar, sizeof(ScriptVariant));

	if(svar->vt == VT_DECIMAL)
		retvar.dblVal = -(svar->dblVal);
	else if(svar->vt == VT_INTEGER)
		retvar.lVal = -(svar->lVal);
	else
		ScriptVariant_Init(&retvar);

	ScriptVariant_Copy(svar, &retvar);
	return &retvar;
}
Esempio n. 4
0
ScriptVariant *ScriptVariant_ModAssign(ScriptVariant *svar, ScriptVariant *rightChild )
{
    ScriptVariant_Copy(svar, ScriptVariant_Mod(svar, rightChild));
    return svar;
}
Esempio n. 5
0
// light version, for compiled call, faster than above, but not safe in some situations
ScriptVariant *ScriptVariant_Assign(ScriptVariant *svar, ScriptVariant *rightChild )
{
    ScriptVariant_Copy(svar, rightChild);
    return rightChild;
}