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
February 2009
----- 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
965 discussions
Start a n
N
ew thread
Andrew Nguyen : tapi32: Stub lineAddProviderW.
by Alexandre Julliard
23 Feb '09
23 Feb '09
Module: wine Branch: master Commit: 1f5c71fa485767a8dcd8f7a795c644f36543e925 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1f5c71fa485767a8dcd8f7a79…
Author: Andrew Nguyen <arethusa26(a)gmail.com> Date: Mon Feb 23 04:25:10 2009 -0600 tapi32: Stub lineAddProviderW. --- dlls/tapi32/line.c | 13 +++++++++++-- dlls/tapi32/tapi32.spec | 1 + include/tapi.h | 5 +++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/dlls/tapi32/line.c b/dlls/tapi32/line.c index 692e37f..7ff1221 100644 --- a/dlls/tapi32/line.c +++ b/dlls/tapi32/line.c @@ -53,12 +53,21 @@ DWORD WINAPI lineAccept(HCALL hCall, LPCSTR lpsUserUserInfo, DWORD dwSize) } /*********************************************************************** - * lineAddProvider (TAPI32.@) + * lineAddProviderA (TAPI32.@) */ DWORD WINAPI lineAddProviderA(LPCSTR lpszProviderName, HWND hwndOwner, LPDWORD lpdwPermanentProviderID) { FIXME("(%s, %p, %p): stub.\n", lpszProviderName, hwndOwner, lpdwPermanentProviderID); - return 1; + return LINEERR_OPERATIONFAILED; +} + +/*********************************************************************** + * lineAddProviderW (TAPI32.@) + */ +DWORD WINAPI lineAddProviderW(LPCWSTR lpszProviderName, HWND hwndOwner, LPDWORD lpdwPermanentProviderID) +{ + FIXME("(%s, %p, %p): stub.\n", wine_dbgstr_w(lpszProviderName), hwndOwner, lpdwPermanentProviderID); + return LINEERR_OPERATIONFAILED; } /*********************************************************************** diff --git a/dlls/tapi32/tapi32.spec b/dlls/tapi32/tapi32.spec index 440456d..d4faaff 100644 --- a/dlls/tapi32/tapi32.spec +++ b/dlls/tapi32/tapi32.spec @@ -1,6 +1,7 @@ @ stdcall lineAccept(long str long) @ stdcall lineAddProvider(str long ptr) lineAddProviderA @ stdcall lineAddProviderA(str long ptr) +@ stdcall lineAddProviderW(wstr long ptr) @ stdcall lineAddToConference(long long) @ stdcall lineAnswer(long str long) @ stdcall lineBlindTransfer(long str long) lineBlindTransferA diff --git a/include/tapi.h b/include/tapi.h index 9a8cd04..fdb5e9f 100644 --- a/include/tapi.h +++ b/include/tapi.h @@ -859,7 +859,9 @@ typedef struct varstring_tag { /* line functions */ DWORD WINAPI lineAccept(HCALL,LPCSTR,DWORD); -DWORD WINAPI lineAddProvider(LPCSTR,HWND,LPDWORD); +DWORD WINAPI lineAddProviderA(LPCSTR,HWND,LPDWORD); +DWORD WINAPI lineAddProviderW(LPCWSTR,HWND,LPDWORD); +#define lineAddProvider WINELIB_NAME_AW(lineAddProvider) DWORD WINAPI lineAddToConference(HCALL,HCALL); DWORD WINAPI lineAnswer(HCALL,LPCSTR,DWORD); DWORD WINAPI lineBlindTransfer(HCALL,LPCSTR,DWORD); @@ -944,7 +946,6 @@ DWORD WINAPI lineUncompleteCall(HLINE,DWORD); DWORD WINAPI lineUnHold(HCALL); DWORD WINAPI lineUnpark(HLINE,DWORD,LPHCALL,LPCSTR); -DWORD WINAPI lineAddProviderA(LPCSTR,HWND,LPDWORD); DWORD WINAPI lineBlindTransferA(HCALL,LPCSTR,DWORD); DWORD WINAPI lineConfigDialogA(DWORD,HWND,LPCSTR); DWORD WINAPI lineConfigDialogEditA(DWORD,HWND,LPCSTR,LPVOID const,DWORD,LPVARSTRING);
1
0
0
0
Andrew Nguyen : tapi32: Stub lineGetProviderListW.
by Alexandre Julliard
23 Feb '09
23 Feb '09
Module: wine Branch: master Commit: f5fc2ca4c50c784379072a90719ae70ecb89db75 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f5fc2ca4c50c784379072a907…
Author: Andrew Nguyen <arethusa26(a)gmail.com> Date: Mon Feb 23 04:25:01 2009 -0600 tapi32: Stub lineGetProviderListW. --- dlls/tapi32/line.c | 13 +++++++++++-- dlls/tapi32/tapi32.spec | 1 + include/tapi.h | 5 +++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/dlls/tapi32/line.c b/dlls/tapi32/line.c index 214e504..692e37f 100644 --- a/dlls/tapi32/line.c +++ b/dlls/tapi32/line.c @@ -520,12 +520,21 @@ DWORD WINAPI lineGetNumRings(HLINE hLine, DWORD dwAddressID, LPDWORD lpdwNumRing } /*********************************************************************** - * lineGetProviderList (TAPI32.@) + * lineGetProviderListA (TAPI32.@) */ DWORD WINAPI lineGetProviderListA(DWORD dwAPIVersion, LPLINEPROVIDERLIST lpProviderList) { FIXME("(%08x, %p): stub.\n", dwAPIVersion, lpProviderList); - return 0; + return LINEERR_OPERATIONFAILED; +} + +/*********************************************************************** + * lineGetProviderListW (TAPI32.@) + */ +DWORD WINAPI lineGetProviderListW(DWORD dwAPIVersion, LPLINEPROVIDERLIST lpProviderList) +{ + FIXME("(%08x, %p): stub.\n", dwAPIVersion, lpProviderList); + return LINEERR_OPERATIONFAILED; } /*********************************************************************** diff --git a/dlls/tapi32/tapi32.spec b/dlls/tapi32/tapi32.spec index 87266ce..440456d 100644 --- a/dlls/tapi32/tapi32.spec +++ b/dlls/tapi32/tapi32.spec @@ -54,6 +54,7 @@ @ stdcall lineGetNumRings(long long ptr) @ stdcall lineGetProviderList(long ptr) lineGetProviderListA @ stdcall lineGetProviderListA(long ptr) +@ stdcall lineGetProviderListW(long ptr) @ stdcall lineGetRequest(long long ptr) lineGetRequestA @ stdcall lineGetRequestA(long long ptr) @ stdcall lineGetStatusMessages(long ptr ptr) diff --git a/include/tapi.h b/include/tapi.h index 851317f..9a8cd04 100644 --- a/include/tapi.h +++ b/include/tapi.h @@ -893,7 +893,9 @@ DWORD WINAPI lineGetIcon(DWORD,LPCSTR,HICON *); DWORD WINAPI lineGetLineDevStatus(HLINE,LPLINEDEVSTATUS); DWORD WINAPI lineGetNewCalls(HLINE,DWORD,DWORD,LPLINECALLLIST); DWORD WINAPI lineGetNumRings(HLINE,DWORD,LPDWORD); -DWORD WINAPI lineGetProviderList(DWORD dwAPIVersion,LPLINEPROVIDERLIST); +DWORD WINAPI lineGetProviderListA(DWORD,LPLINEPROVIDERLIST); +DWORD WINAPI lineGetProviderListW(DWORD,LPLINEPROVIDERLIST); +#define lineGetProviderList WINELIB_NAME_AW(lineGetProviderList) DWORD WINAPI lineGetRequest(HLINEAPP,DWORD,LPVOID); DWORD WINAPI lineGetStatusMessages(HLINE,LPDWORD,LPDWORD); DWORD WINAPI lineGetTranslateCaps(HLINEAPP,DWORD,LPLINETRANSLATECAPS); @@ -961,7 +963,6 @@ DWORD WINAPI lineGetDevConfigA(DWORD,LPVARSTRING,LPCSTR); DWORD WINAPI lineGetIDA(HLINE,DWORD,HCALL,DWORD,LPVARSTRING,LPCSTR); DWORD WINAPI lineGetIconA(DWORD,LPCSTR,HICON *); DWORD WINAPI lineGetLineDevStatusA(HLINE,LPLINEDEVSTATUS); -DWORD WINAPI lineGetProviderListA(DWORD dwAPIVersion,LPLINEPROVIDERLIST); DWORD WINAPI lineGetRequestA(HLINEAPP,DWORD,LPVOID); DWORD WINAPI lineGetTranslateCapsA(HLINEAPP,DWORD,LPLINETRANSLATECAPS); DWORD WINAPI lineHandoffA(HCALL,LPCSTR,DWORD);
1
0
0
0
Rob Shearman : widl: Add typegen_detect_type and use it.
by Alexandre Julliard
23 Feb '09
23 Feb '09
Module: wine Branch: master Commit: 2c6e611c8a4ad5649c8125e23c35a565c36ee2b8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2c6e611c8a4ad5649c8125e23…
Author: Rob Shearman <robertshearman(a)gmail.com> Date: Mon Feb 23 13:48:46 2009 +0000 widl: Add typegen_detect_type and use it. Add typegen_detect_type for detecting types useful during client/server/proxy code generation. --- tools/widl/parser.y | 117 ++++++---- tools/widl/proxy.c | 54 +++--- tools/widl/typegen.c | 582 ++++++++++++++++++++++++++----------------------- tools/widl/typegen.h | 23 ++ 4 files changed, 430 insertions(+), 346 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=2c6e611c8a4ad5649c812…
1
0
0
0
Rob Shearman : widl: Use type_get_type to determine the types of types during C client, server and proxy code generation.
by Alexandre Julliard
23 Feb '09
23 Feb '09
Module: wine Branch: master Commit: af0800729b84c90e067bcab058521b4cb9aee8e3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=af0800729b84c90e067bcab05…
Author: Rob Shearman <robertshearman(a)gmail.com> Date: Mon Feb 23 13:48:34 2009 +0000 widl: Use type_get_type to determine the types of types during C client, server and proxy code generation. --- tools/widl/proxy.c | 75 +-- tools/widl/typegen.c | 1309 ++++++++++++++++++++++++++++---------------------- tools/widl/typegen.h | 2 + 3 files changed, 772 insertions(+), 614 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=af0800729b84c90e067bc…
1
0
0
0
Rob Shearman : widl: Use type_get_type to determine the types of types during typelib generation .
by Alexandre Julliard
23 Feb '09
23 Feb '09
Module: wine Branch: master Commit: 28a2c06cf7a32dee66000b15a334c3366c77ae35 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=28a2c06cf7a32dee66000b15a…
Author: Rob Shearman <robertshearman(a)gmail.com> Date: Mon Feb 23 13:48:21 2009 +0000 widl: Use type_get_type to determine the types of types during typelib generation. --- tools/widl/typelib.c | 129 ++++++++++++++++++++++++---------------------- tools/widl/write_msft.c | 64 +++++++---------------- 2 files changed, 87 insertions(+), 106 deletions(-) diff --git a/tools/widl/typelib.c b/tools/widl/typelib.c index 047a179..d6a2e2e 100644 --- a/tools/widl/typelib.c +++ b/tools/widl/typelib.c @@ -109,17 +109,20 @@ static unsigned short builtin_vt(const type_t *t) } if (is_string_type (t->attrs, t)) { - unsigned char fc; + const type_t *elem_type; if (is_array(t)) - fc = type_array_get_element(t)->type; + elem_type = type_array_get_element(t); else - fc = type_pointer_get_ref(t)->type; - switch (fc) + elem_type = type_pointer_get_ref(t); + if (type_get_type(elem_type) == TYPE_BASIC) + { + switch (type_basic_get_fc(elem_type)) { case RPC_FC_CHAR: return VT_LPSTR; case RPC_FC_WCHAR: return VT_LPWSTR; default: break; } + } } return 0; } @@ -143,74 +146,76 @@ unsigned short get_type_vt(type_t *t) if (type_is_alias(t) && is_attr(t->attrs, ATTR_PUBLIC)) return VT_USERDEFINED; - switch (t->type) { - case RPC_FC_BYTE: - case RPC_FC_USMALL: - return VT_UI1; - case RPC_FC_CHAR: - case RPC_FC_SMALL: - return VT_I1; - case RPC_FC_WCHAR: - return VT_I2; /* mktyplib seems to parse wchar_t as short */ - case RPC_FC_SHORT: - return VT_I2; - case RPC_FC_USHORT: - return VT_UI2; - case RPC_FC_LONG: - if (match(t->name, "int")) return VT_INT; - return VT_I4; - case RPC_FC_ULONG: - if (match(t->name, "int")) return VT_UINT; - return VT_UI4; - case RPC_FC_HYPER: - if (t->sign < 0) return VT_UI8; - if (match(t->name, "MIDL_uhyper")) return VT_UI8; - return VT_I8; - case RPC_FC_FLOAT: - return VT_R4; - case RPC_FC_DOUBLE: - return VT_R8; - case RPC_FC_RP: - case RPC_FC_UP: - case RPC_FC_OP: - case RPC_FC_FP: - case RPC_FC_SMFARRAY: - case RPC_FC_LGFARRAY: - case RPC_FC_SMVARRAY: - case RPC_FC_LGVARRAY: - case RPC_FC_CARRAY: - case RPC_FC_CVARRAY: - case RPC_FC_BOGUS_ARRAY: - if(t->ref) - { - if (match(t->ref->name, "SAFEARRAY")) - return VT_SAFEARRAY; - return VT_PTR; + switch (type_get_type(t)) { + case TYPE_BASIC: + switch (type_basic_get_fc(t)) { + case RPC_FC_BYTE: + case RPC_FC_USMALL: + return VT_UI1; + case RPC_FC_CHAR: + case RPC_FC_SMALL: + return VT_I1; + case RPC_FC_WCHAR: + return VT_I2; /* mktyplib seems to parse wchar_t as short */ + case RPC_FC_SHORT: + return VT_I2; + case RPC_FC_USHORT: + return VT_UI2; + case RPC_FC_LONG: + if (match(t->name, "int")) return VT_INT; + return VT_I4; + case RPC_FC_ULONG: + if (match(t->name, "int")) return VT_UINT; + return VT_UI4; + case RPC_FC_HYPER: + if (t->sign < 0) return VT_UI8; + if (match(t->name, "MIDL_uhyper")) return VT_UI8; + return VT_I8; + case RPC_FC_FLOAT: + return VT_R4; + case RPC_FC_DOUBLE: + return VT_R8; + default: + error("get_type_vt: unknown basic type: 0x%02x\n", type_basic_get_fc(t)); } - - error("get_type_vt: unknown-deref-type: %d\n", t->ref->type); break; - case RPC_FC_IP: + + case TYPE_POINTER: + if (match(type_pointer_get_ref(t)->name, "SAFEARRAY")) + return VT_SAFEARRAY; + return VT_PTR; + + case TYPE_ARRAY: + if (t->declarray) + error("get_type_vt: array types not supported\n"); + return VT_PTR; + + case TYPE_INTERFACE: if(match(t->name, "IUnknown")) return VT_UNKNOWN; if(match(t->name, "IDispatch")) return VT_DISPATCH; return VT_USERDEFINED; - case RPC_FC_ENUM16: - case RPC_FC_STRUCT: - case RPC_FC_PSTRUCT: - case RPC_FC_CSTRUCT: - case RPC_FC_CPSTRUCT: - case RPC_FC_CVSTRUCT: - case RPC_FC_BOGUS_STRUCT: - case RPC_FC_COCLASS: - case RPC_FC_MODULE: + case TYPE_ENUM: + case TYPE_STRUCT: + case TYPE_COCLASS: + case TYPE_MODULE: + case TYPE_UNION: + case TYPE_ENCAPSULATED_UNION: return VT_USERDEFINED; - case 0: + + case TYPE_VOID: return VT_VOID; - default: - error("get_type_vt: unknown type: 0x%02x\n", t->type); + + case TYPE_ALIAS: + /* aliases should be filtered out by the type_get_type call above */ + assert(0); + break; + + case TYPE_FUNCTION: + error("get_type_vt: functions not supported\n"); + break; } return 0; } diff --git a/tools/widl/write_msft.c b/tools/widl/write_msft.c index 107d0bf..a92325a 100644 --- a/tools/widl/write_msft.c +++ b/tools/widl/write_msft.c @@ -983,34 +983,27 @@ static int encode_type( while (type->typelib_idx < 0 && type_is_alias(type) && !is_attr(type->attrs, ATTR_PUBLIC)) type = type_alias_get_aliasee(type); - chat("encode_type: VT_USERDEFINED - type %p name = %s type->type %d idx %d\n", type, - type->name, type->type, type->typelib_idx); + chat("encode_type: VT_USERDEFINED - type %p name = %s real type %d idx %d\n", type, + type->name, type_get_type(type), type->typelib_idx); if(type->typelib_idx == -1) { chat("encode_type: trying to ref not added type\n"); - switch(type->type) { - case RPC_FC_STRUCT: - case RPC_FC_PSTRUCT: - case RPC_FC_CSTRUCT: - case RPC_FC_CPSTRUCT: - case RPC_FC_CVSTRUCT: - case RPC_FC_BOGUS_STRUCT: + switch (type_get_type(type)) { + case TYPE_STRUCT: add_structure_typeinfo(typelib, type); break; - case RPC_FC_IP: + case TYPE_INTERFACE: add_interface_typeinfo(typelib, type); break; - case RPC_FC_ENUM16: + case TYPE_ENUM: add_enum_typeinfo(typelib, type); break; - case RPC_FC_COCLASS: + case TYPE_COCLASS: add_coclass_typeinfo(typelib, type); break; - case 0: - error("encode_type: VT_USERDEFINED - can't yet add typedef's on the fly\n"); - break; default: - error("encode_type: VT_USERDEFINED - unhandled type %d\n", type->type); + error("encode_type: VT_USERDEFINED - unhandled type %d\n", + type_get_type(type)); } } @@ -1047,7 +1040,7 @@ static int encode_type( static void dump_type(type_t *t) { - chat("dump_type: %p name %s type %d ref %p attrs %p\n", t, t->name, t->type, t->ref, t->attrs); + chat("dump_type: %p name %s type %d ref %p attrs %p\n", t, t->name, type_get_type(t), t->ref, t->attrs); if(t->ref) dump_type(t->ref); } @@ -1482,7 +1475,7 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, var_t *func, int index) { int vt; expr_t *expr = (expr_t *)attr->u.pval; - if (arg->type->type == RPC_FC_ENUM16) + if (type_get_type(arg->type) == TYPE_ENUM) vt = VT_INT; else vt = get_type_vt(arg->type); @@ -2211,42 +2204,25 @@ static void add_module_typeinfo(msft_typelib_t *typelib, type_t *module) static void add_type_typeinfo(msft_typelib_t *typelib, type_t *type) { - switch (type->type) { - case RPC_FC_IP: + switch (type_get_type(type)) { + case TYPE_INTERFACE: add_interface_typeinfo(typelib, type); break; - case RPC_FC_STRUCT: + case TYPE_STRUCT: add_structure_typeinfo(typelib, type); break; - case RPC_FC_ENUM16: - case RPC_FC_ENUM32: + case TYPE_ENUM: add_enum_typeinfo(typelib, type); break; - case RPC_FC_COCLASS: + case TYPE_COCLASS: add_coclass_typeinfo(typelib, type); break; - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_USMALL: - case RPC_FC_SMALL: - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: - case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_HYPER: - case RPC_FC_IGNORE: - case RPC_FC_FLOAT: - case RPC_FC_DOUBLE: - case RPC_FC_ERROR_STATUS_T: - case RPC_FC_BIND_PRIMITIVE: - case RPC_FC_RP: - case RPC_FC_UP: - case RPC_FC_OP: - case RPC_FC_FP: + case TYPE_BASIC: + case TYPE_POINTER: break; default: - error("add_entry: unhandled type 0x%x for %s\n", type->type, type->name); + error("add_entry: unhandled type 0x%x for %s\n", + type_get_type(type), type->name); break; } }
1
0
0
0
Rob Shearman : widl: Use type_get_type to determine the types of types during parsing and checking .
by Alexandre Julliard
23 Feb '09
23 Feb '09
Module: wine Branch: master Commit: 0f7f7922bab15131bf72fc9e18e3cdb213f6c65f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0f7f7922bab15131bf72fc9e1…
Author: Rob Shearman <robertshearman(a)gmail.com> Date: Mon Feb 23 13:48:15 2009 +0000 widl: Use type_get_type to determine the types of types during parsing and checking. --- tools/widl/parser.y | 113 ++++++++++++++++++++++++++++++++---------------- tools/widl/typetree.c | 16 +++++++ tools/widl/typetree.h | 1 + 3 files changed, 92 insertions(+), 38 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=0f7f7922bab15131bf72f…
1
0
0
0
Rob Shearman : widl: Use type_get_type to determine the types of types during header writing.
by Alexandre Julliard
23 Feb '09
23 Feb '09
Module: wine Branch: master Commit: d854f322832c5c841db7ee44031bffbf5abb157f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d854f322832c5c841db7ee440…
Author: Rob Shearman <robertshearman(a)gmail.com> Date: Mon Feb 23 13:48:11 2009 +0000 widl: Use type_get_type to determine the types of types during header writing. --- tools/widl/header.c | 80 +++++++++++++++++++++++++++++++------------------- 1 files changed, 49 insertions(+), 31 deletions(-) diff --git a/tools/widl/header.c b/tools/widl/header.c index 031e7dd..4a8929f 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -197,15 +197,8 @@ void write_type_left(FILE *h, type_t *t, int declonly) if (type_is_alias(t)) fprintf(h, "%s", t->name); else if (t->declarray) write_type_left(h, type_array_get_element(t), declonly); else { - if (t->sign > 0) fprintf(h, "signed "); - else if (t->sign < 0) fprintf(h, "unsigned "); - - if (is_array(t) && !t->name) { - write_type_left(h, type_array_get_element(t), declonly); - fprintf(h, "%s*", needs_space_after(type_array_get_element(t)) ? " " : ""); - } else switch (t->type) { - case RPC_FC_ENUM16: - case RPC_FC_ENUM32: + switch (type_get_type_detect_alias(t)) { + case TYPE_ENUM: if (!declonly && t->defined && !t->written) { if (t->name) fprintf(h, "enum %s {\n", t->name); else fprintf(h, "enum {\n"); @@ -217,19 +210,14 @@ void write_type_left(FILE *h, type_t *t, int declonly) } else fprintf(h, "enum %s", t->name ? t->name : ""); break; - case RPC_FC_STRUCT: - case RPC_FC_CVSTRUCT: - case RPC_FC_CPSTRUCT: - case RPC_FC_CSTRUCT: - case RPC_FC_PSTRUCT: - case RPC_FC_BOGUS_STRUCT: - case RPC_FC_ENCAPSULATED_UNION: + case TYPE_STRUCT: + case TYPE_ENCAPSULATED_UNION: if (!declonly && t->defined && !t->written) { if (t->name) fprintf(h, "struct %s {\n", t->name); else fprintf(h, "struct {\n"); t->written = TRUE; indentation++; - if (t->type == RPC_FC_ENCAPSULATED_UNION) + if (type_get_type(t) != TYPE_STRUCT) write_fields(h, type_encapsulated_union_get_fields(t)); else write_fields(h, type_struct_get_fields(t)); @@ -238,7 +226,7 @@ void write_type_left(FILE *h, type_t *t, int declonly) } else fprintf(h, "struct %s", t->name ? t->name : ""); break; - case RPC_FC_NON_ENCAPSULATED_UNION: + case TYPE_UNION: if (!declonly && t->defined && !t->written) { if (t->name) fprintf(h, "union %s {\n", t->name); else fprintf(h, "union {\n"); @@ -250,16 +238,35 @@ void write_type_left(FILE *h, type_t *t, int declonly) } else fprintf(h, "union %s", t->name ? t->name : ""); break; - case RPC_FC_RP: - case RPC_FC_UP: - case RPC_FC_FP: - case RPC_FC_OP: + case TYPE_POINTER: write_type_left(h, type_pointer_get_ref(t), declonly); fprintf(h, "%s*", needs_space_after(type_pointer_get_ref(t)) ? " " : ""); if (is_attr(t->attrs, ATTR_CONST)) fprintf(h, "const "); break; - default: + case TYPE_ARRAY: + if (t->name) + fprintf(h, "%s", t->name); + else + { + write_type_left(h, type_array_get_element(t), declonly); + fprintf(h, "%s*", needs_space_after(type_array_get_element(t)) ? " " : ""); + } + break; + case TYPE_BASIC: + if (t->sign > 0) fprintf(h, "signed "); + else if (t->sign < 0) fprintf(h, "unsigned "); + /* fall through */ + case TYPE_INTERFACE: + case TYPE_MODULE: + case TYPE_COCLASS: + case TYPE_VOID: fprintf(h, "%s", t->name); + break; + case TYPE_ALIAS: + case TYPE_FUNCTION: + /* handled elsewhere */ + assert(0); + break; } } } @@ -288,7 +295,7 @@ static void write_type_v(FILE *h, type_t *t, int is_field, int declonly, const c for (pt = t; is_ptr(pt); pt = type_pointer_get_ref(pt), ptr_level++) ; - if (pt->type == RPC_FC_FUNCTION) { + if (type_get_type_detect_alias(pt) == TYPE_FUNCTION) { int i; const char *callconv = get_attrp(pt->attrs, ATTR_CALLCONV); if (!callconv) callconv = ""; @@ -304,7 +311,7 @@ static void write_type_v(FILE *h, type_t *t, int is_field, int declonly, const c if (name) fprintf(h, "%s%s", needs_space_after(t) ? " " : "", name ); - if (pt->type == RPC_FC_FUNCTION) { + if (type_get_type_detect_alias(pt) == TYPE_FUNCTION) { if (ptr_level) fputc(')', h); fputc('(', h); write_args(h, type_function_get_args(pt), NULL, 0, FALSE); @@ -380,7 +387,9 @@ void check_for_additional_prototype_types(const var_list_t *list) /* don't carry on parsing fields within this type */ break; } - if (type->type != RPC_FC_BIND_PRIMITIVE && is_attr(type->attrs, ATTR_HANDLE)) { + if ((type_get_type(type) != TYPE_BASIC || + type_basic_get_fc(type) != RPC_FC_BIND_PRIMITIVE) && + is_attr(type->attrs, ATTR_HANDLE)) { if (!generic_handle_registered(name)) { generic_handle_t *gh = xmalloc(sizeof(*gh)); @@ -403,13 +412,22 @@ void check_for_additional_prototype_types(const var_list_t *list) } else if (type_is_complete(type)) { - var_list_t *vars = NULL; - if (type->type == RPC_FC_ENUM16 || type->type == RPC_FC_ENUM32) + var_list_t *vars; + switch (type_get_type_detect_alias(type)) + { + case TYPE_ENUM: vars = type_enum_get_values(type); - else if (is_struct(type->type)) + break; + case TYPE_STRUCT: vars = type_struct_get_fields(type); - else if (is_union(type->type)) + break; + case TYPE_UNION: vars = type_union_get_cases(type); + break; + default: + vars = NULL; + break; + } check_for_additional_prototype_types(vars); } @@ -791,7 +809,7 @@ static void write_locals(FILE *fp, const type_t *iface, int body) fprintf(fp, " %s\n", comment); if (rt->name && strcmp(rt->name, "HRESULT") == 0) fprintf(fp, " return E_NOTIMPL;\n"); - else if (rt->type) { + else if (type_get_type(rt) != TYPE_VOID) { fprintf(fp, " "); write_type_decl(fp, rt, "rv"); fprintf(fp, ";\n");
1
0
0
0
Rob Shearman : widl: Use type_get_type to determine the types during statement enumeration.
by Alexandre Julliard
23 Feb '09
23 Feb '09
Module: wine Branch: master Commit: fb934347b44c9a16c897c09042bbb871265e2d93 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fb934347b44c9a16c897c0904…
Author: Rob Shearman <robertshearman(a)gmail.com> Date: Mon Feb 23 13:48:05 2009 +0000 widl: Use type_get_type to determine the types during statement enumeration. --- tools/widl/client.c | 2 +- tools/widl/header.c | 16 ++++++++-------- tools/widl/parser.y | 4 ++-- tools/widl/proxy.c | 6 +++--- tools/widl/server.c | 2 +- tools/widl/typegen.c | 6 +++--- tools/widl/widl.c | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tools/widl/client.c b/tools/widl/client.c index 559d8c8..b683a14 100644 --- a/tools/widl/client.c +++ b/tools/widl/client.c @@ -469,7 +469,7 @@ static void write_client_ifaces(const statement_list_t *stmts, int expr_eval_rou const statement_t *stmt; if (stmts) LIST_FOR_EACH_ENTRY( stmt, stmts, const statement_t, entry ) { - if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP) + if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE) { int has_func = 0; const statement_t *stmt2; diff --git a/tools/widl/header.c b/tools/widl/header.c index f86d2b0..031e7dd 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -824,7 +824,7 @@ static void write_local_stubs_stmts(FILE *local_stubs, const statement_list_t *s const statement_t *stmt; if (stmts) LIST_FOR_EACH_ENTRY( stmt, stmts, const statement_t, entry ) { - if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP) + if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE) write_locals(local_stubs, stmt->u.type, TRUE); else if (stmt->type == STMT_LIBRARY) write_local_stubs_stmts(local_stubs, stmt->u.lib->stmts); @@ -1047,7 +1047,7 @@ static void write_imports(FILE *header, const statement_list_t *stmts) switch (stmt->type) { case STMT_TYPE: - if (stmt->u.type->type == RPC_FC_IP) + if (type_get_type(stmt->u.type) == TYPE_INTERFACE) write_imports(header, type_iface_get_stmts(stmt->u.type)); break; case STMT_TYPEREF: @@ -1078,12 +1078,12 @@ static void write_forward_decls(FILE *header, const statement_list_t *stmts) switch (stmt->type) { case STMT_TYPE: - if (stmt->u.type->type == RPC_FC_IP) + if (type_get_type(stmt->u.type) == TYPE_INTERFACE) { if (is_object(stmt->u.type->attrs) || is_attr(stmt->u.type->attrs, ATTR_DISPINTERFACE)) write_forward(header, stmt->u.type); } - else if (stmt->u.type->type == RPC_FC_COCLASS) + else if (type_get_type(stmt->u.type) == TYPE_COCLASS) write_coclass_forward(header, stmt->u.type); break; case STMT_TYPEREF: @@ -1112,7 +1112,7 @@ static void write_header_stmts(FILE *header, const statement_list_t *stmts, cons switch (stmt->type) { case STMT_TYPE: - if (stmt->u.type->type == RPC_FC_IP) + if (type_get_type(stmt->u.type) == TYPE_INTERFACE) { type_t *iface = stmt->u.type; if (is_attr(stmt->u.type->attrs, ATTR_DISPINTERFACE) || is_object(stmt->u.type->attrs)) @@ -1128,7 +1128,7 @@ static void write_header_stmts(FILE *header, const statement_list_t *stmts, cons write_rpc_interface_end(header, iface); } } - else if (stmt->u.type->type == RPC_FC_COCLASS) + else if (type_get_type(stmt->u.type) == TYPE_COCLASS) write_coclass(header, stmt->u.type); else { @@ -1139,7 +1139,7 @@ static void write_header_stmts(FILE *header, const statement_list_t *stmts, cons case STMT_TYPEREF: /* FIXME: shouldn't write out forward declarations for undefined * interfaces but a number of our IDL files depend on this */ - if (stmt->u.type->type == RPC_FC_IP && !stmt->u.type->written) + if (type_get_type(stmt->u.type) == TYPE_INTERFACE && !stmt->u.type->written) write_forward(header, stmt->u.type); break; case STMT_IMPORTLIB: @@ -1164,7 +1164,7 @@ static void write_header_stmts(FILE *header, const statement_list_t *stmts, cons fprintf(header, "%s\n", stmt->u.str); break; case STMT_DECLARATION: - if (iface && stmt->u.var->type->type == RPC_FC_FUNCTION) + if (iface && type_get_type(stmt->u.var->type) == TYPE_FUNCTION) { if (!ignore_funcs) { diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 168f555..ee9e465 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -2533,7 +2533,7 @@ static void check_statements(const statement_list_t *stmts, int is_inside_librar { if (stmt->type == STMT_LIBRARY) check_statements(stmt->u.lib->stmts, TRUE); - else if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP) + else if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE) check_functions(stmt->u.type, is_inside_library); } } @@ -2546,7 +2546,7 @@ static void check_all_user_types(const statement_list_t *stmts) { if (stmt->type == STMT_LIBRARY) check_all_user_types(stmt->u.lib->stmts); - else if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP && + else if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE && !is_local(stmt->u.type->attrs)) { const statement_t *stmt_func; diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c index 615b2a1..d4f5c03 100644 --- a/tools/widl/proxy.c +++ b/tools/widl/proxy.c @@ -709,7 +709,7 @@ static int does_any_iface(const statement_list_t *stmts, type_pred_t pred) if (does_any_iface(stmt->u.lib->stmts, pred)) return TRUE; } - else if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP) + else if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE) { if (pred(stmt->u.type)) return TRUE; @@ -746,7 +746,7 @@ static void write_proxy_stmts(const statement_list_t *stmts, unsigned int *proc_ { if (stmt->type == STMT_LIBRARY) write_proxy_stmts(stmt->u.lib->stmts, proc_offset); - else if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP) + else if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE) { if (need_proxy(stmt->u.type)) write_proxy(stmt->u.type, proc_offset); @@ -772,7 +772,7 @@ static void build_iface_list( const statement_list_t *stmts, type_t **ifaces[], { if (stmt->type == STMT_LIBRARY) build_iface_list(stmt->u.lib->stmts, ifaces, count); - else if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP) + else if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE) { type_t *iface = stmt->u.type; if (type_iface_get_inherit(iface) && need_proxy(iface)) diff --git a/tools/widl/server.c b/tools/widl/server.c index ff61a8a..6f79cdb 100644 --- a/tools/widl/server.c +++ b/tools/widl/server.c @@ -407,7 +407,7 @@ static void write_server_stmts(const statement_list_t *stmts, int expr_eval_rout { if (stmt->type == STMT_LIBRARY) write_server_stmts(stmt->u.lib->stmts, expr_eval_routines, proc_offset); - else if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP) + else if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE) { type_t *iface = stmt->u.type; if (!need_stub(iface)) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 6e55d11..de9cd67 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -724,7 +724,7 @@ static void write_procformatstring_stmts(FILE *file, int indent, const statement const statement_t *stmt; if (stmts) LIST_FOR_EACH_ENTRY( stmt, stmts, const statement_t, entry ) { - if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP) + if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE) { const statement_t *stmt_func; if (!pred(stmt->u.type)) @@ -2655,7 +2655,7 @@ static unsigned int process_tfs_stmts(FILE *file, const statement_list_t *stmts, process_tfs_stmts(file, stmt->u.lib->stmts, pred, typeformat_offset); continue; } - else if (stmt->type != STMT_TYPE || stmt->u.type->type != RPC_FC_IP) + else if (stmt->type != STMT_TYPE || type_get_type(stmt->u.type) != TYPE_INTERFACE) continue; iface = stmt->u.type; @@ -3420,7 +3420,7 @@ unsigned int get_size_procformatstring(const statement_list_t *stmts, type_pred_ size += get_size_procformatstring(stmt->u.lib->stmts, pred) - 1; continue; } - else if (stmt->type != STMT_TYPE || stmt->u.type->type != RPC_FC_IP) + else if (stmt->type != STMT_TYPE || type_get_type(stmt->u.type) != TYPE_INTERFACE) continue; iface = stmt->u.type; diff --git a/tools/widl/widl.c b/tools/widl/widl.c index ab15726..62b7ff5 100644 --- a/tools/widl/widl.c +++ b/tools/widl/widl.c @@ -349,7 +349,7 @@ static void write_id_data_stmts(const statement_list_t *stmts) if (stmt->type == STMT_TYPE) { const type_t *type = stmt->u.type; - if (type->type == RPC_FC_IP) + if (type_get_type(type) == TYPE_INTERFACE) { const UUID *uuid; if (!is_object(type->attrs) && !is_attr(type->attrs, ATTR_DISPINTERFACE)) @@ -358,7 +358,7 @@ static void write_id_data_stmts(const statement_list_t *stmts) write_guid(idfile, is_attr(type->attrs, ATTR_DISPINTERFACE) ? "DIID" : "IID", type->name, uuid); } - else if (type->type == RPC_FC_COCLASS) + else if (type_get_type(type) == TYPE_COCLASS) { const UUID *uuid = get_attrp(type->attrs, ATTR_UUID); write_guid(idfile, "CLSID", type->name, uuid);
1
0
0
0
Rob Shearman : widl: Don' t directly access the type structure when determining the types in expressions .
by Alexandre Julliard
23 Feb '09
23 Feb '09
Module: wine Branch: master Commit: ba91ee607c1b852deb584c3502094be1adef658e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ba91ee607c1b852deb584c350…
Author: Rob Shearman <robertshearman(a)gmail.com> Date: Mon Feb 23 13:47:57 2009 +0000 widl: Don't directly access the type structure when determining the types in expressions. Use type_get_type and friends instead. --- tools/widl/expr.c | 127 ++++++++++++++++++++++++++++++++--------------------- 1 files changed, 77 insertions(+), 50 deletions(-) diff --git a/tools/widl/expr.c b/tools/widl/expr.c index 7717da3..58d7a5b 100644 --- a/tools/widl/expr.c +++ b/tools/widl/expr.c @@ -33,6 +33,10 @@ #include "expr.h" #include "header.h" #include "typetree.h" +#include "typegen.h" + +static int is_integer_type(const type_t *type); +static int is_float_type(const type_t *type); expr_t *make_expr(enum expr_type type) { @@ -105,38 +109,17 @@ expr_t *make_exprt(enum expr_type type, type_t *tref, expr_t *expr) e->ref = expr; e->u.tref = tref; e->is_const = FALSE; - /* check for cast of constant expression */ if (type == EXPR_SIZEOF) { - switch (tref->type) + /* only do this for types that should be the same on all platforms */ + if (is_integer_type(tref) || is_float_type(tref)) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_USMALL: - e->is_const = TRUE; - e->cval = 1; - break; - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: - e->is_const = TRUE; - e->cval = 2; - break; - case RPC_FC_LONG: - case RPC_FC_ULONG: - case RPC_FC_FLOAT: - case RPC_FC_ERROR_STATUS_T: + unsigned int align = 0; e->is_const = TRUE; - e->cval = 4; - break; - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: - e->is_const = TRUE; - e->cval = 8; - break; + e->cval = type_memsize(tref, &align); } } + /* check for cast of constant expression */ if (type == EXPR_CAST && expr->is_const) { e->is_const = TRUE; @@ -302,34 +285,46 @@ struct expression_type static int is_integer_type(const type_t *type) { - switch (type->type) + switch (type_get_type(type)) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_USMALL: - case RPC_FC_WCHAR: - case RPC_FC_SHORT: - case RPC_FC_USHORT: - case RPC_FC_LONG: - case RPC_FC_ULONG: - case RPC_FC_INT3264: - case RPC_FC_UINT3264: - case RPC_FC_HYPER: - case RPC_FC_ENUM16: - case RPC_FC_ENUM32: + case TYPE_ENUM: return TRUE; + case TYPE_BASIC: + switch (type_basic_get_fc(type)) + { + case RPC_FC_BYTE: + case RPC_FC_CHAR: + case RPC_FC_SMALL: + case RPC_FC_USMALL: + case RPC_FC_WCHAR: + case RPC_FC_SHORT: + case RPC_FC_USHORT: + case RPC_FC_LONG: + case RPC_FC_ULONG: + case RPC_FC_INT3264: + case RPC_FC_UINT3264: + case RPC_FC_HYPER: + return TRUE; + default: + return FALSE; + } default: return FALSE; } } +static int is_float_type(const type_t *type) +{ + return (type_get_type(type) == TYPE_BASIC && + (type_basic_get_fc(type) == RPC_FC_FLOAT || + type_basic_get_fc(type) == RPC_FC_DOUBLE)); +} + static void check_scalar_type(const struct expr_loc *expr_loc, const type_t *cont_type, const type_t *type) { if (!cont_type || (!is_integer_type(type) && !is_ptr(type) && - type->type != RPC_FC_FLOAT && - type->type != RPC_FC_DOUBLE)) + !is_float_type(type))) error_loc_info(&expr_loc->v->loc_info, "scalar type required in expression%s%s\n", expr_loc->attr ? " for attribute " : "", expr_loc->attr ? expr_loc->attr : ""); @@ -338,9 +333,7 @@ static void check_scalar_type(const struct expr_loc *expr_loc, static void check_arithmetic_type(const struct expr_loc *expr_loc, const type_t *cont_type, const type_t *type) { - if (!cont_type || (!is_integer_type(type) && - type->type != RPC_FC_FLOAT && - type->type != RPC_FC_DOUBLE)) + if (!cont_type || (!is_integer_type(type) && !is_float_type(type))) error_loc_info(&expr_loc->v->loc_info, "arithmetic type required in expression%s%s\n", expr_loc->attr ? " for attribute " : "", expr_loc->attr ? expr_loc->attr : ""); @@ -365,12 +358,33 @@ static type_t *find_identifier(const char *identifier, const type_t *cont_type, if (cont_type) { - if (cont_type->type == RPC_FC_FUNCTION) + switch (type_get_type(cont_type)) + { + case TYPE_FUNCTION: fields = type_function_get_args(cont_type); - else if (is_struct(cont_type->type)) + break; + case TYPE_STRUCT: fields = type_struct_get_fields(cont_type); - else if (is_union(cont_type->type)) + break; + case TYPE_UNION: + case TYPE_ENCAPSULATED_UNION: fields = type_union_get_cases(cont_type); + break; + case TYPE_VOID: + case TYPE_BASIC: + case TYPE_ENUM: + case TYPE_MODULE: + case TYPE_COCLASS: + case TYPE_INTERFACE: + case TYPE_POINTER: + case TYPE_ARRAY: + /* nothing to do */ + break; + case TYPE_ALIAS: + /* shouldn't get here because of using type_get_type above */ + assert(0); + break; + } } if (fields) LIST_FOR_EACH_ENTRY( field, fields, const var_t, entry ) @@ -390,6 +404,19 @@ static type_t *find_identifier(const char *identifier, const type_t *cont_type, return type; } +static int is_valid_member_operand(const type_t *type) +{ + switch (type_get_type(type)) + { + case TYPE_STRUCT: + case TYPE_UNION: + case TYPE_ENUM: + return TRUE; + default: + return FALSE; + } +} + static struct expression_type resolve_expression(const struct expr_loc *expr_loc, const type_t *cont_type, const expr_t *e) @@ -528,7 +555,7 @@ static struct expression_type resolve_expression(const struct expr_loc *expr_loc } case EXPR_MEMBER: result = resolve_expression(expr_loc, cont_type, e->ref); - if (result.type && (is_struct(result.type->type) || is_union(result.type->type) || result.type->type == RPC_FC_ENUM16 || result.type->type == RPC_FC_ENUM32)) + if (result.type && is_valid_member_operand(result.type)) result = resolve_expression(expr_loc, result.type, e->u.ext); else error_loc_info(&expr_loc->v->loc_info, "'.' or '->' operator applied to a type that isn't a structure, union or enumeration in expression%s%s\n",
1
0
0
0
Huw Davies : lz32/tests: For win9x, cBytes depends on the length of the filename.
by Alexandre Julliard
23 Feb '09
23 Feb '09
Module: wine Branch: master Commit: dbd25cb308ddba5d108de0ded3a21a23d3ca9132 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dbd25cb308ddba5d108de0ded…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Feb 23 12:01:18 2009 +0000 lz32/tests: For win9x, cBytes depends on the length of the filename. --- dlls/lz32/tests/lzexpand_main.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/lz32/tests/lzexpand_main.c b/dlls/lz32/tests/lzexpand_main.c index 9c95d07..91fd687 100644 --- a/dlls/lz32/tests/lzexpand_main.c +++ b/dlls/lz32/tests/lzexpand_main.c @@ -231,7 +231,7 @@ static void test_LZOpenFileA_existing_compressed(void) file = LZOpenFileA(_terminated, &test, OF_EXIST); ok(file >= 0, "LZOpenFileA failed on switching to a compressed file name\n"); ok(test.cBytes == sizeof(OFSTRUCT) || - broken(test.cBytes == 40), /* win95 */ + broken(test.cBytes == FIELD_OFFSET(OFSTRUCT, szPathName) + lstrlenA(test.szPathName)), /* win9x */ "LZOpenFileA set test.cBytes to %d\n", test.cBytes); ok(test.nErrCode == 0, "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode); @@ -390,7 +390,7 @@ static void test_LZOpenFileA(void) file = LZOpenFileA(filename_, &test, OF_READ); ok(file >= 0, "LZOpenFileA failed on read\n"); ok(test.cBytes == sizeof(OFSTRUCT) || - broken(test.cBytes == 40), /* win95 */ + broken(test.cBytes == FIELD_OFFSET(OFSTRUCT, szPathName) + lstrlenA(test.szPathName)), /* win9x */ "LZOpenFileA set test.cBytes to %d '%s'('%s')\n", test.cBytes, expected, short_expected); ok(test.nErrCode == ERROR_SUCCESS, "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode); @@ -406,7 +406,7 @@ static void test_LZOpenFileA(void) file = LZOpenFileA(filename_, &test, OF_WRITE); ok(file >= 0, "LZOpenFileA failed on write\n"); ok(test.cBytes == sizeof(OFSTRUCT) || - broken(test.cBytes == 40), /* win95 */ + broken(test.cBytes == FIELD_OFFSET(OFSTRUCT, szPathName) + lstrlenA(test.szPathName)), /* win9x */ "LZOpenFileA set test.cBytes to %d\n", test.cBytes); ok(test.nErrCode == ERROR_SUCCESS, "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode); @@ -422,7 +422,7 @@ static void test_LZOpenFileA(void) file = LZOpenFileA(filename_, &test, OF_READWRITE); ok(file >= 0, "LZOpenFileA failed on read/write\n"); ok(test.cBytes == sizeof(OFSTRUCT) || - broken(test.cBytes == 40), /* win95 */ + broken(test.cBytes == FIELD_OFFSET(OFSTRUCT, szPathName) + lstrlenA(test.szPathName)), /* win9x */ "LZOpenFileA set test.cBytes to %d\n", test.cBytes); ok(test.nErrCode == ERROR_SUCCESS, "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode); @@ -438,7 +438,7 @@ static void test_LZOpenFileA(void) file = LZOpenFileA(filename_, &test, OF_EXIST); ok(file >= 0, "LZOpenFileA failed on read/write\n"); ok(test.cBytes == sizeof(OFSTRUCT) || - broken(test.cBytes == 40), /* win95 */ + broken(test.cBytes == FIELD_OFFSET(OFSTRUCT, szPathName) + lstrlenA(test.szPathName)), /* win9x */ "LZOpenFileA set test.cBytes to %d\n", test.cBytes); ok(test.nErrCode == ERROR_SUCCESS, "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode); @@ -454,7 +454,7 @@ static void test_LZOpenFileA(void) file = LZOpenFileA(filename_, &test, OF_DELETE); ok(file >= 0, "LZOpenFileA failed on delete\n"); ok(test.cBytes == sizeof(OFSTRUCT) || - broken(test.cBytes == 40), /* win95 */ + broken(test.cBytes == FIELD_OFFSET(OFSTRUCT, szPathName) + lstrlenA(test.szPathName)), /* win9x */ "LZOpenFileA set test.cBytes to %d\n", test.cBytes); ok(test.nErrCode == ERROR_SUCCESS, "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode);
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
24
...
97
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
93
94
95
96
97
Results per page:
10
25
50
100
200