Jacek Caban : vbscript: Renamed vbscode_t' s variables to not suggest that they are global code-only.
Alexandre Julliard
julliard at winehq.org
Thu Sep 6 13:37:22 CDT 2012
Module: wine
Branch: master
Commit: 9e3f75cfb1b40cdaff0c68cbf79c43770ca44e61
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9e3f75cfb1b40cdaff0c68cbf79c43770ca44e61
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Sep 6 11:57:15 2012 +0200
vbscript: Renamed vbscode_t's variables to not suggest that they are global code-only.
---
dlls/vbscript/compile.c | 20 ++++++++++----------
dlls/vbscript/vbscript.c | 13 +++++++++----
dlls/vbscript/vbscript.h | 4 ++--
3 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c
index c3334fd..89e290d 100644
--- a/dlls/vbscript/compile.c
+++ b/dlls/vbscript/compile.c
@@ -973,7 +973,7 @@ static HRESULT compile_const_statement(compile_ctx_t *ctx, const_statement_t *st
static HRESULT compile_function_statement(compile_ctx_t *ctx, function_statement_t *stat)
{
- if(ctx->func != &ctx->code->global_code) {
+ if(ctx->func != &ctx->code->main_code) {
FIXME("Function is not in the global code\n");
return E_FAIL;
}
@@ -1615,15 +1615,15 @@ static vbscode_t *alloc_vbscode(compile_ctx_t *ctx, const WCHAR *source)
ret->bstr_pool = NULL;
ret->bstr_pool_size = 0;
ret->bstr_cnt = 0;
- ret->global_executed = FALSE;
+ ret->pending_exec = FALSE;
- ret->global_code.type = FUNC_GLOBAL;
- ret->global_code.name = NULL;
- ret->global_code.code_ctx = ret;
- ret->global_code.vars = NULL;
- ret->global_code.var_cnt = 0;
- ret->global_code.arg_cnt = 0;
- ret->global_code.args = NULL;
+ ret->main_code.type = FUNC_GLOBAL;
+ ret->main_code.name = NULL;
+ ret->main_code.code_ctx = ret;
+ ret->main_code.vars = NULL;
+ ret->main_code.var_cnt = 0;
+ ret->main_code.arg_cnt = 0;
+ ret->main_code.args = NULL;
list_init(&ret->entry);
return ret;
@@ -1664,7 +1664,7 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, vbscode_t **ret)
ctx.stat_ctx = NULL;
ctx.labels_cnt = ctx.labels_size = 0;
- hres = compile_func(&ctx, ctx.parser.stats, &ctx.code->global_code);
+ hres = compile_func(&ctx, ctx.parser.stats, &ctx.code->main_code);
if(FAILED(hres)) {
release_compiler(&ctx);
return hres;
diff --git a/dlls/vbscript/vbscript.c b/dlls/vbscript/vbscript.c
index a5a9853..f250df3 100644
--- a/dlls/vbscript/vbscript.c
+++ b/dlls/vbscript/vbscript.c
@@ -77,10 +77,10 @@ static HRESULT exec_global_code(script_ctx_t *ctx, vbscode_t *code)
{
HRESULT hres;
- code->global_executed = TRUE;
+ code->pending_exec = FALSE;
IActiveScriptSite_OnEnterScript(ctx->site);
- hres = exec_script(ctx, &code->global_code, NULL, NULL, NULL);
+ hres = exec_script(ctx, &code->main_code, NULL, NULL, NULL);
IActiveScriptSite_OnLeaveScript(ctx->site);
return hres;
@@ -91,7 +91,7 @@ static void exec_queued_code(script_ctx_t *ctx)
vbscode_t *iter;
LIST_FOR_EACH_ENTRY(iter, &ctx->code_list, vbscode_t, entry) {
- if(!iter->global_executed)
+ if(iter->pending_exec)
exec_global_code(ctx, iter);
}
}
@@ -604,7 +604,12 @@ static HRESULT WINAPI VBScriptParse_ParseScriptText(IActiveScriptParse *iface,
if(FAILED(hres))
return hres;
- return is_started(This) ? exec_global_code(This->ctx, code) : S_OK;
+ if(!is_started(This)) {
+ code->pending_exec = TRUE;
+ return S_OK;
+ }
+
+ return exec_global_code(This->ctx, code);
}
static const IActiveScriptParseVtbl VBScriptParseVtbl = {
diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h
index 3f1e887..788d98d 100644
--- a/dlls/vbscript/vbscript.h
+++ b/dlls/vbscript/vbscript.h
@@ -298,8 +298,8 @@ struct _vbscode_t {
BOOL option_explicit;
- BOOL global_executed;
- function_t global_code;
+ BOOL pending_exec;
+ function_t main_code;
BSTR *bstr_pool;
unsigned bstr_pool_size;
More information about the wine-cvs
mailing list