winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
April 2012
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
718 discussions
Start a n
N
ew thread
Christian Costa : dmusic: Implement IDirectMusicBufferImpl_GetRawBufferPtr.
by Alexandre Julliard
25 Apr '12
25 Apr '12
Module: wine Branch: master Commit: 6800851f1d939183d78dc431417014baeedc7c52 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6800851f1d939183d78dc4314…
Author: Christian Costa <titan.costa(a)gmail.com> Date: Tue Apr 24 22:32:44 2012 +0200 dmusic: Implement IDirectMusicBufferImpl_GetRawBufferPtr. --- dlls/dmusic/buffer.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/dmusic/buffer.c b/dlls/dmusic/buffer.c index 7260c0f..63611a4 100644 --- a/dlls/dmusic/buffer.c +++ b/dlls/dmusic/buffer.c @@ -125,11 +125,16 @@ static HRESULT WINAPI IDirectMusicBufferImpl_GetNextEvent(LPDIRECTMUSICBUFFER if return S_OK; } -static HRESULT WINAPI IDirectMusicBufferImpl_GetRawBufferPtr(LPDIRECTMUSICBUFFER iface, LPBYTE* ppData) +static HRESULT WINAPI IDirectMusicBufferImpl_GetRawBufferPtr(LPDIRECTMUSICBUFFER iface, LPBYTE* data) { IDirectMusicBufferImpl *This = impl_from_IDirectMusicBuffer(iface); - FIXME("(%p, %p): stub\n", This, ppData); + TRACE("(%p)->(%p)\n", iface, data); + + if (!data) + return E_POINTER; + + *data = This->data; return S_OK; }
1
0
0
0
Christian Costa : dmusic: Implement IDirectMusicBufferImpl_GetMaxBytes.
by Alexandre Julliard
25 Apr '12
25 Apr '12
Module: wine Branch: master Commit: 5f6a3807fd12cb8a65f5b93a2769454c724adbb0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5f6a3807fd12cb8a65f5b93a2…
Author: Christian Costa <titan.costa(a)gmail.com> Date: Tue Apr 24 22:32:36 2012 +0200 dmusic: Implement IDirectMusicBufferImpl_GetMaxBytes. --- dlls/dmusic/buffer.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/dmusic/buffer.c b/dlls/dmusic/buffer.c index f71b70a..7260c0f 100644 --- a/dlls/dmusic/buffer.c +++ b/dlls/dmusic/buffer.c @@ -152,11 +152,16 @@ static HRESULT WINAPI IDirectMusicBufferImpl_GetUsedBytes(LPDIRECTMUSICBUFFER if return S_OK; } -static HRESULT WINAPI IDirectMusicBufferImpl_GetMaxBytes(LPDIRECTMUSICBUFFER iface, LPDWORD pcb) +static HRESULT WINAPI IDirectMusicBufferImpl_GetMaxBytes(LPDIRECTMUSICBUFFER iface, LPDWORD max_bytes) { IDirectMusicBufferImpl *This = impl_from_IDirectMusicBuffer(iface); - FIXME("(%p, %p): stub\n", This, pcb); + TRACE("(%p)->(%p)\n", iface, max_bytes); + + if (!max_bytes) + return E_POINTER; + + *max_bytes = This->size; return S_OK; }
1
0
0
0
Christian Costa : dmusic: Implement IDirectMusicBufferImpl_GetBufferFormat.
by Alexandre Julliard
25 Apr '12
25 Apr '12
Module: wine Branch: master Commit: cc68c95fee4df3128063aade5ce0a13a7542236c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cc68c95fee4df3128063aade5…
Author: Christian Costa <titan.costa(a)gmail.com> Date: Tue Apr 24 22:32:27 2012 +0200 dmusic: Implement IDirectMusicBufferImpl_GetBufferFormat. --- dlls/dmusic/buffer.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/dmusic/buffer.c b/dlls/dmusic/buffer.c index 49609c0..f71b70a 100644 --- a/dlls/dmusic/buffer.c +++ b/dlls/dmusic/buffer.c @@ -161,12 +161,16 @@ static HRESULT WINAPI IDirectMusicBufferImpl_GetMaxBytes(LPDIRECTMUSICBUFFER ifa return S_OK; } -static HRESULT WINAPI IDirectMusicBufferImpl_GetBufferFormat(LPDIRECTMUSICBUFFER iface, LPGUID pGuidFormat) +static HRESULT WINAPI IDirectMusicBufferImpl_GetBufferFormat(LPDIRECTMUSICBUFFER iface, LPGUID format) { IDirectMusicBufferImpl *This = impl_from_IDirectMusicBuffer(iface); - FIXME("(%p, %p): stub\n", This, pGuidFormat); + TRACE("(%p)->(%p)\n", iface, format); + if (!format) + return E_POINTER; + + *format = This->format; return S_OK; }
1
0
0
0
Jacek Caban : vbscript: 'property' may be both keyword and identifier.
by Alexandre Julliard
25 Apr '12
25 Apr '12
Module: wine Branch: master Commit: d856d7cd11d8845321b0ebf89ad866b3b168e9ba URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d856d7cd11d8845321b0ebf89…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Apr 25 11:26:34 2012 +0200 vbscript: 'property' may be both keyword and identifier. --- dlls/vbscript/parser.y | 37 ++++++++++++++++++++++--------------- dlls/vbscript/tests/lang.vbs | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 15 deletions(-) diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index 2a85272..a5f7405 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -71,6 +71,8 @@ static class_decl_t *add_variant_prop(parser_ctx_t*,class_decl_t*,const WCHAR*,u static statement_t *link_statements(statement_t*,statement_t*); +static const WCHAR propertyW[] = {'p','r','o','p','e','r','t','y',0}; + #define STORAGE_IS_PRIVATE 1 #define STORAGE_IS_DEFAULT 2 @@ -129,6 +131,7 @@ static statement_t *link_statements(statement_t*,statement_t*); %type <uint> Storage Storage_opt %type <dim_decl> DimDeclList %type <const_decl> ConstDecl ConstDeclList +%type <string> Identifier %% @@ -189,25 +192,25 @@ SimpleStatement | tON tERROR tRESUME tNEXT { $$ = new_onerror_statement(ctx, TRUE); CHECK_ERROR; } | tON tERROR tGOTO '0' { $$ = new_onerror_statement(ctx, FALSE); CHECK_ERROR; } | tCONST ConstDeclList { $$ = new_const_statement(ctx, $2); CHECK_ERROR; } - | tFOR tIdentifier '=' Expression tTO Expression Step_opt tNL StatementsNl_opt tNEXT + | tFOR Identifier '=' Expression tTO Expression Step_opt tNL StatementsNl_opt tNEXT { $$ = new_forto_statement(ctx, $2, $4, $6, $7, $9); CHECK_ERROR; } - | tFOR tEACH tIdentifier tIN Expression tNL StatementsNl_opt tNEXT + | tFOR tEACH Identifier tIN Expression tNL StatementsNl_opt tNEXT { $$ = new_foreach_statement(ctx, $3, $5, $7); } MemberExpression - : tIdentifier { $$ = new_member_expression(ctx, NULL, $1); CHECK_ERROR; } - | CallExpression '.' tIdentifier { $$ = new_member_expression(ctx, $1, $3); CHECK_ERROR; } + : Identifier { $$ = new_member_expression(ctx, NULL, $1); CHECK_ERROR; } + | CallExpression '.' Identifier { $$ = new_member_expression(ctx, $1, $3); CHECK_ERROR; } DimDeclList /* FIXME: Support arrays */ - : tIdentifier { $$ = new_dim_decl(ctx, $1, NULL); CHECK_ERROR; } - | tIdentifier ',' DimDeclList { $$ = new_dim_decl(ctx, $1, $3); CHECK_ERROR; } + : Identifier { $$ = new_dim_decl(ctx, $1, NULL); CHECK_ERROR; } + | Identifier ',' DimDeclList { $$ = new_dim_decl(ctx, $1, $3); CHECK_ERROR; } ConstDeclList : ConstDecl { $$ = $1; } | ConstDecl ',' ConstDeclList { $1->next = $3; $$ = $1; } ConstDecl - : tIdentifier '=' LiteralExpression { $$ = new_const_decl(ctx, $1, $3); CHECK_ERROR; } + : Identifier '=' LiteralExpression { $$ = new_const_decl(ctx, $1, $3); CHECK_ERROR; } DoType : tWHILE { $$ = TRUE; } @@ -326,7 +329,7 @@ ExpExpression UnaryExpression : LiteralExpression { $$ = $1; } | CallExpression { $$ = $1; } - | tNEW tIdentifier { $$ = new_new_expression(ctx, $2); CHECK_ERROR; } + | tNEW Identifier { $$ = new_new_expression(ctx, $2); CHECK_ERROR; } | '-' UnaryExpression { $$ = new_unary_expression(ctx, EXPR_NEG, $2); CHECK_ERROR; } CallExpression @@ -350,7 +353,7 @@ PrimaryExpression | tME { $$ = new_expression(ctx, EXPR_ME, 0); CHECK_ERROR; } ClassDeclaration - : tCLASS tIdentifier tNL ClassBody tEND tCLASS tNL { $4->name = $2; $$ = $4; } + : tCLASS Identifier tNL ClassBody tEND tCLASS tNL { $4->name = $2; $$ = $4; } ClassBody : /* empty */ { $$ = new_class_decl(ctx); } @@ -367,9 +370,9 @@ PropertyDecl { $$ = new_function_decl(ctx, $4, FUNC_PROPSET, $1, $6, $9); CHECK_ERROR; } FunctionDecl - : Storage_opt tSUB tIdentifier ArgumentsDecl_opt tNL StatementsNl_opt tEND tSUB + : Storage_opt tSUB Identifier ArgumentsDecl_opt tNL StatementsNl_opt tEND tSUB { $$ = new_function_decl(ctx, $3, FUNC_SUB, $1, $4, $6); CHECK_ERROR; } - | Storage_opt tFUNCTION tIdentifier ArgumentsDecl_opt tNL StatementsNl_opt tEND tFUNCTION + | Storage_opt tFUNCTION Identifier ArgumentsDecl_opt tNL StatementsNl_opt tEND tFUNCTION { $$ = new_function_decl(ctx, $3, FUNC_FUNCTION, $1, $4, $6); CHECK_ERROR; } Storage_opt @@ -390,10 +393,14 @@ ArgumentDeclList | ArgumentDecl ',' ArgumentDeclList { $1->next = $3; $$ = $1; } ArgumentDecl - : tIdentifier { $$ = new_argument_decl(ctx, $1, TRUE); } - | tBYREF tIdentifier { $$ = new_argument_decl(ctx, $2, TRUE); } - | tBYVAL tIdentifier { $$ = new_argument_decl(ctx, $2, FALSE); } - + : Identifier { $$ = new_argument_decl(ctx, $1, TRUE); } + | tBYREF Identifier { $$ = new_argument_decl(ctx, $2, TRUE); } + | tBYVAL Identifier { $$ = new_argument_decl(ctx, $2, FALSE); } + +/* 'property' may be both keyword and identifier, depending on context */ +Identifier + : tIdentifier { $$ = $1; } + | tPROPERTY { $$ = propertyW; } %% static int parser_error(const char *str) diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 4380432..1015e34 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -781,4 +781,36 @@ End Sub Call ConstTestSub Dim funcconst +' Property may be used as an identifier (although it's a keyword) +Sub TestProperty + Dim Property + PROPERTY = true + Call ok(property, "property = " & property) + + for property = 1 to 2 + next +End Sub + +Call TestProperty + +Class Property + Public Sub Property() + End Sub + + Sub Test(byref property) + End Sub +End Class + +Class Property2 + Function Property() + End Function + + + Sub Test(property) + End Sub + + Sub Test2(byval property) + End Sub +End Class + reportSuccess()
1
0
0
0
Jacek Caban : jscript: Moved collecting variable declarations from parser to compiler.
by Alexandre Julliard
25 Apr '12
25 Apr '12
Module: wine Branch: master Commit: 474f1152b23cd8a0d311f31d67a01a4e573864cb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=474f1152b23cd8a0d311f31d6…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Apr 25 11:26:21 2012 +0200 jscript: Moved collecting variable declarations from parser to compiler. --- dlls/jscript/compile.c | 44 ++++++++++++++++++++++++++++++-------------- dlls/jscript/engine.h | 10 +--------- dlls/jscript/parser.y | 13 +------------ 3 files changed, 32 insertions(+), 35 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 796fb7b..c903651 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -53,6 +53,9 @@ typedef struct { statement_ctx_t *stat_ctx; function_code_t *func; + + variable_declaration_t *var_head; + variable_declaration_t *var_tail; } compiler_ctx_t; static const struct { @@ -988,7 +991,19 @@ static HRESULT compile_variable_list(compiler_ctx_t *ctx, variable_declaration_t variable_declaration_t *iter; HRESULT hres; + assert(list != NULL); + + if(ctx->var_tail) + ctx->var_tail->global_next = list; + else + ctx->var_head = list; + for(iter = list; iter; iter = iter->next) { + ctx->func->var_cnt++; + iter->global_next = iter->next; + if(!iter->next) + ctx->var_tail = iter; + if(!iter->expr) continue; @@ -1771,13 +1786,15 @@ static HRESULT init_code(compiler_ctx_t *compiler, const WCHAR *source) static HRESULT compile_function(compiler_ctx_t *ctx, source_elements_t *source, function_expression_t *func_expr, BOOL from_eval, function_code_t *func) { + variable_declaration_t *var_iter; function_declaration_t *iter; - var_list_t *var_iter; unsigned off, i; HRESULT hres; TRACE("\n"); + ctx->var_head = ctx->var_tail = NULL; + off = ctx->code_off; ctx->func = func; hres = compile_block_statement(ctx, source->statement); @@ -1822,6 +1839,18 @@ static HRESULT compile_function(compiler_ctx_t *ctx, source_elements_t *source, } } + func->variables = compiler_alloc(ctx->code, func->var_cnt * sizeof(*func->variables)); + if(!func->variables) + return E_OUTOFMEMORY; + + for(var_iter = ctx->var_head, i=0; var_iter; var_iter = var_iter->global_next, i++) { + func->variables[i] = compiler_alloc_bstr(ctx, var_iter->identifier); + if(!func->variables[i]) + return E_OUTOFMEMORY; + } + + assert(i == func->var_cnt); + func->funcs = compiler_alloc(ctx->code, func->func_cnt * sizeof(*func->funcs)); if(!func->funcs) return E_OUTOFMEMORY; @@ -1835,19 +1864,6 @@ static HRESULT compile_function(compiler_ctx_t *ctx, source_elements_t *source, assert(i == func->func_cnt); - for(var_iter = source->variables; var_iter; var_iter = var_iter->next) - func->var_cnt++; - - func->variables = compiler_alloc(ctx->code, func->var_cnt * sizeof(*func->variables)); - if(!func->variables) - return E_OUTOFMEMORY; - - for(var_iter = source->variables, i=0; var_iter; var_iter = var_iter->next, i++) { - func->variables[i] = compiler_alloc_bstr(ctx, var_iter->identifier); - if(!func->variables[i]) - return E_OUTOFMEMORY; - } - return S_OK; } diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 20f3c45..6a318c7 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -27,17 +27,9 @@ typedef struct _function_declaration_t { struct _function_declaration_t *next; } function_declaration_t; -typedef struct _var_list_t { - const WCHAR *identifier; - - struct _var_list_t *next; -} var_list_t; - typedef struct _func_stack { function_declaration_t *func_head; function_declaration_t *func_tail; - var_list_t *var_head; - var_list_t *var_tail; struct _func_stack *next; } func_stack_t; @@ -302,6 +294,7 @@ typedef struct _variable_declaration_t { expression_t *expr; struct _variable_declaration_t *next; + struct _variable_declaration_t *global_next; /* for compiler */ } variable_declaration_t; typedef enum { @@ -505,7 +498,6 @@ struct _source_elements_t { statement_t *statement; statement_t *statement_tail; function_declaration_t *functions; - var_list_t *variables; }; struct _function_expression_t { diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index 6f31e15..c5984b2 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -1051,19 +1051,11 @@ static statement_t *new_block_statement(parser_ctx_t *ctx, statement_list_t *lis static variable_declaration_t *new_variable_declaration(parser_ctx_t *ctx, const WCHAR *identifier, expression_t *expr) { variable_declaration_t *ret = parser_alloc(ctx, sizeof(variable_declaration_t)); - var_list_t *var_list = parser_alloc(ctx, sizeof(var_list_t)); ret->identifier = identifier; ret->expr = expr; ret->next = NULL; - - var_list->identifier = identifier; - var_list->next = NULL; - - if(ctx->func_stack->var_tail) - ctx->func_stack->var_tail = ctx->func_stack->var_tail->next = var_list; - else - ctx->func_stack->var_head = ctx->func_stack->var_tail = var_list; + ret->global_next = NULL; return ret; } @@ -1503,7 +1495,6 @@ static void push_func(parser_ctx_t *ctx) func_stack_t *new_func = parser_alloc_tmp(ctx, sizeof(func_stack_t)); new_func->func_head = new_func->func_tail = NULL; - new_func->var_head = new_func->var_tail = NULL; new_func->next = ctx->func_stack; ctx->func_stack = new_func; @@ -1512,7 +1503,6 @@ static void push_func(parser_ctx_t *ctx) static source_elements_t *function_body_parsed(parser_ctx_t *ctx, source_elements_t *source) { source->functions = ctx->func_stack->func_head; - source->variables = ctx->func_stack->var_head; pop_func(ctx); return source; @@ -1521,7 +1511,6 @@ static source_elements_t *function_body_parsed(parser_ctx_t *ctx, source_element static void program_parsed(parser_ctx_t *ctx, source_elements_t *source) { source->functions = ctx->func_stack->func_head; - source->variables = ctx->func_stack->var_head; pop_func(ctx); ctx->source = source;
1
0
0
0
Jacek Caban : jscript: Make parser a temporary compiler object.
by Alexandre Julliard
25 Apr '12
25 Apr '12
Module: wine Branch: master Commit: b866c7f5e90b9c1db182e1ab94459df3524e8a4b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b866c7f5e90b9c1db182e1ab9…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Apr 25 11:26:12 2012 +0200 jscript: Make parser a temporary compiler object. --- dlls/jscript/compile.c | 6 +----- dlls/jscript/engine.h | 2 -- 2 files changed, 1 insertions(+), 7 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 6afef2c..796fb7b 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -1732,9 +1732,6 @@ void release_bytecode(bytecode_t *code) if(--code->ref) return; - if(code->parser) - parser_release(code->parser); - for(i=0; i < code->bstr_cnt; i++) SysFreeString(code->bstr_pool[i]); @@ -1878,9 +1875,8 @@ HRESULT compile_script(script_ctx_t *ctx, const WCHAR *code, const WCHAR *delimi return hres; } - compiler.code->parser = compiler.parser; - hres = compile_function(&compiler, compiler.parser->source, NULL, from_eval, &compiler.code->global_code); + parser_release(compiler.parser); if(FAILED(hres)) { release_bytecode(compiler.code); return hres; diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index c57b89e..20f3c45 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -197,8 +197,6 @@ typedef struct _bytecode_t { unsigned bstr_pool_size; unsigned bstr_cnt; - parser_ctx_t *parser; - struct _bytecode_t *next; } bytecode_t;
1
0
0
0
Jacek Caban : jscript: Store function parameters in function_code_t.
by Alexandre Julliard
25 Apr '12
25 Apr '12
Module: wine Branch: master Commit: 97b44da7466f089a25b03ed2785c8a12237f34e9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=97b44da7466f089a25b03ed27…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Apr 25 11:25:57 2012 +0200 jscript: Store function parameters in function_code_t. --- dlls/jscript/compile.c | 17 +++++++++++++++-- dlls/jscript/engine.c | 10 ++-------- dlls/jscript/engine.h | 16 ++++++---------- dlls/jscript/function.c | 25 ++++++------------------- dlls/jscript/jscript.c | 2 +- 5 files changed, 30 insertions(+), 40 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 8bb397d..6afef2c 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -1806,11 +1806,24 @@ static HRESULT compile_function(compiler_ctx_t *ctx, source_elements_t *source, } if(func_expr) { + parameter_t *param_iter; + func->source = func_expr->src_str; func->source_len = func_expr->src_len; - } - func->expr = func_expr; + for(param_iter = func_expr->parameter_list; param_iter; param_iter = param_iter->next) + func->param_cnt++; + + func->params = compiler_alloc(ctx->code, func->param_cnt * sizeof(*func->params)); + if(!func->params) + return E_OUTOFMEMORY; + + for(param_iter = func_expr->parameter_list, i=0; param_iter; param_iter = param_iter->next, i++) { + func->params[i] = compiler_alloc_bstr(ctx, param_iter->identifier); + if(!func->params[i]) + return E_OUTOFMEMORY; + } + } func->funcs = compiler_alloc(ctx->code, func->func_cnt * sizeof(*func->funcs)); if(!func->funcs) diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 189e19b..35339c8 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -804,16 +804,13 @@ static HRESULT interp_end_finally(exec_ctx_t *ctx) static HRESULT interp_func(exec_ctx_t *ctx) { unsigned func_idx = ctx->code->instrs[ctx->ip].arg1.uint; - function_expression_t *expr; jsdisp_t *dispex; VARIANT v; HRESULT hres; TRACE("%d\n", func_idx); - expr = ctx->func_code->funcs[func_idx].expr; - - hres = create_source_function(ctx->script, ctx->code, expr->parameter_list, ctx->func_code->funcs+func_idx, + hres = create_source_function(ctx->script, ctx->code, ctx->func_code->funcs+func_idx, ctx->scope_chain, &dispex); if(FAILED(hres)) return hres; @@ -2619,16 +2616,13 @@ HRESULT exec_source(exec_ctx_t *ctx, bytecode_t *code, function_code_t *func, BO HRESULT hres = S_OK; for(i = 0; i < func->func_cnt; i++) { - function_expression_t *expr; jsdisp_t *func_obj; VARIANT var; if(!func->funcs[i].name) continue; - expr = func->funcs[i].expr; - hres = create_source_function(ctx->script, code, expr->parameter_list, func->funcs+i, - ctx->scope_chain, &func_obj); + hres = create_source_function(ctx->script, code, func->funcs+i, ctx->scope_chain, &func_obj); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index cc58aa8..c57b89e 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -170,8 +170,6 @@ typedef struct _function_code_t { BSTR name; unsigned instr_off; - function_expression_t *expr; /* FIXME */ - const WCHAR *source; unsigned source_len; @@ -180,6 +178,9 @@ typedef struct _function_code_t { unsigned var_cnt; BSTR *variables; + + unsigned param_cnt; + BSTR *params; } function_code_t; typedef struct _bytecode_t { @@ -269,11 +270,7 @@ static inline void exec_addref(exec_ctx_t *ctx) void exec_release(exec_ctx_t*) DECLSPEC_HIDDEN; HRESULT create_exec_ctx(script_ctx_t*,IDispatch*,jsdisp_t*,scope_chain_t*,BOOL,exec_ctx_t**) DECLSPEC_HIDDEN; HRESULT exec_source(exec_ctx_t*,bytecode_t*,function_code_t*,BOOL,jsexcept_t*,VARIANT*) DECLSPEC_HIDDEN; - -typedef struct _parameter_t parameter_t; - -HRESULT create_source_function(script_ctx_t*,bytecode_t*,parameter_t*,function_code_t*,scope_chain_t*, - jsdisp_t**) DECLSPEC_HIDDEN; +HRESULT create_source_function(script_ctx_t*,bytecode_t*,function_code_t*,scope_chain_t*,jsdisp_t**) DECLSPEC_HIDDEN; typedef enum { LT_INT, @@ -501,11 +498,10 @@ struct _expression_t { expression_type_t type; }; -struct _parameter_t { +typedef struct _parameter_t { const WCHAR *identifier; - struct _parameter_t *next; -}; +} parameter_t; struct _source_elements_t { statement_t *statement; diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 0377138..31d3be3 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -28,7 +28,6 @@ typedef struct { builtin_invoke_t value_proc; const WCHAR *name; DWORD flags; - parameter_t *parameters; scope_chain_t *scope_chain; bytecode_t *code; function_code_t *func_code; @@ -75,7 +74,6 @@ static IDispatch *get_this(DISPPARAMS *dp) static HRESULT init_parameters(jsdisp_t *var_disp, FunctionInstance *function, DISPPARAMS *dp, jsexcept_t *ei) { - parameter_t *param; VARIANT var_empty; DWORD cargs, i=0; HRESULT hres; @@ -83,13 +81,11 @@ static HRESULT init_parameters(jsdisp_t *var_disp, FunctionInstance *function, D V_VT(&var_empty) = VT_EMPTY; cargs = arg_cnt(dp); - for(param = function->parameters; param; param = param->next) { - hres = jsdisp_propput_name(var_disp, param->identifier, + for(i=0; i < function->func_code->param_cnt; i++) { + hres = jsdisp_propput_name(var_disp, function->func_code->params[i], i < cargs ? get_arg(dp,i) : &var_empty, ei); if(FAILED(hres)) return hres; - - i++; } return S_OK; @@ -658,13 +654,11 @@ HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc, return S_OK; } -HRESULT create_source_function(script_ctx_t *ctx, bytecode_t *code, parameter_t *parameters, function_code_t *func_code, +HRESULT create_source_function(script_ctx_t *ctx, bytecode_t *code, function_code_t *func_code, scope_chain_t *scope_chain, jsdisp_t **ret) { FunctionInstance *function; jsdisp_t *prototype; - parameter_t *iter; - DWORD length = 0; HRESULT hres; hres = create_object(ctx, NULL, &prototype); @@ -681,9 +675,6 @@ HRESULT create_source_function(script_ctx_t *ctx, bytecode_t *code, parameter_t if(FAILED(hres)) return hres; - function->func_code = func_code; - function->parameters = parameters; - if(scope_chain) { scope_addref(scope_chain); function->scope_chain = scope_chain; @@ -691,10 +682,8 @@ HRESULT create_source_function(script_ctx_t *ctx, bytecode_t *code, parameter_t bytecode_addref(code); function->code = code; - - for(iter = parameters; iter; iter = iter->next) - length++; - function->length = length; + function->func_code = func_code; + function->length = function->func_code->param_cnt; *ret = &function->dispex; return S_OK; @@ -702,7 +691,6 @@ HRESULT create_source_function(script_ctx_t *ctx, bytecode_t *code, parameter_t static HRESULT construct_function(script_ctx_t *ctx, DISPPARAMS *dp, jsexcept_t *ei, IDispatch **ret) { - function_expression_t *expr; WCHAR *str = NULL, *ptr; DWORD argc, len = 0, l; bytecode_t *code; @@ -779,9 +767,8 @@ static HRESULT construct_function(script_ctx_t *ctx, DISPPARAMS *dp, jsexcept_t release_bytecode(code); return E_UNEXPECTED; } - expr = code->global_code.funcs[0].expr; - hres = create_source_function(ctx, code, expr->parameter_list, code->global_code.funcs, NULL, &function); + hres = create_source_function(ctx, code, code->global_code.funcs, NULL, &function); release_bytecode(code); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/jscript.c b/dlls/jscript/jscript.c index da34c11..bf6710b 100644 --- a/dlls/jscript/jscript.c +++ b/dlls/jscript/jscript.c @@ -836,7 +836,7 @@ static HRESULT WINAPI JScriptParseProcedure_ParseProcedureText(IActiveScriptPars return hres; } - hres = create_source_function(This->ctx, code, NULL, &code->global_code, NULL, &dispex); + hres = create_source_function(This->ctx, code, &code->global_code, NULL, &dispex); release_bytecode(code); if(FAILED(hres)) return hres;
1
0
0
0
Jacek Caban : jscript: Fixed func->funcs leak.
by Alexandre Julliard
25 Apr '12
25 Apr '12
Module: wine Branch: master Commit: d1a40539539883c56203743c16731734d2ad72fe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d1a40539539883c56203743c1…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Apr 25 11:25:44 2012 +0200 jscript: Fixed func->funcs leak. --- dlls/jscript/compile.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 5d162ea..8bb397d 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -1812,9 +1812,10 @@ static HRESULT compile_function(compiler_ctx_t *ctx, source_elements_t *source, func->expr = func_expr; - func->funcs = heap_alloc_zero(func->func_cnt * sizeof(*func->funcs)); + func->funcs = compiler_alloc(ctx->code, func->func_cnt * sizeof(*func->funcs)); if(!func->funcs) return E_OUTOFMEMORY; + memset(func->funcs, 0, func->func_cnt * sizeof(*func->funcs)); for(iter = source->functions, i=0; iter; iter = iter->next, i++) { hres = compile_function(ctx, iter->expr->source_elements, iter->expr, FALSE, func->funcs+i);
1
0
0
0
Jacek Caban : jscript: Store variable names in function_code_t.
by Alexandre Julliard
25 Apr '12
25 Apr '12
Module: wine Branch: master Commit: 64a3f5077f719adbad2b2a1668856f113db68fa0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=64a3f5077f719adbad2b2a166…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Apr 25 10:47:56 2012 +0200 jscript: Store variable names in function_code_t. --- dlls/jscript/compile.c | 16 +++++++++++++++- dlls/jscript/engine.c | 20 +++++++------------- dlls/jscript/engine.h | 4 +++- dlls/jscript/function.c | 2 +- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index f8aaa41..5d162ea 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -1775,6 +1775,7 @@ static HRESULT compile_function(compiler_ctx_t *ctx, source_elements_t *source, BOOL from_eval, function_code_t *func) { function_declaration_t *iter; + var_list_t *var_iter; unsigned off, i; HRESULT hres; @@ -1809,7 +1810,6 @@ static HRESULT compile_function(compiler_ctx_t *ctx, source_elements_t *source, func->source_len = func_expr->src_len; } - func->source_elements = source; func->expr = func_expr; func->funcs = heap_alloc_zero(func->func_cnt * sizeof(*func->funcs)); @@ -1823,6 +1823,20 @@ static HRESULT compile_function(compiler_ctx_t *ctx, source_elements_t *source, } assert(i == func->func_cnt); + + for(var_iter = source->variables; var_iter; var_iter = var_iter->next) + func->var_cnt++; + + func->variables = compiler_alloc(ctx->code, func->var_cnt * sizeof(*func->variables)); + if(!func->variables) + return E_OUTOFMEMORY; + + for(var_iter = source->variables, i=0; var_iter; var_iter = var_iter->next, i++) { + func->variables[i] = compiler_alloc_bstr(ctx, var_iter->identifier); + if(!func->variables[i]) + return E_OUTOFMEMORY; + } + return S_OK; } diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index ec906a1..189e19b 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -2614,7 +2614,6 @@ HRESULT exec_source(exec_ctx_t *ctx, bytecode_t *code, function_code_t *func, BO jsexcept_t *ei, VARIANT *retv) { exec_ctx_t *prev_ctx; - var_list_t *var; VARIANT val; unsigned i; HRESULT hres = S_OK; @@ -2640,19 +2639,14 @@ HRESULT exec_source(exec_ctx_t *ctx, bytecode_t *code, function_code_t *func, BO return hres; } - for(var = func->source_elements->variables; var; var = var->next) { - DISPID id = 0; - BSTR name; + for(i=0; i < func->var_cnt; i++) { + if(!ctx->is_global || !lookup_global_members(ctx->script, func->variables[i], NULL)) { + DISPID id = 0; - name = SysAllocString(var->identifier); - if(!name) - return E_OUTOFMEMORY; - - if(!ctx->is_global || !lookup_global_members(ctx->script, name, NULL)) - hres = jsdisp_get_id(ctx->var_disp, var->identifier, fdexNameEnsure, &id); - SysFreeString(name); - if(FAILED(hres)) - return hres; + hres = jsdisp_get_id(ctx->var_disp, func->variables[i], fdexNameEnsure, &id); + if(FAILED(hres)) + return hres; + } } prev_ctx = ctx->script->exec_ctx; diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index a2be6ee..cc58aa8 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -171,13 +171,15 @@ typedef struct _function_code_t { unsigned instr_off; function_expression_t *expr; /* FIXME */ - source_elements_t *source_elements; /* FIXME */ const WCHAR *source; unsigned source_len; unsigned func_cnt; struct _function_code_t *funcs; + + unsigned var_cnt; + BSTR *variables; } function_code_t; typedef struct _bytecode_t { diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index dc4c5e8..0377138 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -774,7 +774,7 @@ static HRESULT construct_function(script_ctx_t *ctx, DISPPARAMS *dp, jsexcept_t if(FAILED(hres)) return hres; - if(code->global_code.func_cnt != 1 || code->parser->source->variables) { + if(code->global_code.func_cnt != 1 || code->global_code.var_cnt) { ERR("Invalid parser result!\n"); release_bytecode(code); return E_UNEXPECTED;
1
0
0
0
Vincent Povirk : gdiplus: Store only one surround color if all colors are the same.
by Alexandre Julliard
25 Apr '12
25 Apr '12
Module: wine Branch: master Commit: e2b59a87b05968f5fd9cdbd2f6df4ce4de36b6b6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e2b59a87b05968f5fd9cdbd2f…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Apr 24 10:14:35 2012 -0500 gdiplus: Store only one surround color if all colors are the same. --- dlls/gdiplus/brush.c | 20 +++++++++++++++++--- dlls/gdiplus/tests/brush.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index a2cf1f9..c11dea6 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -1699,6 +1699,7 @@ GpStatus WINGDIPAPI GdipSetPathGradientSurroundColorsWithCount(GpPathGradient *grad, GDIPCONST ARGB *argb, INT *count) { ARGB *new_surroundcolors; + INT i, num_colors; TRACE("(%p,%p,%p)\n", grad, argb, count); @@ -1706,16 +1707,29 @@ GpStatus WINGDIPAPI GdipSetPathGradientSurroundColorsWithCount(GpPathGradient (*count > grad->path->pathdata.Count)) return InvalidParameter; - new_surroundcolors = GdipAlloc(*count * sizeof(ARGB)); + num_colors = *count; + + /* If all colors are the same, only store 1 color. */ + if (*count > 1) + { + for (i=1; i < num_colors; i++) + if (argb[i] != argb[i-1]) + break; + + if (i == num_colors) + num_colors = 1; + } + + new_surroundcolors = GdipAlloc(num_colors * sizeof(ARGB)); if (!new_surroundcolors) return OutOfMemory; - memcpy(new_surroundcolors, argb, *count * sizeof(ARGB)); + memcpy(new_surroundcolors, argb, num_colors * sizeof(ARGB)); GdipFree(grad->surroundcolors); grad->surroundcolors = new_surroundcolors; - grad->surroundcolorcount = *count; + grad->surroundcolorcount = num_colors; return Ok; } diff --git a/dlls/gdiplus/tests/brush.c b/dlls/gdiplus/tests/brush.c index 354d60d..cde7b56 100644 --- a/dlls/gdiplus/tests/brush.c +++ b/dlls/gdiplus/tests/brush.c @@ -876,6 +876,37 @@ static void test_gradientsurroundcolorcount(void) expect(Ok, status); expect(2, count); + /* If all colors are the same, count is set to 1. */ + color[0] = color[1] = 0; + count = 2; + status = GdipSetPathGradientSurroundColorsWithCount(grad, color, &count); + expect(Ok, status); + expect(2, count); + + color[0] = color[1] = color[2] = 0xdeadbeef; + count = 2; + status = GdipGetPathGradientSurroundColorsWithCount(grad, color, &count); + expect(Ok, status); + expect(1, count); + expect(0x00000000, color[0]); + expect(0x00000000, color[1]); + expect(0xdeadbeef, color[2]); + + color[0] = color[1] = 0xff00ff00; + count = 2; + status = GdipSetPathGradientSurroundColorsWithCount(grad, color, &count); + expect(Ok, status); + expect(2, count); + + color[0] = color[1] = color[2] = 0xdeadbeef; + count = 2; + status = GdipGetPathGradientSurroundColorsWithCount(grad, color, &count); + expect(Ok, status); + expect(1, count); + expect(0xff00ff00, color[0]); + expect(0xff00ff00, color[1]); + expect(0xdeadbeef, color[2]); + count = 0; status = GdipSetPathGradientSurroundColorsWithCount(grad, color, &count); expect(InvalidParameter, status);
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
...
72
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Results per page:
10
25
50
100
200