Commit 85b98992 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

vbscript: Don't try to convert int to short in return_int.

parent d684d776
...@@ -112,9 +112,6 @@ static HRESULT return_short(VARIANT *res, short val) ...@@ -112,9 +112,6 @@ static HRESULT return_short(VARIANT *res, short val)
static HRESULT return_int(VARIANT *res, int val) static HRESULT return_int(VARIANT *res, int val)
{ {
if((short)val == val)
return return_short(res, val);
if(res) { if(res) {
V_VT(res) = VT_I4; V_VT(res) = VT_I4;
V_I4(res) = val; V_I4(res) = val;
...@@ -417,9 +414,7 @@ static HRESULT Global_CLng(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI ...@@ -417,9 +414,7 @@ static HRESULT Global_CLng(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI
if(!res) if(!res)
return DISP_E_BADVARTYPE; return DISP_E_BADVARTYPE;
V_VT(res) = VT_I4; return return_int(res, i);
V_I4(res) = i;
return S_OK;
} }
static HRESULT Global_CBool(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) static HRESULT Global_CBool(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
...@@ -1778,12 +1773,7 @@ static HRESULT Global_ScriptEngineMajorVersion(vbdisp_t *This, VARIANT *arg, uns ...@@ -1778,12 +1773,7 @@ static HRESULT Global_ScriptEngineMajorVersion(vbdisp_t *This, VARIANT *arg, uns
assert(args_cnt == 0); assert(args_cnt == 0);
if(res) { return return_int(res, VBSCRIPT_MAJOR_VERSION);
V_VT(res) = VT_I4;
V_I4(res) = VBSCRIPT_MAJOR_VERSION;
}
return S_OK;
} }
static HRESULT Global_ScriptEngineMinorVersion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) static HRESULT Global_ScriptEngineMinorVersion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
...@@ -1792,12 +1782,7 @@ static HRESULT Global_ScriptEngineMinorVersion(vbdisp_t *This, VARIANT *arg, uns ...@@ -1792,12 +1782,7 @@ static HRESULT Global_ScriptEngineMinorVersion(vbdisp_t *This, VARIANT *arg, uns
assert(args_cnt == 0); assert(args_cnt == 0);
if(res) { return return_int(res, VBSCRIPT_MINOR_VERSION);
V_VT(res) = VT_I4;
V_I4(res) = VBSCRIPT_MINOR_VERSION;
}
return S_OK;
} }
static HRESULT Global_ScriptEngineBuildVersion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) static HRESULT Global_ScriptEngineBuildVersion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
...@@ -1806,12 +1791,7 @@ static HRESULT Global_ScriptEngineBuildVersion(vbdisp_t *This, VARIANT *arg, uns ...@@ -1806,12 +1791,7 @@ static HRESULT Global_ScriptEngineBuildVersion(vbdisp_t *This, VARIANT *arg, uns
assert(args_cnt == 0); assert(args_cnt == 0);
if(res) { return return_int(res, VBSCRIPT_BUILD_VERSION);
V_VT(res) = VT_I4;
V_I4(res) = VBSCRIPT_BUILD_VERSION;
}
return S_OK;
} }
static HRESULT Global_FormatNumber(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) static HRESULT Global_FormatNumber(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
......
...@@ -242,6 +242,7 @@ Call ok(x = 2, "InStr returned " & x) ...@@ -242,6 +242,7 @@ Call ok(x = 2, "InStr returned " & x)
x = InStr("abcd", "bc") x = InStr("abcd", "bc")
Call ok(x = 2, "InStr returned " & x) Call ok(x = 2, "InStr returned " & x)
Call ok(getVT(x) = "VT_I4*", "getVT(InStr) returned " & getVT(x))
x = InStr("abc", "bc") x = InStr("abc", "bc")
Call ok(x = 2, "InStr returned " & x) Call ok(x = 2, "InStr returned " & x)
...@@ -335,6 +336,7 @@ Call ok(Len("") = 0, "Len() = " & Len("")) ...@@ -335,6 +336,7 @@ Call ok(Len("") = 0, "Len() = " & Len(""))
Call ok(Len(1) = 1, "Len(1) = " & Len(1)) Call ok(Len(1) = 1, "Len(1) = " & Len(1))
Call ok(isNull(Len(null)), "Len(null) = " & Len(null)) Call ok(isNull(Len(null)), "Len(null) = " & Len(null))
Call ok(Len(empty) = 0, "Len(empty) = " & Len(empty)) Call ok(Len(empty) = 0, "Len(empty) = " & Len(empty))
Call ok(getVT(Len("abc")) = "VT_I4", "getVT(Len(abc)) = " & getVT(Len("abc")))
Call ok(Space(1) = " ", "Space(1) = " & Space(1) & """") Call ok(Space(1) = " ", "Space(1) = " & Space(1) & """")
Call ok(Space(0) = "", "Space(0) = " & Space(0) & """") Call ok(Space(0) = "", "Space(0) = " & Space(0) & """")
......
...@@ -75,6 +75,7 @@ const RPC_S_SERVER_UNAVAILABLE = &h800706BA& ...@@ -75,6 +75,7 @@ const RPC_S_SERVER_UNAVAILABLE = &h800706BA&
const CO_E_SERVER_EXEC_FAILURE = &h80080005& const CO_E_SERVER_EXEC_FAILURE = &h80080005&
call ok(Err.Number = 0, "Err.Number = " & Err.Number) call ok(Err.Number = 0, "Err.Number = " & Err.Number)
call ok(getVT(Err.Number) = "VT_I4", "getVT(Err.Number) = " & getVT(Err.Number))
dim calledFunc dim calledFunc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment