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
September 2011
----- 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
996 discussions
Start a n
N
ew thread
Huw Davies : gdi32/tests: Remove legacy support from the StretchBlt tests and fix the expected results in the one case that used it .
by Alexandre Julliard
21 Sep '11
21 Sep '11
Module: wine Branch: master Commit: 7a356abeb6f9b5620342d8bb80b569336798d98d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7a356abeb6f9b5620342d8bb8…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Sep 21 15:19:23 2011 +0100 gdi32/tests: Remove legacy support from the StretchBlt tests and fix the expected results in the one case that used it. --- dlls/gdi32/tests/bitmap.c | 53 +++++++++++++++----------------------------- 1 files changed, 18 insertions(+), 35 deletions(-) diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c index 92d8181..bdc0d4d 100644 --- a/dlls/gdi32/tests/bitmap.c +++ b/dlls/gdi32/tests/bitmap.c @@ -2662,15 +2662,6 @@ static void test_get16dibits(void) ReleaseDC(NULL, screen_dc); } -static BOOL compare_buffers_no_alpha(UINT32 *a, UINT32 *b, int length) -{ - int i; - for(i = 0; i < length; i++) - if((a[i] & 0x00FFFFFF) != (b[i] & 0x00FFFFFF)) - return FALSE; - return TRUE; -} - static void check_BitBlt_pixel(HDC hdcDst, HDC hdcSrc, UINT32 *dstBuffer, UINT32 *srcBuffer, DWORD dwRop, UINT32 expected, int line) { @@ -2763,13 +2754,12 @@ static void check_StretchBlt_pixel(HDC hdcDst, HDC hdcSrc, UINT32 *dstBuffer, UI static void check_StretchBlt_stretch(HDC hdcDst, HDC hdcSrc, UINT32 *dstBuffer, UINT32 *srcBuffer, int nXOriginDest, int nYOriginDest, int nWidthDest, int nHeightDest, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, - UINT32 expected[4], UINT32 legacy_expected[4], int line) + UINT32 expected[4], int line) { memset(dstBuffer, 0, 16); StretchBlt(hdcDst, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, SRCCOPY); - ok(memcmp(dstBuffer, expected, 16) == 0 || - broken(compare_buffers_no_alpha(dstBuffer, legacy_expected, 4)), + ok(memcmp(dstBuffer, expected, 16) == 0, "StretchBlt expected { %08X, %08X, %08X, %08X } got { %08X, %08X, %08X, %08X } " "stretching { %d, %d, %d, %d } to { %d, %d, %d, %d } from line %d\n", expected[0], expected[1], expected[2], expected[3], @@ -2786,7 +2776,7 @@ static void test_StretchBlt(void) UINT32 *dstBuffer, *srcBuffer; HBRUSH hBrush, hOldBrush; BITMAPINFO biDst, biSrc; - UINT32 expected[4], legacy_expected[4]; + UINT32 expected[4]; memset(&biDst, 0, sizeof(BITMAPINFO)); biDst.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); @@ -2839,49 +2829,42 @@ static void test_StretchBlt(void) expected[0] = 0xCAFED00D, expected[1] = 0xFEEDFACE; expected[2] = 0xFEDCBA98, expected[3] = 0x76543210; check_StretchBlt_stretch(hdcDst, hdcSrc, dstBuffer, srcBuffer, - 0, 0, 2, 2, 0, 0, 2, 2, expected, expected, __LINE__); + 0, 0, 2, 2, 0, 0, 2, 2, expected, __LINE__); expected[0] = 0xCAFED00D, expected[1] = 0x00000000; expected[2] = 0x00000000, expected[3] = 0x00000000; check_StretchBlt_stretch(hdcDst, hdcSrc, dstBuffer, srcBuffer, - 0, 0, 1, 1, 0, 0, 1, 1, expected, expected, __LINE__); + 0, 0, 1, 1, 0, 0, 1, 1, expected, __LINE__); expected[0] = 0xCAFED00D, expected[1] = 0xCAFED00D; expected[2] = 0xCAFED00D, expected[3] = 0xCAFED00D; check_StretchBlt_stretch(hdcDst, hdcSrc, dstBuffer, srcBuffer, - 0, 0, 2, 2, 0, 0, 1, 1, expected, expected, __LINE__); + 0, 0, 2, 2, 0, 0, 1, 1, expected, __LINE__); expected[0] = 0xCAFED00D, expected[1] = 0x00000000; expected[2] = 0x00000000, expected[3] = 0x00000000; check_StretchBlt_stretch(hdcDst, hdcSrc, dstBuffer, srcBuffer, - 0, 0, 1, 1, 0, 0, 2, 2, expected, expected, __LINE__); + 0, 0, 1, 1, 0, 0, 2, 2, expected, __LINE__); expected[0] = 0x76543210, expected[1] = 0xFEDCBA98; expected[2] = 0xFEEDFACE, expected[3] = 0xCAFED00D; check_StretchBlt_stretch(hdcDst, hdcSrc, dstBuffer, srcBuffer, - 0, 0, 2, 2, 1, 1, -2, -2, expected, expected, __LINE__); + 0, 0, 2, 2, 1, 1, -2, -2, expected, __LINE__); expected[0] = 0x76543210, expected[1] = 0xFEDCBA98; expected[2] = 0xFEEDFACE, expected[3] = 0xCAFED00D; check_StretchBlt_stretch(hdcDst, hdcSrc, dstBuffer, srcBuffer, - 1, 1, -2, -2, 0, 0, 2, 2, expected, expected, __LINE__); + 1, 1, -2, -2, 0, 0, 2, 2, expected, __LINE__); - /* This result seems broken. One might expect the following result: - * 0xCAFED00D 0xFEEDFACE - * 0xFEDCBA98 0x76543210 - */ expected[0] = 0xCAFED00D, expected[1] = 0x00000000; - expected[2] = 0xFEDCBA98, expected[3] = 0x76543210; - legacy_expected[0] = 0xCAFED00D, legacy_expected[1] = 0x00000000; - legacy_expected[2] = 0x00000000, legacy_expected[3] = 0x00000000; + expected[2] = 0x00000000, expected[3] = 0x00000000; todo_wine check_StretchBlt_stretch(hdcDst, hdcSrc, dstBuffer, srcBuffer, - 1, 1, -2, -2, 1, 1, -2, -2, expected, - legacy_expected, __LINE__); + 1, 1, -2, -2, 1, 1, -2, -2, expected, __LINE__); expected[0] = 0x00000000, expected[1] = 0x00000000; expected[2] = 0x00000000, expected[3] = 0xCAFED00D; check_StretchBlt_stretch(hdcDst, hdcSrc, dstBuffer, srcBuffer, - 1, 1, 2, 2, 0, 0, 2, 2, expected, expected, __LINE__); + 1, 1, 2, 2, 0, 0, 2, 2, expected, __LINE__); SelectObject(hdcDst, oldDst); DeleteObject(bmpDst); @@ -2895,12 +2878,12 @@ static void test_StretchBlt(void) expected[0] = 0xFEDCBA98, expected[1] = 0x76543210; expected[2] = 0xCAFED00D, expected[3] = 0xFEEDFACE; check_StretchBlt_stretch(hdcDst, hdcSrc, dstBuffer, srcBuffer, - 0, 0, 2, 2, 0, 0, 2, 2, expected, expected, __LINE__); + 0, 0, 2, 2, 0, 0, 2, 2, expected, __LINE__); expected[0] = 0xFEEDFACE, expected[1] = 0xCAFED00D; expected[2] = 0x76543210, expected[3] = 0xFEDCBA98; check_StretchBlt_stretch(hdcDst, hdcSrc, dstBuffer, srcBuffer, - 0, 0, 2, 2, 1, 1, -2, -2, expected, expected, __LINE__); + 0, 0, 2, 2, 1, 1, -2, -2, expected, __LINE__); SelectObject(hdcSrc, oldSrc); DeleteObject(bmpSrc); @@ -2916,12 +2899,12 @@ static void test_StretchBlt(void) expected[0] = 0xCAFED00D, expected[1] = 0xFEEDFACE; expected[2] = 0xFEDCBA98, expected[3] = 0x76543210; check_StretchBlt_stretch(hdcDst, hdcSrc, dstBuffer, srcBuffer, - 0, 0, 2, 2, 0, 0, 2, 2, expected, expected, __LINE__); + 0, 0, 2, 2, 0, 0, 2, 2, expected, __LINE__); expected[0] = 0x76543210, expected[1] = 0xFEDCBA98; expected[2] = 0xFEEDFACE, expected[3] = 0xCAFED00D; check_StretchBlt_stretch(hdcDst, hdcSrc, dstBuffer, srcBuffer, - 0, 0, 2, 2, 1, 1, -2, -2, expected, expected, __LINE__); + 0, 0, 2, 2, 1, 1, -2, -2, expected, __LINE__); SelectObject(hdcDst, oldDst); DeleteObject(bmpDst); @@ -2935,12 +2918,12 @@ static void test_StretchBlt(void) expected[0] = 0xFEDCBA98, expected[1] = 0x76543210; expected[2] = 0xCAFED00D, expected[3] = 0xFEEDFACE; check_StretchBlt_stretch(hdcDst, hdcSrc, dstBuffer, srcBuffer, - 0, 0, 2, 2, 0, 0, 2, 2, expected, expected, __LINE__); + 0, 0, 2, 2, 0, 0, 2, 2, expected, __LINE__); expected[0] = 0xFEEDFACE, expected[1] = 0xCAFED00D; expected[2] = 0x76543210, expected[3] = 0xFEDCBA98; check_StretchBlt_stretch(hdcDst, hdcSrc, dstBuffer, srcBuffer, - 0, 0, 2, 2, 1, 1, -2, -2, expected, expected, __LINE__); + 0, 0, 2, 2, 1, 1, -2, -2, expected, __LINE__); SelectObject(hdcSrc, oldSrc); DeleteObject(bmpSrc);
1
0
0
0
Alistair Leslie-Hughes : mshtml: Add IHTMLTable2/3 support.
by Alexandre Julliard
21 Sep '11
21 Sep '11
Module: wine Branch: master Commit: d70b967d60e443da6d8f84d510b3a662567ff73f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d70b967d60e443da6d8f84d51…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Sep 21 16:37:34 2011 +1000 mshtml: Add IHTMLTable2/3 support. --- dlls/mshtml/htmltable.c | 199 +++++++++++++++++++++++++++++++++++++++++- dlls/mshtml/mshtml_private.h | 2 + dlls/mshtml/tests/dom.c | 2 + 3 files changed, 202 insertions(+), 1 deletions(-) diff --git a/dlls/mshtml/htmltable.c b/dlls/mshtml/htmltable.c index 61cde80..7490d98 100644 --- a/dlls/mshtml/htmltable.c +++ b/dlls/mshtml/htmltable.c @@ -34,7 +34,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); struct HTMLTable { HTMLElement element; - IHTMLTable IHTMLTable_iface; + IHTMLTable IHTMLTable_iface; + IHTMLTable2 IHTMLTable2_iface; + IHTMLTable3 IHTMLTable3_iface; ConnectionPoint cp; nsIDOMHTMLTableElement *nstable; @@ -45,6 +47,16 @@ static inline HTMLTable *impl_from_IHTMLTable(IHTMLTable *iface) return CONTAINING_RECORD(iface, HTMLTable, IHTMLTable_iface); } +static inline HTMLTable *impl_from_IHTMLTable2(IHTMLTable2 *iface) +{ + return CONTAINING_RECORD(iface, HTMLTable, IHTMLTable2_iface); +} + +static inline HTMLTable *impl_from_IHTMLTable3(IHTMLTable3 *iface) +{ + return CONTAINING_RECORD(iface, HTMLTable, IHTMLTable3_iface); +} + static HRESULT WINAPI HTMLTable_QueryInterface(IHTMLTable *iface, REFIID riid, void **ppv) { @@ -515,6 +527,185 @@ static const IHTMLTableVtbl HTMLTableVtbl = { HTMLTable_get_onreadystatechange }; +/* IHTMLTable2 */ +static HRESULT WINAPI HTMLTable2_QueryInterface(IHTMLTable2 *iface, + REFIID riid, void **ppv) +{ + HTMLTable *This = impl_from_IHTMLTable2(iface); + + return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv); +} + +static ULONG WINAPI HTMLTable2_AddRef(IHTMLTable2 *iface) +{ + HTMLTable *This = impl_from_IHTMLTable2(iface); + + return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface); +} + +static ULONG WINAPI HTMLTable2_Release(IHTMLTable2 *iface) +{ + HTMLTable *This = impl_from_IHTMLTable2(iface); + + return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface); +} + +static HRESULT WINAPI HTMLTable2_GetTypeInfoCount(IHTMLTable2 *iface, UINT *pctinfo) +{ + HTMLTable *This = impl_from_IHTMLTable2(iface); + return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo); +} + +static HRESULT WINAPI HTMLTable2_GetTypeInfo(IHTMLTable2 *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + HTMLTable *This = impl_from_IHTMLTable2(iface); + return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid, + ppTInfo); +} + +static HRESULT WINAPI HTMLTable2_GetIDsOfNames(IHTMLTable2 *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, + LCID lcid, DISPID *rgDispId) +{ + HTMLTable *This = impl_from_IHTMLTable2(iface); + return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames, + cNames, lcid, rgDispId); +} + +static HRESULT WINAPI HTMLTable2_Invoke(IHTMLTable2 *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + HTMLTable *This = impl_from_IHTMLTable2(iface); + return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid, + lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); +} + +static HRESULT WINAPI HTMLTable2_firstPage(IHTMLTable2 *iface) +{ + HTMLTable *This = impl_from_IHTMLTable2(iface); + FIXME("(%p)->()\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLTable2_lastPage(IHTMLTable2 *iface) +{ + HTMLTable *This = impl_from_IHTMLTable2(iface); + FIXME("(%p)->()\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLTable2_cells(IHTMLTable2 *iface, IHTMLElementCollection **p) +{ + HTMLTable *This = impl_from_IHTMLTable2(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLTable2_moveRow(IHTMLTable2 *iface, LONG indexFrom, LONG indexTo, IDispatch **row) +{ + HTMLTable *This = impl_from_IHTMLTable2(iface); + FIXME("(%p)->(%d %d %p)\n", This, indexFrom, indexTo, row); + return E_NOTIMPL; +} + + +static const IHTMLTable2Vtbl HTMLTable2Vtbl = { + HTMLTable2_QueryInterface, + HTMLTable2_AddRef, + HTMLTable2_Release, + HTMLTable2_GetTypeInfoCount, + HTMLTable2_GetTypeInfo, + HTMLTable2_GetIDsOfNames, + HTMLTable2_Invoke, + HTMLTable2_firstPage, + HTMLTable2_lastPage, + HTMLTable2_cells, + HTMLTable2_moveRow +}; + +/* IHTMLTable3 */ +static HRESULT WINAPI HTMLTable3_QueryInterface(IHTMLTable3 *iface, + REFIID riid, void **ppv) +{ + HTMLTable *This = impl_from_IHTMLTable3(iface); + + return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv); +} + +static ULONG WINAPI HTMLTable3_AddRef(IHTMLTable3 *iface) +{ + HTMLTable *This = impl_from_IHTMLTable3(iface); + + return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface); +} + +static ULONG WINAPI HTMLTable3_Release(IHTMLTable3 *iface) +{ + HTMLTable *This = impl_from_IHTMLTable3(iface); + + return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface); +} + +static HRESULT WINAPI HTMLTable3_GetTypeInfoCount(IHTMLTable3 *iface, UINT *pctinfo) +{ + HTMLTable *This = impl_from_IHTMLTable3(iface); + return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo); +} + +static HRESULT WINAPI HTMLTable3_GetTypeInfo(IHTMLTable3 *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + HTMLTable *This = impl_from_IHTMLTable3(iface); + return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid, + ppTInfo); +} + +static HRESULT WINAPI HTMLTable3_GetIDsOfNames(IHTMLTable3 *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, + LCID lcid, DISPID *rgDispId) +{ + HTMLTable *This = impl_from_IHTMLTable3(iface); + return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames, + cNames, lcid, rgDispId); +} + +static HRESULT WINAPI HTMLTable3_Invoke(IHTMLTable3 *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + HTMLTable *This = impl_from_IHTMLTable3(iface); + return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid, + lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); +} + +static HRESULT WINAPI HTMLTable3_put_summary(IHTMLTable3 *iface, BSTR v) +{ + HTMLTable *This = impl_from_IHTMLTable3(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLTable3_get_summary(IHTMLTable3 *iface, BSTR * p) +{ + HTMLTable *This = impl_from_IHTMLTable3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static const IHTMLTable3Vtbl HTMLTable3Vtbl = { + HTMLTable3_QueryInterface, + HTMLTable3_AddRef, + HTMLTable3_Release, + HTMLTable3_GetTypeInfoCount, + HTMLTable3_GetTypeInfo, + HTMLTable3_GetIDsOfNames, + HTMLTable3_Invoke, + HTMLTable3_put_summary, + HTMLTable3_get_summary +}; + static inline HTMLTable *impl_from_HTMLDOMNode(HTMLDOMNode *iface) { return CONTAINING_RECORD(iface, HTMLTable, element.node); @@ -535,6 +726,12 @@ static HRESULT HTMLTable_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) }else if(IsEqualGUID(&IID_IHTMLTable, riid)) { TRACE("(%p)->(IID_IHTMLTable %p)\n", This, ppv); *ppv = &This->IHTMLTable_iface; + }else if(IsEqualGUID(&IID_IHTMLTable2, riid)) { + TRACE("(%p)->(IID_IHTMLTable2 %p)\n", This, ppv); + *ppv = &This->IHTMLTable_iface; + }else if(IsEqualGUID(&IID_IHTMLTable3, riid)) { + TRACE("(%p)->(IID_IHTMLTable3 %p)\n", This, ppv); + *ppv = &This->IHTMLTable_iface; } if(*ppv) { diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 7b759e0..7be212e 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -162,6 +162,8 @@ typedef struct event_target_t event_target_t; XIID(IHTMLStyleElement) \ XIID(IHTMLStyleSheetsCollection) \ XIID(IHTMLTable) \ + XIID(IHTMLTable2) \ + XIID(IHTMLTable3) \ XIID(IHTMLTableRow) \ XIID(IHTMLTextAreaElement) \ XIID(IHTMLTextContainer) \ diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 107fbb5..4a2a7ac 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -213,6 +213,8 @@ static const IID * const option_iids[] = { static const IID * const table_iids[] = { ELEM_IFACES, &IID_IHTMLTable, + &IID_IHTMLTable2, + &IID_IHTMLTable3, &IID_IConnectionPointContainer, NULL };
1
0
0
0
Jacek Caban : vbscript: Added const statement tests.
by Alexandre Julliard
21 Sep '11
21 Sep '11
Module: wine Branch: master Commit: e9ad716a3436d7653169e2432c71530a9cc8e7b5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e9ad716a3436d7653169e2432…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Sep 21 14:04:30 2011 +0200 vbscript: Added const statement tests. --- dlls/vbscript/tests/lang.vbs | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 7c64adf..2d712f5 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -688,4 +688,22 @@ Call obj.test(obj) Call ok(getVT(test) = "VT_DISPATCH", "getVT(test) = " & getVT(test)) Call ok(Me is Test, "Me is not Test") +Const c1 = 1, c2 = 2 +Call ok(c1 = 1, "c1 = " & c1) +Call ok(getVT(c1) = "VT_I2", "getVT(c1) = " & getVT(c1)) + +if false then Const conststr = "str" +Call ok(conststr = "str", "conststr = " & conststr) +Call ok(getVT(conststr) = "VT_BSTR", "getVT(conststr) = " & getVT(conststr)) +Call ok(conststr = "str", "conststr = " & conststr) + +Sub ConstTestSub + Const funcconst = 1 + Call ok(c1 = 1, "c1 = " & c1) + Call ok(funcconst = 1, "funcconst = " & funcconst) +End Sub + +Call ConstTestSub +Dim funcconst + reportSuccess()
1
0
0
0
Jacek Caban : vbscript: Added interp_const implementation.
by Alexandre Julliard
21 Sep '11
21 Sep '11
Module: wine Branch: master Commit: 6cbf3e3b3c0a566c35ae168efabf5939264ff081 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6cbf3e3b3c0a566c35ae168ef…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Sep 21 14:04:16 2011 +0200 vbscript: Added interp_const implementation. --- dlls/vbscript/compile.c | 1 + dlls/vbscript/interp.c | 38 +++++++++++++++++++++++++++++++------- dlls/vbscript/vbscript.h | 1 + 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index 712d97d..9cfe45b 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -921,6 +921,7 @@ static HRESULT compile_func(compile_ctx_t *ctx, statement_t *stat, function_t *f return E_OUTOFMEMORY; V_VT(&new_var->v) = VT_EMPTY; + new_var->is_const = FALSE; new_var->next = ctx->global_vars; ctx->global_vars = new_var; diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 46d15ff..c2ffd98 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -24,7 +24,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(vbscript); - typedef struct { vbscode_t *code; instr_t *instr; @@ -52,6 +51,7 @@ typedef enum { REF_DISP, REF_VAR, REF_OBJ, + REF_CONST, REF_FUNC } ref_type_t; @@ -78,7 +78,7 @@ static BOOL lookup_dynamic_vars(dynamic_var_t *var, const WCHAR *name, ref_t *re { while(var) { if(!strcmpiW(var->name, name)) { - ref->type = REF_VAR; + ref->type = var->is_const ? REF_CONST : REF_VAR; ref->u.v = &var->v; return TRUE; } @@ -198,7 +198,7 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ return S_OK; } -static HRESULT add_dynamic_var(exec_ctx_t *ctx, const WCHAR *name, VARIANT *val, BOOL own_val) +static HRESULT add_dynamic_var(exec_ctx_t *ctx, const WCHAR *name, BOOL is_const, VARIANT *val, BOOL own_val) { dynamic_var_t *new_var; vbsheap_t *heap; @@ -218,6 +218,7 @@ static HRESULT add_dynamic_var(exec_ctx_t *ctx, const WCHAR *name, VARIANT *val, return E_OUTOFMEMORY; memcpy(str, name, size); new_var->name = str; + new_var->is_const = is_const; if(own_val) { new_var->v = *val; @@ -379,6 +380,7 @@ static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res) switch(ref.type) { case REF_VAR: + case REF_CONST: if(!res) { FIXME("REF_VAR no res\n"); return E_NOTIMPL; @@ -531,13 +533,16 @@ static HRESULT assign_ident(exec_ctx_t *ctx, BSTR name, VARIANT *val, BOOL own_v case REF_OBJ: FIXME("REF_OBJ\n"); return E_NOTIMPL; + case REF_CONST: + FIXME("REF_CONST\n"); + return E_NOTIMPL; case REF_NONE: if(ctx->func->code_ctx->option_explicit) { FIXME("throw exception\n"); hres = E_FAIL; }else { TRACE("creating variable %s\n", debugstr_w(name)); - hres = add_dynamic_var(ctx, name, val, own_val); + hres = add_dynamic_var(ctx, name, FALSE, val, own_val); } } @@ -653,8 +658,28 @@ static HRESULT interp_set_member(exec_ctx_t *ctx) static HRESULT interp_const(exec_ctx_t *ctx) { BSTR arg = ctx->instr->arg1.bstr; - FIXME("%s\n", debugstr_w(arg)); - return E_NOTIMPL; + variant_val_t val; + ref_t ref; + HRESULT hres; + + TRACE("%s\n", debugstr_w(arg)); + + assert(ctx->func->type == FUNC_GLOBAL); + + hres = lookup_identifier(ctx, arg, VBDISP_CALLGET, &ref); + if(FAILED(hres)) + return hres; + + if(ref.type != REF_NONE) { + FIXME("%s already defined\n", debugstr_w(arg)); + return E_FAIL; + } + + hres = stack_pop_val(ctx, &val); + if(FAILED(hres)) + return hres; + + return add_dynamic_var(ctx, arg, TRUE, val.v, val.owned); } static HRESULT interp_new(exec_ctx_t *ctx) @@ -1547,6 +1572,5 @@ HRESULT exec_script(script_ctx_t *ctx, function_t *func, IDispatch *this_obj, DI } release_exec(&exec); - return hres; } diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 73b0b86..bd55719 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -136,6 +136,7 @@ typedef struct _dynamic_var_t { struct _dynamic_var_t *next; VARIANT v; const WCHAR *name; + BOOL is_const; } dynamic_var_t; struct _script_ctx_t {
1
0
0
0
Jacek Caban : vbscript: Moved creating new dynamic variable to separated function.
by Alexandre Julliard
21 Sep '11
21 Sep '11
Module: wine Branch: master Commit: 020d0695bb7570bf6ab3fa48e2d48a2418036ec8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=020d0695bb7570bf6ab3fa48e…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Sep 21 14:03:50 2011 +0200 vbscript: Moved creating new dynamic variable to separated function. --- dlls/vbscript/interp.c | 82 +++++++++++++++++++++++++---------------------- 1 files changed, 44 insertions(+), 38 deletions(-) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 232a582..46d15ff 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -198,6 +198,46 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ return S_OK; } +static HRESULT add_dynamic_var(exec_ctx_t *ctx, const WCHAR *name, VARIANT *val, BOOL own_val) +{ + dynamic_var_t *new_var; + vbsheap_t *heap; + WCHAR *str; + unsigned size; + HRESULT hres; + + heap = ctx->func->type == FUNC_GLOBAL ? &ctx->script->heap : &ctx->heap; + + new_var = vbsheap_alloc(heap, sizeof(*new_var)); + if(!new_var) + return E_OUTOFMEMORY; + + size = (strlenW(name)+1)*sizeof(WCHAR); + str = vbsheap_alloc(heap, size); + if(!str) + return E_OUTOFMEMORY; + memcpy(str, name, size); + new_var->name = str; + + if(own_val) { + new_var->v = *val; + }else { + hres = VariantCopy(&new_var->v, val); + if(FAILED(hres)) + return hres; + } + + if(ctx->func->type == FUNC_GLOBAL) { + new_var->next = ctx->script->global_vars; + ctx->script->global_vars = new_var; + }else { + new_var->next = ctx->dynamic_vars; + ctx->dynamic_vars = new_var; + } + + return S_OK; +} + static inline VARIANT *stack_pop(exec_ctx_t *ctx) { assert(ctx->top); @@ -491,49 +531,15 @@ static HRESULT assign_ident(exec_ctx_t *ctx, BSTR name, VARIANT *val, BOOL own_v case REF_OBJ: FIXME("REF_OBJ\n"); return E_NOTIMPL; - case REF_NONE: { - dynamic_var_t *new_var; - vbsheap_t *heap; - WCHAR *str; - unsigned size; - + case REF_NONE: if(ctx->func->code_ctx->option_explicit) { FIXME("throw exception\n"); - return E_FAIL; - } - - TRACE("creating variable %s\n", debugstr_w(name)); - - heap = ctx->func->type == FUNC_GLOBAL ? &ctx->script->heap : &ctx->heap; - - new_var = vbsheap_alloc(heap, sizeof(*new_var)); - if(!new_var) - return E_OUTOFMEMORY; - - size = (strlenW(name)+1)*sizeof(WCHAR); - str = vbsheap_alloc(heap, size); - if(!str) - return E_OUTOFMEMORY; - memcpy(str, name, size); - new_var->name = str; - - if(own_val) { - new_var->v = *val; - }else { - hres = VariantCopy(&new_var->v, val); - if(FAILED(hres)) - return hres; - } - - if(ctx->func->type == FUNC_GLOBAL) { - new_var->next = ctx->script->global_vars; - ctx->script->global_vars = new_var; + hres = E_FAIL; }else { - new_var->next = ctx->dynamic_vars; - ctx->dynamic_vars = new_var; + TRACE("creating variable %s\n", debugstr_w(name)); + hres = add_dynamic_var(ctx, name, val, own_val); } } - } return hres; }
1
0
0
0
Jacek Caban : vbscript: Added const statement compiler implementation.
by Alexandre Julliard
21 Sep '11
21 Sep '11
Module: wine Branch: master Commit: a968166224439df300689ca8434f14532d7524a4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a968166224439df300689ca84…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Sep 21 14:03:38 2011 +0200 vbscript: Added const statement compiler implementation. --- dlls/vbscript/compile.c | 78 ++++++++++++++++++++++++++++++++++++++++++++-- dlls/vbscript/interp.c | 7 ++++ dlls/vbscript/vbscript.h | 1 + 3 files changed, 83 insertions(+), 3 deletions(-) diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index 53b7f81..712d97d 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -46,6 +46,9 @@ typedef struct { dim_decl_t *dim_decls; dynamic_var_t *global_vars; + const_decl_t *const_decls; + const_decl_t *global_consts; + function_t *func; function_t *funcs; function_decl_t *func_decls; @@ -302,6 +305,26 @@ static inline void label_set_addr(compile_ctx_t *ctx, unsigned label) ctx->labels[label & ~LABEL_FLAG] = ctx->instr_cnt; } +static expression_t *lookup_const_decls(compile_ctx_t *ctx, const WCHAR *name, BOOL lookup_global) +{ + const_decl_t *decl; + + for(decl = ctx->const_decls; decl; decl = decl->next) { + if(!strcmpiW(decl->name, name)) + return decl->value_expr; + } + + if(!lookup_global) + return NULL; + + for(decl = ctx->global_consts; decl; decl = decl->next) { + if(!strcmpiW(decl->name, name)) + return decl->value_expr; + } + + return NULL; +} + static HRESULT compile_args(compile_ctx_t *ctx, expression_t *args, unsigned *ret) { unsigned arg_cnt = 0; @@ -325,6 +348,14 @@ static HRESULT compile_member_expression(compile_ctx_t *ctx, member_expression_t unsigned arg_cnt = 0; HRESULT hres; + if(ret_val && !expr->args) { + expression_t *const_expr; + + const_expr = lookup_const_decls(ctx, expr->identifier, TRUE); + if(const_expr) + return compile_expression(ctx, const_expr); + } + hres = compile_args(ctx, expr->args, &arg_cnt); if(FAILED(hres)) return hres; @@ -627,7 +658,8 @@ static HRESULT compile_dim_statement(compile_ctx_t *ctx, dim_statement_t *stat) dim_decl_t *dim_decl = stat->dim_decls; while(1) { - if(lookup_dim_decls(ctx, dim_decl->name) || lookup_args_name(ctx, dim_decl->name)) { + if(lookup_dim_decls(ctx, dim_decl->name) || lookup_args_name(ctx, dim_decl->name) + || lookup_const_decls(ctx, dim_decl->name, FALSE)) { FIXME("dim %s name redefined\n", debugstr_w(dim_decl->name)); return E_FAIL; } @@ -643,6 +675,39 @@ static HRESULT compile_dim_statement(compile_ctx_t *ctx, dim_statement_t *stat) return S_OK; } +static HRESULT compile_const_statement(compile_ctx_t *ctx, const_statement_t *stat) +{ + const_decl_t *decl, *next_decl = stat->decls; + + do { + decl = next_decl; + + if(lookup_const_decls(ctx, decl->name, FALSE) || lookup_args_name(ctx, decl->name) + || lookup_dim_decls(ctx, decl->name)) { + FIXME("%s redefined\n", debugstr_w(decl->name)); + return E_FAIL; + } + + if(ctx->func->type == FUNC_GLOBAL) { + HRESULT hres; + + hres = compile_expression(ctx, decl->value_expr); + if(FAILED(hres)) + return hres; + + hres = push_instr_bstr(ctx, OP_const, decl->name); + if(FAILED(hres)) + return hres; + } + + next_decl = decl->next; + decl->next = ctx->const_decls; + ctx->const_decls = decl; + } while(next_decl); + + return S_OK; +} + static HRESULT compile_function_statement(compile_ctx_t *ctx, function_statement_t *stat) { if(ctx->func != &ctx->code->global_code) { @@ -712,6 +777,9 @@ static HRESULT compile_statement(compile_ctx_t *ctx, statement_t *stat) case STAT_CALL: hres = compile_member_expression(ctx, ((call_statement_t*)stat)->expr, FALSE); break; + case STAT_CONST: + hres = compile_const_statement(ctx, (const_statement_t*)stat); + break; case STAT_DIM: hres = compile_dim_statement(ctx, (dim_statement_t*)stat); break; @@ -815,6 +883,7 @@ static HRESULT compile_func(compile_ctx_t *ctx, statement_t *stat, function_t *f ctx->func = func; ctx->dim_decls = NULL; + ctx->const_decls = NULL; hres = compile_statement(ctx, stat); ctx->func = NULL; if(FAILED(hres)) @@ -893,7 +962,7 @@ static HRESULT create_function(compile_ctx_t *ctx, function_decl_t *decl, functi function_t *func; HRESULT hres; - if(lookup_dim_decls(ctx, decl->name) || lookup_funcs_name(ctx, decl->name)) { + if(lookup_dim_decls(ctx, decl->name) || lookup_funcs_name(ctx, decl->name) || lookup_const_decls(ctx, decl->name, FALSE)) { FIXME("%s: redefinition\n", debugstr_w(decl->name)); return E_FAIL; } @@ -1019,7 +1088,7 @@ static HRESULT compile_class(compile_ctx_t *ctx, class_decl_t *class_decl) static const WCHAR class_terminateW[] = {'c','l','a','s','s','_','t','e','r','m','i','n','a','t','e',0}; if(lookup_dim_decls(ctx, class_decl->name) || lookup_funcs_name(ctx, class_decl->name) - || lookup_class_name(ctx, class_decl->name)) { + || lookup_const_decls(ctx, class_decl->name, FALSE) || lookup_class_name(ctx, class_decl->name)) { FIXME("%s: redefinition\n", debugstr_w(class_decl->name)); return E_FAIL; } @@ -1247,6 +1316,7 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, vbscode_t **ret) ctx.dim_decls = NULL; ctx.classes = NULL; ctx.labels = NULL; + ctx.global_consts = NULL; ctx.labels_cnt = ctx.labels_size = 0; hres = compile_func(&ctx, ctx.parser.stats, &ctx.code->global_code); @@ -1255,6 +1325,8 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, vbscode_t **ret) return hres; } + ctx.global_consts = ctx.const_decls; + for(func_decl = ctx.func_decls; func_decl; func_decl = func_decl->next) { hres = create_function(&ctx, func_decl, &new_func); if(FAILED(hres)) { diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index aff7b91..232a582 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -644,6 +644,13 @@ static HRESULT interp_set_member(exec_ctx_t *ctx) return hres; } +static HRESULT interp_const(exec_ctx_t *ctx) +{ + BSTR arg = ctx->instr->arg1.bstr; + FIXME("%s\n", debugstr_w(arg)); + return E_NOTIMPL; +} + static HRESULT interp_new(exec_ctx_t *ctx) { const WCHAR *arg = ctx->instr->arg1.bstr; diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 5a968d1..73b0b86 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -184,6 +184,7 @@ typedef enum { X(assign_member, 1, ARG_BSTR, 0) \ X(bool, 1, ARG_INT, 0) \ X(concat, 1, 0, 0) \ + X(const, 1, ARG_BSTR, 0) \ X(div, 1, 0, 0) \ X(double, 1, ARG_DOUBLE, 0) \ X(empty, 1, 0, 0) \
1
0
0
0
Jacek Caban : vbscript: Added const statement parser implementation.
by Alexandre Julliard
21 Sep '11
21 Sep '11
Module: wine Branch: master Commit: eb5e97a67f61b24e3b5f92bdb52923804b4d2c7d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=eb5e97a67f61b24e3b5f92bdb…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Sep 21 14:03:18 2011 +0200 vbscript: Added const statement parser implementation. --- dlls/vbscript/lex.c | 2 ++ dlls/vbscript/parse.h | 12 ++++++++++++ dlls/vbscript/parser.y | 41 +++++++++++++++++++++++++++++++++++++++-- 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/dlls/vbscript/lex.c b/dlls/vbscript/lex.c index e0a9418..f42d2fd 100644 --- a/dlls/vbscript/lex.c +++ b/dlls/vbscript/lex.c @@ -31,6 +31,7 @@ static const WCHAR byrefW[] = {'b','y','r','e','f',0}; static const WCHAR byvalW[] = {'b','y','v','a','l',0}; static const WCHAR callW[] = {'c','a','l','l',0}; static const WCHAR classW[] = {'c','l','a','s','s',0}; +static const WCHAR constW[] = {'c','o','n','s','t',0}; static const WCHAR defaultW[] = {'d','e','f','a','u','l','t',0}; static const WCHAR dimW[] = {'d','i','m',0}; static const WCHAR doW[] = {'d','o',0}; @@ -85,6 +86,7 @@ static const struct { {byvalW, tBYVAL}, {callW, tCALL}, {classW, tCLASS}, + {constW, tCONST}, {defaultW, tDEFAULT}, {dimW, tDIM}, {doW, tDO}, diff --git a/dlls/vbscript/parse.h b/dlls/vbscript/parse.h index 976de53..8e4be57 100644 --- a/dlls/vbscript/parse.h +++ b/dlls/vbscript/parse.h @@ -98,6 +98,7 @@ typedef struct { typedef enum { STAT_ASSIGN, STAT_CALL, + STAT_CONST, STAT_DIM, STAT_DOUNTIL, STAT_DOWHILE, @@ -200,6 +201,17 @@ typedef struct { BOOL resume_next; } onerror_statement_t; +typedef struct _const_decl_t { + const WCHAR *name; + expression_t *value_expr; + struct _const_decl_t *next; +} const_decl_t; + +typedef struct { + statement_t stat; + const_decl_t *decls; +} const_statement_t; + typedef struct { const WCHAR *code; const WCHAR *ptr; diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index 728bd92..8435e92 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -25,7 +25,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(vbscript); - #define YYLEX_PARAM ctx #define YYPARSE_PARAM ctx @@ -56,11 +55,13 @@ static statement_t *new_while_statement(parser_ctx_t*,statement_type_t,expressio static statement_t *new_if_statement(parser_ctx_t*,expression_t*,statement_t*,elseif_decl_t*,statement_t*); static statement_t *new_function_statement(parser_ctx_t*,function_decl_t*); static statement_t *new_onerror_statement(parser_ctx_t*,BOOL); +static statement_t *new_const_statement(parser_ctx_t*,const_decl_t*); static dim_decl_t *new_dim_decl(parser_ctx_t*,const WCHAR*,dim_decl_t*); static elseif_decl_t *new_elseif_decl(parser_ctx_t*,expression_t*,statement_t*); static function_decl_t *new_function_decl(parser_ctx_t*,const WCHAR*,function_type_t,unsigned,arg_decl_t*,statement_t*); static arg_decl_t *new_argument_decl(parser_ctx_t*,const WCHAR*,BOOL); +static const_decl_t *new_const_decl(parser_ctx_t*,const WCHAR*,expression_t*); static class_decl_t *new_class_decl(parser_ctx_t*); static class_decl_t *add_class_function(parser_ctx_t*,class_decl_t*,function_decl_t*); @@ -88,6 +89,7 @@ static statement_t *link_statements(statement_t*,statement_t*); function_decl_t *func_decl; arg_decl_t *arg_decl; class_decl_t *class_decl; + const_decl_t *const_decl; unsigned uint; LONG lng; BOOL bool; @@ -98,7 +100,7 @@ static statement_t *link_statements(statement_t*,statement_t*); %token tTRUE tFALSE %token tNOT tAND tOR tXOR tEQV tIMP tNEQ %token tIS tLTEQ tGTEQ tMOD -%token tCALL tDIM tSUB tFUNCTION tPROPERTY tGET tLET +%token tCALL tDIM tSUB tFUNCTION tPROPERTY tGET tLET tCONST %token tIF tELSE tELSEIF tEND tTHEN tEXIT %token tWHILE tWEND tDO tLOOP tUNTIL %token tBYREF tBYVAL @@ -124,6 +126,7 @@ static statement_t *link_statements(statement_t*,statement_t*); %type <class_decl> ClassDeclaration ClassBody %type <uint> Storage Storage_opt %type <dim_decl> DimDeclList +%type <const_decl> ConstDecl ConstDeclList %% @@ -182,6 +185,7 @@ SimpleStatement | tSTOP { $$ = new_statement(ctx, STAT_STOP, 0); CHECK_ERROR; } | tON tERROR tRESUME tNEXT { $$ = new_onerror_statement(ctx, TRUE); CHECK_ERROR; } | tON tERROR tGOTO '0' { $$ = new_onerror_statement(ctx, FALSE); CHECK_ERROR; } + | tCONST ConstDeclList { $$ = new_const_statement(ctx, $2); CHECK_ERROR; } MemberExpression : tIdentifier { $$ = new_member_expression(ctx, NULL, $1); CHECK_ERROR; } @@ -191,6 +195,13 @@ DimDeclList /* FIXME: Support arrays */ : tIdentifier { $$ = new_dim_decl(ctx, $1, NULL); CHECK_ERROR; } | tIdentifier ',' DimDeclList { $$ = new_dim_decl(ctx, $1, $3); CHECK_ERROR; } +ConstDeclList + : ConstDecl { $$ = $1; } + | ConstDecl ',' ConstDeclList { $1->next = $3; $$ = $1; } + +ConstDecl + : tIdentifier '=' LiteralExpression { $$ = new_const_decl(ctx, $1, $3); CHECK_ERROR; } + DoType : tWHILE { $$ = TRUE; } | tUNTIL { $$ = FALSE; } @@ -766,6 +777,32 @@ static class_decl_t *add_variant_prop(parser_ctx_t *ctx, class_decl_t *class_dec return class_decl; } +static const_decl_t *new_const_decl(parser_ctx_t *ctx, const WCHAR *name, expression_t *expr) +{ + const_decl_t *decl; + + decl = parser_alloc(ctx, sizeof(*decl)); + if(!decl) + return NULL; + + decl->name = name; + decl->value_expr = expr; + decl->next = NULL; + return decl; +} + +static statement_t *new_const_statement(parser_ctx_t *ctx, const_decl_t *decls) +{ + const_statement_t *stat; + + stat = new_statement(ctx, STAT_CONST, sizeof(*stat)); + if(!stat) + return NULL; + + stat->decls = decls; + return &stat->stat; +} + static statement_t *link_statements(statement_t *head, statement_t *tail) { statement_t *iter;
1
0
0
0
Michael Stefaniuc : shell32: Remove casts to the type of the casted expression.
by Alexandre Julliard
21 Sep '11
21 Sep '11
Module: wine Branch: master Commit: 44b2f66ac7f639c54afab3d1a2dde4d8991248e3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=44b2f66ac7f639c54afab3d1a…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Sep 21 11:59:19 2011 +0200 shell32: Remove casts to the type of the casted expression. --- dlls/shell32/shellitem.c | 2 +- dlls/shell32/shfldr_netplaces.c | 2 +- dlls/shell32/shlview.c | 2 +- dlls/shell32/tests/ebrowser.c | 4 ++-- dlls/shell32/tests/shlfolder.c | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/shell32/shellitem.c b/dlls/shell32/shellitem.c index e5bf6ed..b2093a1 100644 --- a/dlls/shell32/shellitem.c +++ b/dlls/shell32/shellitem.c @@ -1080,7 +1080,7 @@ HRESULT WINAPI SHCreateShellItemArrayFromDataObject(IDataObject *pdo, REFIID rii for(i = 0; i < pida->cidl; i++) children[i] = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[i+1]); - ret = SHCreateShellItemArray(parent_pidl, NULL, pida->cidl, children, (IShellItemArray**)&psia); + ret = SHCreateShellItemArray(parent_pidl, NULL, pida->cidl, children, &psia); HeapFree(GetProcessHeap(), 0, children); diff --git a/dlls/shell32/shfldr_netplaces.c b/dlls/shell32/shfldr_netplaces.c index 3e4a8e5..0ab0470 100644 --- a/dlls/shell32/shfldr_netplaces.c +++ b/dlls/shell32/shfldr_netplaces.c @@ -367,7 +367,7 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnGetAttributesOf (IShellFolder2 * iface IShellFolder *psfParent = NULL; LPCITEMIDLIST rpidl = NULL; - hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder, (LPVOID*)&psfParent, (LPCITEMIDLIST*)&rpidl); + hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder, (void**)&psfParent, &rpidl); if(SUCCEEDED(hr)) { SHELL32_GetItemAttributes (psfParent, rpidl, rgfInOut); diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c index ff5f05c..787a1b7 100644 --- a/dlls/shell32/shlview.c +++ b/dlls/shell32/shlview.c @@ -731,7 +731,7 @@ static LRESULT ShellView_OnCreate(IShellViewImpl *This) LPITEMIDLIST raw_pidl; SHChangeNotifyEntry ntreg; - hr = IPersistFolder2_GetCurFolder(ppf2, (LPITEMIDLIST*)&raw_pidl); + hr = IPersistFolder2_GetCurFolder(ppf2, &raw_pidl); if(SUCCEEDED(hr)) { LPITEMIDLIST computer_pidl; diff --git a/dlls/shell32/tests/ebrowser.c b/dlls/shell32/tests/ebrowser.c index 4ad6682..8149f8f 100644 --- a/dlls/shell32/tests/ebrowser.c +++ b/dlls/shell32/tests/ebrowser.c @@ -466,7 +466,7 @@ static HRESULT WINAPI IServiceProvider_fnQueryInterface(IServiceProvider *iface, if(IsEqualIID(riid, &IID_IServiceProvider)) { *ppvObj = iface; - IServiceProvider_AddRef((IServiceProvider*)iface); + IServiceProvider_AddRef(iface); return S_OK; } @@ -532,7 +532,7 @@ static HRESULT WINAPI IServiceProvider_fnQueryService(IServiceProvider *iface, if(punk) { *ppv = punk; - IUnknown_AddRef((IUnknown*)punk); + IUnknown_AddRef(punk); return S_OK; } diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index e9e4267..fb634b4 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -3894,8 +3894,8 @@ static void test_GetUIObject(void) ok(hr == S_OK, "Got 0x%08x\n", hr); if(SUCCEEDED(hr)) { - hr = IShellFolder_GetUIObjectOf(psf, NULL, 1, (LPCITEMIDLIST*)&pidl_child, - &IID_IContextMenu, NULL, (void**)&pcm); + hr = IShellFolder_GetUIObjectOf(psf, NULL, 1, &pidl_child, &IID_IContextMenu, NULL, + (void**)&pcm); ok(hr == S_OK, "Got 0x%08x\n", hr); if(SUCCEEDED(hr)) {
1
0
0
0
Nikolay Sivov : msxml3: It's not a failure to get S_FALSE from IStream:: Read().
by Alexandre Julliard
21 Sep '11
21 Sep '11
Module: wine Branch: master Commit: 809959de2c90929282c41b03a516cf3d71240411 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=809959de2c90929282c41b03a…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Sep 21 13:48:17 2011 +0400 msxml3: It's not a failure to get S_FALSE from IStream::Read(). --- dlls/msxml3/saxreader.c | 43 ++++++++++++++++++++++++++----------------- 1 files changed, 26 insertions(+), 17 deletions(-) diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c index 5bf6eda..f5ec672 100644 --- a/dlls/msxml3/saxreader.c +++ b/dlls/msxml3/saxreader.c @@ -1873,14 +1873,14 @@ static HRESULT internal_parseStream(saxreader *This, IStream *stream, BOOL vbInt HRESULT hr; ULONG dataRead; char data[1024]; + int ret; + dataRead = 0; hr = IStream_Read(stream, data, sizeof(data), &dataRead); - if(hr != S_OK) - return hr; + if(FAILED(hr)) return hr; hr = SAXLocator_create(This, &locator, vbInterface); - if(FAILED(hr)) - return hr; + if(FAILED(hr)) return hr; locator->pParserCtxt = xmlCreatePushParserCtxt( &locator->saxreader->sax, locator, @@ -1892,25 +1892,34 @@ static HRESULT internal_parseStream(saxreader *This, IStream *stream, BOOL vbInt } This->isParsing = TRUE; - while(1) - { - hr = IStream_Read(stream, data, sizeof(data), &dataRead); - if(hr != S_OK) - break; - if(xmlParseChunk(locator->pParserCtxt, data, dataRead, 0) != XML_ERR_OK) hr = E_FAIL; - else hr = locator->ret; + if(dataRead != sizeof(data)) + { + ret = xmlParseChunk(locator->pParserCtxt, data, 0, 1); + hr = ret != XML_ERR_OK ? E_FAIL : locator->ret; + } + else + { + while(1) + { + dataRead = 0; + hr = IStream_Read(stream, data, sizeof(data), &dataRead); + if (FAILED(hr)) break; - if(hr != S_OK) break; + ret = xmlParseChunk(locator->pParserCtxt, data, dataRead, 0); + hr = ret != XML_ERR_OK ? E_FAIL : locator->ret; - if(dataRead != sizeof(data)) - { - if(xmlParseChunk(locator->pParserCtxt, data, 0, 1) != XML_ERR_OK) hr = E_FAIL; - else hr = locator->ret; + if (hr != S_OK) break; - break; + if (dataRead != sizeof(data)) + { + ret = xmlParseChunk(locator->pParserCtxt, data, 0, 1); + hr = ret != XML_ERR_OK ? E_FAIL : locator->ret; + break; + } } } + This->isParsing = FALSE; xmlFreeParserCtxt(locator->pParserCtxt);
1
0
0
0
Michael Stefaniuc : server: Remove casts to the type of the casted expression.
by Alexandre Julliard
21 Sep '11
21 Sep '11
Module: wine Branch: master Commit: 835171c2e0ccb5c81a1e1e89a7d73e076c3f815d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=835171c2e0ccb5c81a1e1e89a…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Sep 21 11:42:51 2011 +0200 server: Remove casts to the type of the casted expression. --- server/handle.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/handle.c b/server/handle.c index c7cd417..0fd155a 100644 --- a/server/handle.c +++ b/server/handle.c @@ -267,7 +267,7 @@ static obj_handle_t alloc_global_handle_no_access_check( void *obj, unsigned int { if (!global_table) { - if (!(global_table = (struct handle_table *)alloc_handle_table( NULL, 0 ))) + if (!(global_table = alloc_handle_table( NULL, 0 ))) return 0; make_object_static( &global_table->obj ); } @@ -336,7 +336,7 @@ struct handle_table *copy_handle_table( struct process *process, struct process assert( parent_table ); assert( parent_table->obj.ops == &handle_table_ops ); - if (!(table = (struct handle_table *)alloc_handle_table( process, parent_table->count ))) + if (!(table = alloc_handle_table( process, parent_table->count ))) return NULL; if ((table->last = parent_table->last) >= 0)
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
100
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
98
99
100
Results per page:
10
25
50
100
200