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
April
March
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
February 2021
----- 2025 -----
April 2025
March 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
915 discussions
Start a n
N
ew thread
Rémi Bernon : widl: Fold inherit cases by using typename rule in qualified_type.
by Alexandre Julliard
08 Feb '21
08 Feb '21
Module: wine Branch: master Commit: 509daf4d23c475a10ae120e0f7644cfa2056b375 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=509daf4d23c475a10ae120e0…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Feb 8 09:30:47 2021 +0100 widl: Fold inherit cases by using typename rule in qualified_type. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/widl/parser.y | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tools/widl/parser.y b/tools/widl/parser.y index d3a79e9fcb7..bbf71a2e3ef 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -892,7 +892,7 @@ namespace_pfx: ; qualified_type: - aKNOWNTYPE { $$ = find_type_or_error(current_namespace, $1); } + typename { $$ = find_type_or_error(current_namespace, $1); } | namespace_pfx typename { $$ = find_type_or_error($1, $2); } ; @@ -960,11 +960,6 @@ interfacedef: attributes interface inherit '{' int_statements '}' semicolon_opt { $$ = type_interface_define($2, $1, $3, $5); check_async_uuid($$); } -/* MIDL is able to import the definition of a base class from inside the - * definition of a derived class, I'll try to support it with this rule */ - | attributes interface ':' aIDENTIFIER - '{' import int_statements '}' - semicolon_opt { $$ = type_interface_define($2, $1, find_type_or_error(current_namespace, $4), $7); } | dispinterfacedef semicolon_opt { $$ = $1; } ;
1
0
0
0
Rémi Bernon : widl: Remove aNAMESPACE token from the lexer.
by Alexandre Julliard
08 Feb '21
08 Feb '21
Module: wine Branch: master Commit: 374321f83619f5f71eb67ddf3aff368651c51367 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=374321f83619f5f71eb67ddf…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Feb 8 09:30:46 2021 +0100 widl: Remove aNAMESPACE token from the lexer. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/widl/parser.h | 1 - tools/widl/parser.l | 2 +- tools/widl/parser.y | 13 ++----------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/tools/widl/parser.h b/tools/widl/parser.h index a6dc94ae6b8..a67b160d48a 100644 --- a/tools/widl/parser.h +++ b/tools/widl/parser.h @@ -38,7 +38,6 @@ void pop_import(void); #define parse_only import_stack_ptr int is_type(const char *name); -int is_namespace(const char *name); int do_warning(char *toggle, warning_list_t *wnum); int is_warning_enabled(int warning); diff --git a/tools/widl/parser.l b/tools/widl/parser.l index 7e20d30e7f0..8acc9c9590c 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -468,7 +468,7 @@ static int kw_token(const char *kw) return kwp->token; } parser_lval.str = xstrdup(kw); - return is_type(kw) ? aKNOWNTYPE : is_namespace(kw) ? aNAMESPACE : aIDENTIFIER; + return is_type(kw) ? aKNOWNTYPE : aIDENTIFIER; } static int attr_token(const char *kw) diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 9fb6772ba33..d3a79e9fcb7 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -154,7 +154,7 @@ static typelib_t *current_typelib; } %token <str> aIDENTIFIER aPRAGMA -%token <str> aKNOWNTYPE aNAMESPACE +%token <str> aKNOWNTYPE %token <num> aNUM aHEXNUM %token <dbl> aDOUBLE %token <str> aSTRING aWSTRING aSQSTRING @@ -887,8 +887,7 @@ int_std: tINT { $$ = type_new_int(TYPE_BASIC_INT, 0); } ; namespace_pfx: - aNAMESPACE '.' { $$ = find_namespace_or_error(&global_namespace, $1); } - | namespace_pfx aNAMESPACE '.' { $$ = find_namespace_or_error($1, $2); } + aIDENTIFIER '.' { $$ = find_namespace_or_error(&global_namespace, $1); } | namespace_pfx aIDENTIFIER '.' { $$ = find_namespace_or_error($1, $2); } ; @@ -919,7 +918,6 @@ apicontract_def: attributes apicontract '{' '}' semicolon_opt ; namespacedef: tNAMESPACE aIDENTIFIER { $$ = $2; } - | tNAMESPACE aNAMESPACE { $$ = $2; } ; class_interfaces: { $$ = NULL; } @@ -2061,13 +2059,6 @@ int is_type(const char *name) return find_type(name, current_namespace, 0) != NULL; } -int is_namespace(const char *name) -{ - if (!winrt_mode) return 0; - return find_sub_namespace(current_namespace, name) != NULL || - find_sub_namespace(&global_namespace, name) != NULL; -} - type_t *get_type(enum type_type type, char *name, struct namespace *namespace, int t) { type_t *tp;
1
0
0
0
Rémi Bernon : widl: Disallow qualified types in expressions.
by Alexandre Julliard
08 Feb '21
08 Feb '21
Module: wine Branch: master Commit: f5b7a76b2843e33ba811b0384d8d24cb1bec3f03 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f5b7a76b2843e33ba811b038…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Feb 8 09:30:45 2021 +0100 widl: Disallow qualified types in expressions. MIDL WinRT mode only supports a limited subset of original IDL syntax anyway, and this will save some conflicts when removing the lexer trick for namespaces. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/widl/parser.y | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tools/widl/parser.y b/tools/widl/parser.y index e4834a06e23..9fb6772ba33 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -279,7 +279,7 @@ static typelib_t *current_typelib; %type <stgclass> storage_cls_spec %type <type_qualifier> type_qualifier m_type_qual_list %type <function_specifier> function_specifier -%type <declspec> decl_spec decl_spec_no_type m_decl_spec_no_type +%type <declspec> decl_spec unqualified_decl_spec decl_spec_no_type m_decl_spec_no_type %type <type> inherit interface interfacedef %type <type> interfaceref %type <type> dispinterface dispinterfacedef @@ -287,7 +287,7 @@ static typelib_t *current_typelib; %type <str> namespacedef %type <type> base_type int_std %type <type> enumdef structdef uniondef typedecl -%type <type> type qualified_type +%type <type> type unqualified_type qualified_type %type <ifref> class_interface %type <ifref_list> class_interfaces %type <var> arg ne_union_field union_field s_field case enum enum_member declaration @@ -763,9 +763,9 @@ expr: aNUM { $$ = make_exprl(EXPR_NUM, $1); } | '*' expr %prec PPTR { $$ = make_expr1(EXPR_PPTR, $2); } | expr MEMBERPTR aIDENTIFIER { $$ = make_expr2(EXPR_MEMBER, make_expr1(EXPR_PPTR, $1), make_exprs(EXPR_IDENTIFIER, $3)); } | expr '.' aIDENTIFIER { $$ = make_expr2(EXPR_MEMBER, $1, make_exprs(EXPR_IDENTIFIER, $3)); } - | '(' decl_spec m_abstract_declarator ')' expr %prec CAST + | '(' unqualified_decl_spec m_abstract_declarator ')' expr %prec CAST { $$ = make_exprt(EXPR_CAST, declare_var(NULL, $2, $3, 0), $5); free($2); free($3); } - | tSIZEOF '(' decl_spec m_abstract_declarator ')' + | tSIZEOF '(' unqualified_decl_spec m_abstract_declarator ')' { $$ = make_exprt(EXPR_SIZEOF, declare_var(NULL, $3, $4, 0), NULL); free($3); free($4); } | expr '[' expr ']' { $$ = make_expr2(EXPR_ARRAY, $1, $3); } | '(' expr ')' { $$ = $2; } @@ -1005,6 +1005,12 @@ decl_spec: type m_decl_spec_no_type { $$ = make_decl_spec($1, $2, NULL, STG_NON { $$ = make_decl_spec($2, $1, $3, STG_NONE, 0, 0); } ; +unqualified_decl_spec: unqualified_type m_decl_spec_no_type + { $$ = make_decl_spec($1, $2, NULL, STG_NONE, 0, 0); } + | decl_spec_no_type unqualified_type m_decl_spec_no_type + { $$ = make_decl_spec($2, $1, $3, STG_NONE, 0, 0); } + ; + m_decl_spec_no_type: { $$ = NULL; } | decl_spec_no_type ; @@ -1146,8 +1152,8 @@ pointer_type: structdef: tSTRUCT m_typename '{' fields '}' { $$ = type_new_struct($2, current_namespace, TRUE, $4); } ; -type: tVOID { $$ = type_new_void(); } - | qualified_type { $$ = $1; } +unqualified_type: + tVOID { $$ = type_new_void(); } | base_type { $$ = $1; } | enumdef { $$ = $1; } | tENUM aIDENTIFIER { $$ = type_new_enum($2, current_namespace, FALSE, NULL); } @@ -1156,6 +1162,12 @@ type: tVOID { $$ = type_new_void(); } | uniondef { $$ = $1; } | tUNION aIDENTIFIER { $$ = type_new_nonencapsulated_union($2, FALSE, NULL); } | tSAFEARRAY '(' type ')' { $$ = make_safearray($3); } + | aKNOWNTYPE { $$ = find_type_or_error(current_namespace, $1); } + ; + +type: + unqualified_type + | namespace_pfx typename { $$ = find_type_or_error($1, $2); } ; typedef: m_attributes tTYPEDEF m_attributes decl_spec declarator_list
1
0
0
0
Rémi Bernon : widl: Use explicit namespace parameter for qualified names.
by Alexandre Julliard
08 Feb '21
08 Feb '21
Module: wine Branch: master Commit: 47a256c648778d0b5798fe6bd3ca7f419f1850b4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=47a256c648778d0b5798fe6b…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Feb 8 09:30:44 2021 +0100 widl: Use explicit namespace parameter for qualified names. Instead of buggy lookup namespace stack. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/widl/parser.y | 52 +++++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 17a3727b114..e4834a06e23 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -76,13 +76,12 @@ static warning_list_t *append_warning(warning_list_t *, int); static type_t *reg_typedefs(decl_spec_t *decl_spec, var_list_t *names, attr_list_t *attrs); static type_t *find_type_or_error(struct namespace *parent, const char *name); +static struct namespace *find_namespace_or_error(struct namespace *namespace, const char *name); static var_t *reg_const(var_t *var); static void push_namespace(const char *name); static void pop_namespace(const char *name); -static void init_lookup_namespace(const char *name); -static void push_lookup_namespace(const char *name); static void check_arg_attrs(const var_t *arg); static void check_statements(const statement_list_t *stmts, int is_inside_library); @@ -120,7 +119,6 @@ static struct namespace global_namespace = { }; static struct namespace *current_namespace = &global_namespace; -static struct namespace *lookup_namespace = &global_namespace; static typelib_t *current_typelib; @@ -152,6 +150,7 @@ static typelib_t *current_typelib; enum storage_class stgclass; enum type_qualifier type_qualifier; enum function_specifier function_specifier; + struct namespace *namespace; } %token <str> aIDENTIFIER aPRAGMA @@ -288,7 +287,7 @@ static typelib_t *current_typelib; %type <str> namespacedef %type <type> base_type int_std %type <type> enumdef structdef uniondef typedecl -%type <type> type qualified_seq qualified_type +%type <type> type qualified_type %type <ifref> class_interface %type <ifref_list> class_interfaces %type <var> arg ne_union_field union_field s_field case enum enum_member declaration @@ -314,6 +313,7 @@ static typelib_t *current_typelib; %type <stmt_list> gbl_statements imp_statements int_statements %type <warning_list> warnings %type <num> allocate_option_list allocate_option +%type <namespace> namespace_pfx %left ',' %right '?' ':' @@ -886,15 +886,16 @@ int_std: tINT { $$ = type_new_int(TYPE_BASIC_INT, 0); } | tINT3264 { $$ = type_new_int(TYPE_BASIC_INT3264, 0); } ; -qualified_seq: - aKNOWNTYPE { $$ = find_type_or_error(lookup_namespace, $1); } - | aIDENTIFIER '.' { push_lookup_namespace($1); } qualified_seq { $$ = $4; } - ; +namespace_pfx: + aNAMESPACE '.' { $$ = find_namespace_or_error(&global_namespace, $1); } + | namespace_pfx aNAMESPACE '.' { $$ = find_namespace_or_error($1, $2); } + | namespace_pfx aIDENTIFIER '.' { $$ = find_namespace_or_error($1, $2); } + ; qualified_type: - aKNOWNTYPE { $$ = find_type_or_error(current_namespace, $1); } - | aNAMESPACE '.' { init_lookup_namespace($1); } qualified_seq { $$ = $4; } - ; + aKNOWNTYPE { $$ = find_type_or_error(current_namespace, $1); } + | namespace_pfx typename { $$ = find_type_or_error($1, $2); } + ; coclass: tCOCLASS typename { $$ = type_coclass_declare($2); } ; @@ -1911,20 +1912,6 @@ static void pop_namespace(const char *name) current_namespace = current_namespace->parent; } -static void init_lookup_namespace(const char *name) -{ - if (!(lookup_namespace = find_sub_namespace(&global_namespace, name))) - error_loc("namespace '%s' not found\n", name); -} - -static void push_lookup_namespace(const char *name) -{ - struct namespace *namespace; - if (!(namespace = find_sub_namespace(lookup_namespace, name))) - error_loc("namespace '%s' not found\n", name); - lookup_namespace = namespace; -} - struct rtype { const char *name; type_t *type; @@ -2045,10 +2032,21 @@ static type_t *find_type_or_error(struct namespace *namespace, const char *name) return type; } +static struct namespace *find_namespace_or_error(struct namespace *parent, const char *name) +{ + struct namespace *namespace = NULL; + + if (!winrt_mode) + error_loc("namespaces are only supported in winrt mode.\n"); + else if (!(namespace = find_sub_namespace(parent, name))) + error_loc("namespace '%s' not found in '%s'\n", name, parent->name); + + return namespace; +} + int is_type(const char *name) { - return find_type(name, current_namespace, 0) != NULL || - find_type(name, lookup_namespace, 0) != NULL; + return find_type(name, current_namespace, 0) != NULL; } int is_namespace(const char *name)
1
0
0
0
Rémi Bernon : widl: Add explicit namespace parameter to find_type_or_error.
by Alexandre Julliard
08 Feb '21
08 Feb '21
Module: wine Branch: master Commit: f76f3d152fbe9ed09bde19bfba741090528e045c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f76f3d152fbe9ed09bde19bf…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Feb 8 09:30:43 2021 +0100 widl: Add explicit namespace parameter to find_type_or_error. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/widl/parser.y | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 2d527805c14..17a3727b114 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -75,7 +75,7 @@ static void append_chain_callconv(type_t *chain, char *callconv); static warning_list_t *append_warning(warning_list_t *, int); static type_t *reg_typedefs(decl_spec_t *decl_spec, var_list_t *names, attr_list_t *attrs); -static type_t *find_type_or_error(const char *name); +static type_t *find_type_or_error(struct namespace *parent, const char *name); static var_t *reg_const(var_t *var); @@ -858,17 +858,17 @@ typename: aIDENTIFIER ident: typename { $$ = make_var($1); } ; -base_type: tBYTE { $$ = find_type_or_error($<str>1); } - | tWCHAR { $$ = find_type_or_error($<str>1); } +base_type: tBYTE { $$ = find_type_or_error(NULL, $<str>1); } + | tWCHAR { $$ = find_type_or_error(NULL, $<str>1); } | int_std | tSIGNED int_std { $$ = type_new_int(type_basic_get_type($2), -1); } | tUNSIGNED int_std { $$ = type_new_int(type_basic_get_type($2), 1); } | tUNSIGNED { $$ = type_new_int(TYPE_BASIC_INT, 1); } - | tFLOAT { $$ = find_type_or_error($<str>1); } - | tDOUBLE { $$ = find_type_or_error($<str>1); } - | tBOOLEAN { $$ = find_type_or_error($<str>1); } - | tERRORSTATUST { $$ = find_type_or_error($<str>1); } - | tHANDLET { $$ = find_type_or_error($<str>1); } + | tFLOAT { $$ = find_type_or_error(NULL, $<str>1); } + | tDOUBLE { $$ = find_type_or_error(NULL, $<str>1); } + | tBOOLEAN { $$ = find_type_or_error(NULL, $<str>1); } + | tERRORSTATUST { $$ = find_type_or_error(NULL, $<str>1); } + | tHANDLET { $$ = find_type_or_error(NULL, $<str>1); } ; m_int: @@ -887,12 +887,12 @@ int_std: tINT { $$ = type_new_int(TYPE_BASIC_INT, 0); } ; qualified_seq: - aKNOWNTYPE { $$ = find_type_or_error($1); } + aKNOWNTYPE { $$ = find_type_or_error(lookup_namespace, $1); } | aIDENTIFIER '.' { push_lookup_namespace($1); } qualified_seq { $$ = $4; } ; qualified_type: - aKNOWNTYPE { $$ = find_type_or_error($1); } + aKNOWNTYPE { $$ = find_type_or_error(current_namespace, $1); } | aNAMESPACE '.' { init_lookup_namespace($1); } qualified_seq { $$ = $4; } ; @@ -965,7 +965,7 @@ interfacedef: attributes interface inherit * definition of a derived class, I'll try to support it with this rule */ | attributes interface ':' aIDENTIFIER '{' import int_statements '}' - semicolon_opt { $$ = type_interface_define($2, $1, find_type_or_error($4), $7); } + semicolon_opt { $$ = type_interface_define($2, $1, find_type_or_error(current_namespace, $4), $7); } | dispinterfacedef semicolon_opt { $$ = $1; } ; @@ -1189,14 +1189,14 @@ acf_int_statements acf_int_statement : tTYPEDEF acf_attributes aKNOWNTYPE ';' - { type_t *type = find_type_or_error($3); + { type_t *type = find_type_or_error(current_namespace, $3); type->attrs = append_attr_list(type->attrs, $2); } ; acf_interface : acf_attributes tINTERFACE aKNOWNTYPE '{' acf_int_statements '}' - { type_t *iface = find_type_or_error($3); + { type_t *iface = find_type_or_error(current_namespace, $3); if (type_get_type(iface) != TYPE_INTERFACE) error_loc("%s is not an interface\n", iface->name); iface->attrs = append_attr_list(iface->attrs, $1); @@ -2034,13 +2034,12 @@ type_t *find_type(const char *name, struct namespace *namespace, int t) return NULL; } -static type_t *find_type_or_error(const char *name) +static type_t *find_type_or_error(struct namespace *namespace, const char *name) { type_t *type; - if (!(type = find_type(name, current_namespace, 0)) && - !(type = find_type(name, lookup_namespace, 0))) + if (!(type = find_type(name, namespace, 0))) { - error_loc("type '%s' not found\n", name); + error_loc("type '%s' not found in %s namespace\n", name, namespace && namespace->name ? namespace->name : "global"); return NULL; } return type; @@ -2851,7 +2850,7 @@ static void add_explicit_handle_if_necessary(const type_t *iface, var_t *func) * function */ var_t *idl_handle = make_var(xstrdup("IDL_handle")); idl_handle->attrs = append_attr(NULL, make_attr(ATTR_IN)); - idl_handle->declspec.type = find_type_or_error("handle_t"); + idl_handle->declspec.type = find_type_or_error(NULL, "handle_t"); type_function_add_head_arg(func->declspec.type, idl_handle); } } @@ -3141,7 +3140,7 @@ static statement_t *make_statement_typedef(declarator_list_t *decls, int declonl LIST_FOR_EACH_ENTRY_SAFE( decl, next, decls, declarator_t, entry ) { var_t *var = decl->var; - type_t *type = find_type_or_error(var->name); + type_t *type = find_type_or_error(current_namespace, var->name); *type_list = xmalloc(sizeof(type_list_t)); (*type_list)->type = type; (*type_list)->next = NULL;
1
0
0
0
Alexandre Julliard : server: Get the process entry point from the exe image info.
by Alexandre Julliard
08 Feb '21
08 Feb '21
Module: wine Branch: master Commit: a3c92a02cc7014cfdb1f90f1d070037868067097 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a3c92a02cc7014cfdb1f90f1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Feb 8 12:10:49 2021 +0100 server: Get the process entry point from the exe image info. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/server.c | 6 ++---- include/wine/server_protocol.h | 9 ++++----- server/process.c | 21 +++++++++++++++------ server/protocol.def | 4 +--- server/request.h | 10 ++++------ server/trace.c | 6 ++---- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c index 7b469959f66..6af8effe9e1 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c @@ -1587,7 +1587,7 @@ void server_init_process_done(void) { PEB *peb = NtCurrentTeb()->Peb; IMAGE_NT_HEADERS *nt = get_exe_nt_header(); - void *entry = (char *)peb->ImageBaseAddress + nt->OptionalHeader.AddressOfEntryPoint; + void *entry; NTSTATUS status; int suspend, needs_close, unixdir; @@ -1613,11 +1613,9 @@ void server_init_process_done(void) /* Signal the parent process to continue */ SERVER_START_REQ( init_process_done ) { - req->module = wine_server_client_ptr( peb->ImageBaseAddress ); - req->entry = wine_server_client_ptr( entry ); - req->gui = (nt->OptionalHeader.Subsystem != IMAGE_SUBSYSTEM_WINDOWS_CUI); status = wine_server_call( req ); suspend = reply->suspend; + entry = wine_server_get_ptr( reply->entry ); } SERVER_END_REQ; diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index af9fa7a427f..c848b71423c 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -900,15 +900,14 @@ struct get_startup_info_reply struct init_process_done_request { struct request_header __header; - int gui; - mod_handle_t module; - client_ptr_t entry; + char __pad_12[4]; }; struct init_process_done_reply { struct reply_header __header; + client_ptr_t entry; int suspend; - char __pad_12[4]; + char __pad_20[4]; }; @@ -6280,7 +6279,7 @@ union generic_reply /* ### protocol_version begin ### */ -#define SERVER_PROTOCOL_VERSION 669 +#define SERVER_PROTOCOL_VERSION 670 /* ### protocol_version end ### */ diff --git a/server/process.c b/server/process.c index ff3b47455d2..225a9e4f761 100644 --- a/server/process.c +++ b/server/process.c @@ -1349,31 +1349,40 @@ DECL_HANDLER(init_process_done) { struct process_dll *dll; struct process *process = current->process; + struct memory_view *view; + client_ptr_t base; + const pe_image_info_t *image_info; if (is_process_init_done(process)) { set_error( STATUS_INVALID_PARAMETER ); return; } - if (!(dll = find_process_dll( process, req->module ))) + if (!(view = get_exe_view( process ))) { set_error( STATUS_DLL_NOT_FOUND ); return; } + if (!(image_info = get_view_image_info( view, &base ))) return; - /* main exe is the first in the dll list */ - list_remove( &dll->entry ); - list_add_head( &process->dlls, &dll->entry ); + if ((dll = find_process_dll( process, base ))) + { + /* main exe is the first in the dll list */ + list_remove( &dll->entry ); + list_add_head( &process->dlls, &dll->entry ); + } process->start_time = current_time; - current->entry_point = req->entry; + current->entry_point = image_info->entry_point; init_process_tracing( process ); generate_startup_debug_events( process ); set_process_startup_state( process, STARTUP_DONE ); - if (req->gui) process->idle_event = create_event( NULL, NULL, 0, 1, 0, NULL ); + if (image_info->subsystem != IMAGE_SUBSYSTEM_WINDOWS_CUI) + process->idle_event = create_event( NULL, NULL, 0, 1, 0, NULL ); if (process->debug_obj) set_process_debug_flag( process, 1 ); + reply->entry = image_info->entry_point; reply->suspend = (current->suspend || process->suspend); } diff --git a/server/protocol.def b/server/protocol.def index 76e7a5b941d..9fbe02f2f99 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -882,10 +882,8 @@ typedef struct /* Signal the end of the process initialization */ @REQ(init_process_done) - int gui; /* is it a GUI process? */ - mod_handle_t module; /* main module base address */ - client_ptr_t entry; /* process entry point */ @REPLY + client_ptr_t entry; /* process entry point */ int suspend; /* is process suspended? */ @END diff --git a/server/request.h b/server/request.h index 02c6121d291..39ba4377fd1 100644 --- a/server/request.h +++ b/server/request.h @@ -748,12 +748,10 @@ C_ASSERT( sizeof(struct new_thread_reply) == 16 ); C_ASSERT( sizeof(struct get_startup_info_request) == 16 ); C_ASSERT( FIELD_OFFSET(struct get_startup_info_reply, info_size) == 8 ); C_ASSERT( sizeof(struct get_startup_info_reply) == 16 ); -C_ASSERT( FIELD_OFFSET(struct init_process_done_request, gui) == 12 ); -C_ASSERT( FIELD_OFFSET(struct init_process_done_request, module) == 16 ); -C_ASSERT( FIELD_OFFSET(struct init_process_done_request, entry) == 24 ); -C_ASSERT( sizeof(struct init_process_done_request) == 32 ); -C_ASSERT( FIELD_OFFSET(struct init_process_done_reply, suspend) == 8 ); -C_ASSERT( sizeof(struct init_process_done_reply) == 16 ); +C_ASSERT( sizeof(struct init_process_done_request) == 16 ); +C_ASSERT( FIELD_OFFSET(struct init_process_done_reply, entry) == 8 ); +C_ASSERT( FIELD_OFFSET(struct init_process_done_reply, suspend) == 16 ); +C_ASSERT( sizeof(struct init_process_done_reply) == 24 ); C_ASSERT( FIELD_OFFSET(struct init_first_thread_request, unix_pid) == 12 ); C_ASSERT( FIELD_OFFSET(struct init_first_thread_request, unix_tid) == 16 ); C_ASSERT( FIELD_OFFSET(struct init_first_thread_request, debug_level) == 20 ); diff --git a/server/trace.c b/server/trace.c index 53c5836ef22..e8636013b0e 100644 --- a/server/trace.c +++ b/server/trace.c @@ -1420,14 +1420,12 @@ static void dump_get_startup_info_reply( const struct get_startup_info_reply *re static void dump_init_process_done_request( const struct init_process_done_request *req ) { - fprintf( stderr, " gui=%d", req->gui ); - dump_uint64( ", module=", &req->module ); - dump_uint64( ", entry=", &req->entry ); } static void dump_init_process_done_reply( const struct init_process_done_reply *req ) { - fprintf( stderr, " suspend=%d", req->suspend ); + dump_uint64( " entry=", &req->entry ); + fprintf( stderr, ", suspend=%d", req->suspend ); } static void dump_init_first_thread_request( const struct init_first_thread_request *req )
1
0
0
0
Alexandre Julliard : server: Implement retrieving the debug object of a process.
by Alexandre Julliard
08 Feb '21
08 Feb '21
Module: wine Branch: master Commit: 52d733b5c4876276d7a2dfc8d9a9bb72a853dfd0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=52d733b5c4876276d7a2dfc8…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Feb 8 12:09:44 2021 +0100 server: Implement retrieving the debug object of a process. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/info.c | 4 ++-- dlls/ntdll/unix/process.c | 45 ++++++++++++++++++++++++++++-------------- include/wine/server_protocol.h | 23 ++++++++++++++++++--- server/process.c | 15 ++++++++++++-- server/protocol.def | 12 +++++++++-- server/request.h | 9 +++++++-- server/trace.c | 16 ++++++++++++++- 7 files changed, 97 insertions(+), 27 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=52d733b5c4876276d7a2…
1
0
0
0
Nikolay Sivov : dwrite: Use attachment chain for marks positioning.
by Alexandre Julliard
08 Feb '21
08 Feb '21
Module: wine Branch: master Commit: 988dc7753af28833eaacbc5cd258dced67584a86 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=988dc7753af28833eaacbc5c…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Feb 8 10:09:41 2021 +0300 dwrite: Use attachment chain for marks positioning. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/opentype.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c index 5fd341e8c94..2f254607653 100644 --- a/dlls/dwrite/opentype.c +++ b/dlls/dwrite/opentype.c @@ -479,6 +479,7 @@ enum gsub_gpos_lookup_flags enum attach_type { GLYPH_ATTACH_NONE = 0, + GLYPH_ATTACH_MARK, GLYPH_ATTACH_CURSIVE, }; @@ -4221,6 +4222,10 @@ static BOOL opentype_layout_apply_mark_array(struct scriptshaping_context *conte else context->offsets[context->cur].advanceOffset = -context->advances[glyph_pos] + base_x - mark_x; context->offsets[context->cur].ascenderOffset = base_y - mark_y; + opentype_set_glyph_attach_type(context, context->cur, GLYPH_ATTACH_MARK); + context->glyph_infos[context->cur].attach_chain = (int)glyph_pos - (int)context->cur; + context->has_gpos_attachment = 1; + context->cur++; return TRUE; @@ -4781,7 +4786,7 @@ static void opentype_propagate_attachment_offsets(struct scriptshaping_context * { enum attach_type type = opentype_get_glyph_attach_type(context, i); int chain = context->glyph_infos[i].attach_chain; - unsigned int j; + unsigned int j, k; if (!chain) return; @@ -4799,6 +4804,27 @@ static void opentype_propagate_attachment_offsets(struct scriptshaping_context * /* FIXME: handle vertical direction. */ context->offsets[i].ascenderOffset += context->offsets[j].ascenderOffset; } + else if (type == GLYPH_ATTACH_MARK) + { + context->offsets[i].advanceOffset += context->offsets[j].advanceOffset; + context->offsets[i].ascenderOffset += context->offsets[j].ascenderOffset; + + /* FIXME: handle vertical adjustment. */ + if (context->is_rtl) + { + for (k = j + 1; k < i + 1; ++k) + { + context->offsets[i].advanceOffset += context->advances[k]; + } + } + else + { + for (k = j; k < i; k++) + { + context->offsets[i].advanceOffset -= context->advances[k]; + } + } + } } void opentype_layout_apply_gpos_features(struct scriptshaping_context *context, unsigned int script_index,
1
0
0
0
Nikolay Sivov : dwrite: Track attachment chain during cursive positioning.
by Alexandre Julliard
08 Feb '21
08 Feb '21
Module: wine Branch: master Commit: db3a258f97fc784ba8e579084e7e3ee17644df2e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=db3a258f97fc784ba8e57908…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Feb 8 10:09:40 2021 +0300 dwrite: Track attachment chain during cursive positioning. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/dwrite_private.h | 3 ++ dlls/dwrite/opentype.c | 106 +++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 104 insertions(+), 5 deletions(-) diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h index ac870fd215c..fa36e92bde5 100644 --- a/dlls/dwrite/dwrite_private.h +++ b/dlls/dwrite/dwrite_private.h @@ -517,6 +517,8 @@ struct shaping_glyph_info unsigned int mask; /* Derived from glyph class, supplied by GDEF. */ unsigned int props; + /* Used for GPOS mark and cursive attachments. */ + int attach_chain; /* Only relevant for isClusterStart glyphs. Indicates text position for this cluster. */ unsigned int start_text_idx; }; @@ -649,6 +651,7 @@ struct scriptshaping_context unsigned int auto_zwj; unsigned int auto_zwnj; struct shaping_glyph_info *glyph_infos; + unsigned int has_gpos_attachment : 1; unsigned int cur; unsigned int glyph_count; diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c index dc5fb3f11e8..5fd341e8c94 100644 --- a/dlls/dwrite/opentype.c +++ b/dlls/dwrite/opentype.c @@ -470,21 +470,31 @@ enum gsub_gpos_lookup_flags LOOKUP_FLAG_IGNORE_BASE = 0x2, LOOKUP_FLAG_IGNORE_LIGATURES = 0x4, LOOKUP_FLAG_IGNORE_MARKS = 0x8, - LOOKUP_FLAG_IGNORE_MASK = 0xe, + LOOKUP_FLAG_IGNORE_MASK = 0xe, /* Combined LOOKUP_FLAG_IGNORE_* flags. */ LOOKUP_FLAG_USE_MARK_FILTERING_SET = 0x10, LOOKUP_FLAG_MARK_ATTACHMENT_TYPE = 0xff00, }; +enum attach_type +{ + GLYPH_ATTACH_NONE = 0, + GLYPH_ATTACH_CURSIVE, +}; + enum glyph_prop_flags { GLYPH_PROP_BASE = LOOKUP_FLAG_IGNORE_BASE, GLYPH_PROP_LIGATURE = LOOKUP_FLAG_IGNORE_LIGATURES, GLYPH_PROP_MARK = LOOKUP_FLAG_IGNORE_MARKS, + GLYPH_PROP_ZWNJ = 0x10, GLYPH_PROP_ZWJ = 0x20, GLYPH_PROP_IGNORABLE = 0x40, GLYPH_PROP_HIDDEN = 0x80, + + GLYPH_PROP_MARK_ATTACH_CLASS_MASK = 0xff00, /* Used with LOOKUP_FLAG_MARK_ATTACHMENT_TYPE. */ + GLYPH_PROP_ATTACH_TYPE_MASK = 0xff0000, }; enum gpos_lookup_type @@ -4036,6 +4046,43 @@ static void opentype_layout_gpos_get_anchor(const struct scriptshaping_context * WARN("Unknown anchor format %u.\n", format); } +static void opentype_set_glyph_attach_type(struct scriptshaping_context *context, unsigned int idx, + enum attach_type attach_type) +{ + context->glyph_infos[idx].props &= ~GLYPH_PROP_ATTACH_TYPE_MASK; + context->glyph_infos[idx].props |= attach_type << 16; +} + +static enum attach_type opentype_get_glyph_attach_type(const struct scriptshaping_context *context, unsigned int idx) +{ + return (context->glyph_infos[idx].props >> 16) & 0xff; +} + +static void opentype_reverse_cursive_offset(struct scriptshaping_context *context, unsigned int i, + unsigned int new_parent) +{ + enum attach_type type = opentype_get_glyph_attach_type(context, i); + int chain = context->glyph_infos[i].attach_chain; + unsigned int j; + + if (!chain || type != GLYPH_ATTACH_CURSIVE) + return; + + context->glyph_infos[i].attach_chain = 0; + + j = (int)i + chain; + if (j == new_parent) + return; + + opentype_reverse_cursive_offset(context, j, new_parent); + + /* FIXME: handle vertical flow direction */ + context->offsets[j].ascenderOffset = -context->offsets[i].ascenderOffset; + + context->glyph_infos[j].attach_chain = -chain; + opentype_set_glyph_attach_type(context, j, type); +} + static BOOL opentype_layout_apply_gpos_cursive_attachment(struct scriptshaping_context *context, const struct lookup *lookup, unsigned int subtable_offset) { @@ -4049,9 +4096,10 @@ static BOOL opentype_layout_apply_gpos_cursive_attachment(struct scriptshaping_c { WORD coverage_offset = table_read_be_word(table, subtable_offset + FIELD_OFFSET(struct ot_gpos_cursive_format1, coverage)); - unsigned int glyph_index, entry_count, entry_anchor, exit_anchor; + unsigned int glyph_index, entry_count, entry_anchor, exit_anchor, child, parent; float entry_x, entry_y, exit_x, exit_y, delta; struct glyph_iterator prev_iter; + float y_offset; if (!coverage_offset) return FALSE; @@ -4100,9 +4148,28 @@ static BOOL opentype_layout_apply_gpos_cursive_attachment(struct scriptshaping_c } if (lookup->flags & LOOKUP_FLAG_RTL) - context->offsets[prev_iter.pos].ascenderOffset = entry_y - exit_y; + { + y_offset = entry_y - exit_y; + child = prev_iter.pos; + parent = context->cur; + } else - context->offsets[context->cur].ascenderOffset = exit_y - entry_y; + { + y_offset = exit_y - entry_y; + child = context->cur; + parent = prev_iter.pos; + } + + opentype_reverse_cursive_offset(context, child, parent); + + context->offsets[child].ascenderOffset = y_offset; + + opentype_set_glyph_attach_type(context, child, GLYPH_ATTACH_CURSIVE); + context->glyph_infos[child].attach_chain = (int)parent - (int)child; + context->has_gpos_attachment = 1; + + if (context->glyph_infos[parent].attach_chain == -context->glyph_infos[child].attach_chain) + context->glyph_infos[parent].attach_chain = 0; context->cur++; } @@ -4153,7 +4220,6 @@ static BOOL opentype_layout_apply_mark_array(struct scriptshaping_context *conte context->offsets[context->cur].advanceOffset = mark_x - base_x; else context->offsets[context->cur].advanceOffset = -context->advances[glyph_pos] + base_x - mark_x; - context->offsets[context->cur].ascenderOffset = base_y - mark_y; context->cur++; @@ -4711,6 +4777,30 @@ static void opentype_layout_apply_gpos_context_lookup(struct scriptshaping_conte opentype_layout_apply_gpos_lookup(context, &lookup); } +static void opentype_propagate_attachment_offsets(struct scriptshaping_context *context, unsigned int i) +{ + enum attach_type type = opentype_get_glyph_attach_type(context, i); + int chain = context->glyph_infos[i].attach_chain; + unsigned int j; + + if (!chain) + return; + + context->glyph_infos[i].attach_chain = 0; + + j = (int)i + chain; + if (j >= context->glyph_count) + return; + + opentype_propagate_attachment_offsets(context, j); + + if (type == GLYPH_ATTACH_CURSIVE) + { + /* FIXME: handle vertical direction. */ + context->offsets[i].ascenderOffset += context->offsets[j].ascenderOffset; + } +} + void opentype_layout_apply_gpos_features(struct scriptshaping_context *context, unsigned int script_index, unsigned int language_index, struct shaping_features *features) { @@ -4751,6 +4841,12 @@ void opentype_layout_apply_gpos_features(struct scriptshaping_context *context, } heap_free(lookups.lookups); + + if (context->has_gpos_attachment) + { + for (i = 0; i < context->glyph_count; ++i) + opentype_propagate_attachment_offsets(context, i); + } } static void opentype_layout_replace_glyph(struct scriptshaping_context *context, UINT16 glyph)
1
0
0
0
Nikolay Sivov : dwrite: Call shaper masks setup only when doing substitutions.
by Alexandre Julliard
08 Feb '21
08 Feb '21
Module: wine Branch: master Commit: 6c639de5b8ed04c8d6db3a22ef64bd2dfa387513 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6c639de5b8ed04c8d6db3a22…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Feb 8 10:09:39 2021 +0300 dwrite: Call shaper masks setup only when doing substitutions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/opentype.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c index 0e5b8c75f62..dc5fb3f11e8 100644 --- a/dlls/dwrite/opentype.c +++ b/dlls/dwrite/opentype.c @@ -3525,6 +3525,16 @@ struct lookup unsigned int auto_zwj : 1; }; +static unsigned int opentype_layout_is_subst_context(const struct scriptshaping_context *context) +{ + return context->table == &context->cache->gsub; +} + +static unsigned int opentype_layout_is_pos_context(const struct scriptshaping_context *context) +{ + return context->table == &context->cache->gpos; +} + static unsigned int opentype_layout_get_gsubgpos_subtable(const struct scriptshaping_context *context, const struct lookup *lookup, unsigned int subtable, unsigned int *lookup_type) { @@ -3534,8 +3544,8 @@ static unsigned int opentype_layout_get_gsubgpos_subtable(const struct scriptsha subtable_offset += lookup->offset; - if ((context->table == &context->cache->gsub && lookup->type != GSUB_LOOKUP_EXTENSION_SUBST) || - (context->table == &context->cache->gpos && lookup->type != GPOS_LOOKUP_EXTENSION_POSITION)) + if ((opentype_layout_is_subst_context(context) && lookup->type != GSUB_LOOKUP_EXTENSION_SUBST) || + (opentype_layout_is_pos_context(context) && lookup->type != GPOS_LOOKUP_EXTENSION_POSITION)) { *lookup_type = lookup->type; return subtable_offset; @@ -3616,7 +3626,7 @@ static void glyph_iterator_init(struct scriptshaping_context *context, unsigned iter->match_data = NULL; iter->glyph_data = NULL; /* Context matching iterators will get these fixed up. */ - iter->ignore_zwnj = context->table == &context->cache->gpos; + iter->ignore_zwnj = !!opentype_layout_is_pos_context(context); iter->ignore_zwj = context->auto_zwj; } @@ -4663,7 +4673,7 @@ static void opentype_layout_set_glyph_masks(struct scriptshaping_context *contex for (g = 0; g < context->glyph_count; ++g) context->glyph_infos[g].mask = context->global_mask; - if (context->shaper->setup_masks) + if (opentype_layout_is_subst_context(context) && context->shaper->setup_masks) context->shaper->setup_masks(context, features); for (r = 0, start_char = 0; r < context->user_features.range_count; ++r) @@ -6154,7 +6164,7 @@ BOOL opentype_layout_check_feature(struct scriptshaping_context *context, unsign opentype_layout_collect_lookups(context, script_index, language_index, &features, context->table, &lookups); - func_is_covered = context->table == &context->cache->gsub ? opentype_layout_gsub_lookup_is_glyph_covered : + func_is_covered = opentype_layout_is_subst_context(context) ? opentype_layout_gsub_lookup_is_glyph_covered : opentype_layout_gpos_lookup_is_glyph_covered; for (i = 0; i < lookups.count; ++i)
1
0
0
0
← Newer
1
...
65
66
67
68
69
70
71
...
92
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Results per page:
10
25
50
100
200