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
July 2012
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
712 discussions
Start a n
N
ew thread
Nikolay Sivov : kernel32: Fix base for value returned with LOCALE_RETURN_NUMBER.
by Alexandre Julliard
26 Jul '12
26 Jul '12
Module: wine Branch: master Commit: 9ba0cf76db843bc92598f6d344e452747722beda URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9ba0cf76db843bc92598f6d34…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jul 26 11:38:19 2012 +0400 kernel32: Fix base for value returned with LOCALE_RETURN_NUMBER. --- dlls/kernel32/locale.c | 8 ++++++-- dlls/kernel32/tests/locale.c | 28 ++++++++++++++++++---------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index 0afe89d..90603f2 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -1264,6 +1264,10 @@ INT WINAPI GetLocaleInfoA( LCID lcid, LCTYPE lctype, LPSTR buffer, INT len ) return ret; } +static int get_value_base_by_lctype( LCTYPE lctype ) +{ + return lctype == LOCALE_ILANGUAGE || lctype == LOCALE_IDEFAULTLANGUAGE ? 16 : 10; +} /****************************************************************************** * GetLocaleInfoW (KERNEL32.@) @@ -1317,7 +1321,7 @@ INT WINAPI GetLocaleInfoW( LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len ) if (ret > 0) { WCHAR *end; - UINT number = strtolW( tmp, &end, 10 ); + UINT number = strtolW( tmp, &end, get_value_base_by_lctype( lctype ) ); if (*end) /* invalid number */ { SetLastError( ERROR_INVALID_FLAGS ); @@ -1390,7 +1394,7 @@ INT WINAPI GetLocaleInfoW( LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len ) if (!tmp) return 0; memcpy( tmp, p + 1, *p * sizeof(WCHAR) ); tmp[*p] = 0; - number = strtolW( tmp, &end, 10 ); + number = strtolW( tmp, &end, get_value_base_by_lctype( lctype ) ); if (!*end) memcpy( buffer, &number, sizeof(number) ); else /* invalid number */ diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index 856b46e..82bfdec 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -139,7 +139,6 @@ static void test_GetLocaleInfoA(void) ret = GetLocaleInfoA(lcid, LOCALE_ILANGUAGE|LOCALE_RETURN_NUMBER, (char*)&val, sizeof(val)); ok(ret, "got %d\n", ret); -todo_wine ok(val == lcid, "got 0x%08x\n", val); /* en and ar use SUBLANG_NEUTRAL, but GetLocaleInfo assume SUBLANG_DEFAULT @@ -204,6 +203,7 @@ struct neutralsublang_name2_t { WCHAR name[3]; LCID lcid; LCID lcid_broken; + int todo; }; static const struct neutralsublang_name2_t neutralsublang_names2[] = { @@ -212,8 +212,8 @@ static const struct neutralsublang_name2_t neutralsublang_names2[] = { { {'d','e',0}, MAKELCID(MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT) }, { {'e','n',0}, MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT) }, { {'e','s',0}, MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH_MODERN), SORT_DEFAULT), - MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH), SORT_DEFAULT) /* vista */ }, - { {'g','a',0}, MAKELCID(MAKELANGID(LANG_IRISH, SUBLANG_IRISH_IRELAND), SORT_DEFAULT) }, + MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH), SORT_DEFAULT) /* vista */, 1 }, + { {'g','a',0}, MAKELCID(MAKELANGID(LANG_IRISH, SUBLANG_IRISH_IRELAND), SORT_DEFAULT), 0, 1 }, { {'i','t',0}, MAKELCID(MAKELANGID(LANG_ITALIAN, SUBLANG_ITALIAN), SORT_DEFAULT) }, { {'m','s',0}, MAKELCID(MAKELANGID(LANG_MALAY, SUBLANG_MALAY_MALAYSIA), SORT_DEFAULT) }, { {'n','l',0}, MAKELCID(MAKELANGID(LANG_DUTCH, SUBLANG_DUTCH), SORT_DEFAULT) }, @@ -221,7 +221,7 @@ static const struct neutralsublang_name2_t neutralsublang_names2[] = { { {'s','r',0}, MAKELCID(MAKELANGID(LANG_SERBIAN, SUBLANG_SERBIAN_CROATIA), SORT_DEFAULT) }, { {'s','v',0}, MAKELCID(MAKELANGID(LANG_SWEDISH, SUBLANG_SWEDISH), SORT_DEFAULT) }, { {'u','z',0}, MAKELCID(MAKELANGID(LANG_UZBEK, SUBLANG_UZBEK_LATIN), SORT_DEFAULT) }, - { {'z','h',0}, MAKELCID(MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED), SORT_DEFAULT) }, + { {'z','h',0}, MAKELCID(MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED), SORT_DEFAULT), 0, 1 }, { {0} } }; @@ -244,7 +244,6 @@ static void test_GetLocaleInfoW(void) ret = GetLocaleInfoW(lcid_en, LOCALE_ILANGUAGE|LOCALE_RETURN_NUMBER, (WCHAR*)&val, sizeof(val)/sizeof(WCHAR)); ok(ret, "got %d\n", ret); -todo_wine ok(val == lcid_en, "got 0x%08x\n", val); ret = GetLocaleInfoW(lcid_en_neut, LOCALE_SNAME, bufferW, COUNTOF(bufferW)); @@ -275,9 +274,15 @@ todo_wine val = 0; GetLocaleInfoW(MAKELCID(langid, SORT_DEFAULT), LOCALE_ILANGUAGE|LOCALE_RETURN_NUMBER, (WCHAR*)&val, sizeof(val)/sizeof(WCHAR)); - todo_wine - ok(val == ptr->lcid || broken(val == ptr->lcid_broken), "%s: got wrong lcid 0x%04x, expected 0x%04x\n", - wine_dbgstr_w(ptr->name), val, ptr->lcid); + if (ptr->todo) + { + todo_wine + ok(val == ptr->lcid || (val && broken(val == ptr->lcid_broken)), "%s: got wrong lcid 0x%04x, expected 0x%04x\n", + wine_dbgstr_w(ptr->name), val, ptr->lcid); + } + else + ok(val == ptr->lcid || (val && broken(val == ptr->lcid_broken)), "%s: got wrong lcid 0x%04x, expected 0x%04x\n", + wine_dbgstr_w(ptr->name), val, ptr->lcid); ptr++; } } @@ -3381,8 +3386,11 @@ todo_wine { val = 0; pGetLocaleInfoEx(ptr->name, LOCALE_ILANGUAGE|LOCALE_RETURN_NUMBER, (WCHAR*)&val, sizeof(val)/sizeof(WCHAR)); - todo_wine - ok(val == ptr->lcid, "%s: got wrong lcid 0x%04x, expected 0x%04x\n", wine_dbgstr_w(ptr->name), val, ptr->lcid); + if (ptr->todo) + todo_wine + ok(val == ptr->lcid, "%s: got wrong lcid 0x%04x, expected 0x%04x\n", wine_dbgstr_w(ptr->name), val, ptr->lcid); + else + ok(val == ptr->lcid, "%s: got wrong lcid 0x%04x, expected 0x%04x\n", wine_dbgstr_w(ptr->name), val, ptr->lcid); ptr++; } }
1
0
0
0
Nikolay Sivov : kernel32: Some test for handling locales specified by language only.
by Alexandre Julliard
26 Jul '12
26 Jul '12
Module: wine Branch: master Commit: 5b7efa8ea3d3651eb2a00d74de2eed4b1ad889ae URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5b7efa8ea3d3651eb2a00d74d…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jul 26 11:20:46 2012 +0400 kernel32: Some test for handling locales specified by language only. --- dlls/kernel32/tests/locale.c | 190 +++++++++++++++++++++++++++++++++++++++++- 1 files changed, 188 insertions(+), 2 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=5b7efa8ea3d3651eb2a00…
1
0
0
0
Jacek Caban : mshtml: Use inline wrappers and fixed found warnings.
by Alexandre Julliard
26 Jul '12
26 Jul '12
Module: wine Branch: master Commit: 6d2902f6804372a651c320930235dcd8eb48b2fc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6d2902f6804372a651c320930…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Jul 26 11:37:48 2012 +0200 mshtml: Use inline wrappers and fixed found warnings. --- dlls/mshtml/Makefile.in | 2 +- dlls/mshtml/editor.c | 14 ++++++------ dlls/mshtml/htmldoc.c | 10 ++++---- dlls/mshtml/htmldoc5.c | 2 +- dlls/mshtml/htmlelem.c | 6 ++-- dlls/mshtml/htmlelem2.c | 22 +++++++++--------- dlls/mshtml/htmlelemcol.c | 2 +- dlls/mshtml/htmlobject.c | 4 +- dlls/mshtml/mutation.c | 10 ++++---- dlls/mshtml/navigate.c | 14 ++++++------ dlls/mshtml/nsembed.c | 2 +- dlls/mshtml/nsevents.c | 2 +- dlls/mshtml/nsio.c | 52 ++++++++++++++++++++++---------------------- dlls/mshtml/oleobj.c | 2 +- dlls/mshtml/olewnd.c | 4 +- dlls/mshtml/persist.c | 8 +++--- dlls/mshtml/pluginhost.c | 2 +- dlls/mshtml/script.c | 30 +++++++++++++++++++------ dlls/mshtml/txtrange.c | 14 ++++++------ dlls/mshtml/view.c | 4 +- 20 files changed, 111 insertions(+), 95 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=6d2902f6804372a651c32…
1
0
0
0
Jacek Caban : widl: Added an extension that uses inline functions instead of macros for C interface calls .
by Alexandre Julliard
26 Jul '12
26 Jul '12
Module: wine Branch: master Commit: 6b34eea6fcab318153993a3a08345b5d1eab5c3d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6b34eea6fcab318153993a3a0…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Jul 26 11:35:43 2012 +0200 widl: Added an extension that uses inline functions instead of macros for C interface calls. --- tools/widl/header.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 41 insertions(+), 0 deletions(-) diff --git a/tools/widl/header.c b/tools/widl/header.c index 0b2b9d5..454b523 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -902,6 +902,43 @@ static void write_cpp_method_def(FILE *header, const type_t *iface) } } +static void write_inline_wrappers(FILE *header, const type_t *iface, const char *name) +{ + const statement_t *stmt; + int first_iface = 1; + + if (type_iface_get_inherit(iface)) + write_inline_wrappers(header, type_iface_get_inherit(iface), name); + + STATEMENTS_FOR_EACH_FUNC(stmt, type_iface_get_stmts(iface)) + { + const var_t *func = stmt->u.var; + + if (first_iface) + { + fprintf(header, "/*** %s methods ***/\n", iface->name); + first_iface = 0; + } + + if (!is_callas(func->attrs)) { + const var_t *arg; + + fprintf(header, "static FORCEINLINE "); + write_type_decl_left(header, type_function_get_rettype(func->type)); + fprintf(header, " %s_%s(", name, get_name(func)); + write_args(header, type_get_function_args(func->type), name, 1, FALSE); + fprintf(header, ") {\n"); + fprintf(header, " %s", is_void(type_function_get_rettype(func->type)) ? "" : "return "); + fprintf(header, "This->lpVtbl->%s(This", get_name(func)); + if (type_get_function_args(func->type)) + LIST_FOR_EACH_ENTRY( arg, type_get_function_args(func->type), const var_t, entry ) + fprintf(header, ",%s", arg->name); + fprintf(header, ");\n"); + fprintf(header, "}\n"); + } + } +} + static void do_write_c_method_def(FILE *header, const type_t *iface, const char *name) { const statement_t *stmt; @@ -1150,7 +1187,11 @@ static void write_com_interface_end(FILE *header, type_t *iface) fprintf(header, "#ifdef COBJMACROS\n"); /* dispinterfaces don't have real functions, so don't write macros for them, * only for the interface this interface inherits from, i.e. IDispatch */ + fprintf(header, "#ifndef WIDL_C_INLINE_WRAPPERS\n"); write_method_macro(header, dispinterface ? type_iface_get_inherit(iface) : iface, iface->name); + fprintf(header, "#else\n"); + write_inline_wrappers(header, dispinterface ? type_iface_get_inherit(iface) : iface, iface->name); + fprintf(header, "#endif\n"); fprintf(header, "#endif\n"); fprintf(header, "\n"); fprintf(header, "#endif\n");
1
0
0
0
Jacek Caban : activdbg.idl: Undef GetCurrentThread macro to avoid collision with interface function declaration .
by Alexandre Julliard
26 Jul '12
26 Jul '12
Module: wine Branch: master Commit: b06e8103f783584dfc9e306c441e469c8e9b8991 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b06e8103f783584dfc9e306c4…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Jul 26 11:34:46 2012 +0200 activdbg.idl: Undef GetCurrentThread macro to avoid collision with interface function declaration. --- include/activdbg.idl | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/activdbg.idl b/include/activdbg.idl index f3cdff1..e10066c 100644 --- a/include/activdbg.idl +++ b/include/activdbg.idl @@ -368,6 +368,7 @@ interface IDebugApplication32 : IRemoteDebugApplication [out] APPBREAKFLAGS *pabf, [out] IRemoteDebugApplicationThread **pprdatSteppingThread); + cpp_quote("#undef GetCurrentThread") HRESULT GetCurrentThread( [out] IDebugApplicationThread **pat);
1
0
0
0
Michael Stefaniuc : wined3d: Avoid TRUE-FALSE conditional expressions.
by Alexandre Julliard
26 Jul '12
26 Jul '12
Module: wine Branch: master Commit: 4ddfcc2cf15aeb5ba466c4727c8edc5529797ca6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4ddfcc2cf15aeb5ba466c4727…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Jul 26 11:28:32 2012 +0200 wined3d: Avoid TRUE-FALSE conditional expressions. --- dlls/wined3d/arb_program_shader.c | 2 +- dlls/wined3d/surface.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 6dfee32..744b6af 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -6999,7 +6999,7 @@ static void upload_palette(const struct wined3d_surface *surface, struct wined3d struct wined3d_device *device = surface->resource.device; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; struct arbfp_blit_priv *priv = device->blit_priv; - BOOL colorkey = (surface->CKeyFlags & WINEDDSD_CKSRCBLT) ? TRUE : FALSE; + BOOL colorkey = (surface->CKeyFlags & WINEDDSD_CKSRCBLT) != 0; d3dfmt_p8_init_palette(surface, table, colorkey); diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 38795c7..07b3d3a 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -4146,7 +4146,7 @@ void surface_internal_preload(struct wined3d_surface *surface, enum WINED3DSRGB /* TODO: Use already acquired context when possible. */ context = context_acquire(device, NULL); - surface_load(surface, srgb == SRGB_SRGB ? TRUE : FALSE); + surface_load(surface, srgb == SRGB_SRGB); if (surface->resource.pool == WINED3D_POOL_DEFAULT) { @@ -6352,7 +6352,7 @@ static void ffp_blit_free(struct wined3d_device *device) { } static void ffp_blit_p8_upload_palette(const struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info) { BYTE table[256][4]; - BOOL colorkey_active = (surface->CKeyFlags & WINEDDSD_CKSRCBLT) ? TRUE : FALSE; + BOOL colorkey_active = (surface->CKeyFlags & WINEDDSD_CKSRCBLT) != 0; GLenum target; if (surface->container.type == WINED3D_CONTAINER_TEXTURE)
1
0
0
0
Michael Stefaniuc : cabinet: Avoid TRUE-FALSE conditional expressions.
by Alexandre Julliard
26 Jul '12
26 Jul '12
Module: wine Branch: master Commit: f631780da4356943e91477fb7a393c10024b528a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f631780da4356943e91477fb7…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Jul 26 11:26:28 2012 +0200 cabinet: Avoid TRUE-FALSE conditional expressions. --- dlls/cabinet/fdi.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/cabinet/fdi.c b/dlls/cabinet/fdi.c index 7fcf4cb..3d1aec9 100644 --- a/dlls/cabinet/fdi.c +++ b/dlls/cabinet/fdi.c @@ -703,9 +703,9 @@ static BOOL FDI_read_entries( pfdici->cFiles = num_files; pfdici->setID = setid; pfdici->iCabinet = cabidx; - pfdici->fReserve = (flags & cfheadRESERVE_PRESENT) ? TRUE : FALSE; - pfdici->hasprev = (flags & cfheadPREV_CABINET) ? TRUE : FALSE; - pfdici->hasnext = (flags & cfheadNEXT_CABINET) ? TRUE : FALSE; + pfdici->fReserve = (flags & cfheadRESERVE_PRESENT) != 0; + pfdici->hasprev = (flags & cfheadPREV_CABINET) != 0; + pfdici->hasnext = (flags & cfheadNEXT_CABINET) != 0; return TRUE; } @@ -2815,7 +2815,7 @@ BOOL __cdecl FDICopy( fdin.pv = pvUser; fdin.psz1 = (char *)file->filename; fdin.hf = filehf; - fdin.cb = (file->attribs & cffile_A_EXEC) ? TRUE : FALSE; /* FIXME: is that right? */ + fdin.cb = (file->attribs & cffile_A_EXEC) != 0; /* FIXME: is that right? */ fdin.date = file->date; fdin.time = file->time; fdin.attribs = file->attribs; /* FIXME: filter _A_EXEC? */
1
0
0
0
Michael Stefaniuc : mlang/tests: Simplify the "pointer to start of array" idiom.
by Alexandre Julliard
26 Jul '12
26 Jul '12
Module: wine Branch: master Commit: 3a51439fc9036729ebc4b45d146985c9a05263c9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3a51439fc9036729ebc4b45d1…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Jul 26 11:23:34 2012 +0200 mlang/tests: Simplify the "pointer to start of array" idiom. --- dlls/mlang/tests/mlang.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/mlang/tests/mlang.c b/dlls/mlang/tests/mlang.c index 7ff4ec3..91463f9 100644 --- a/dlls/mlang/tests/mlang.c +++ b/dlls/mlang/tests/mlang.c @@ -677,7 +677,7 @@ static void test_EnumCodePages(IMultiLanguage2 *iML2, DWORD flags) n = 0; ret = IEnumCodePage_Next(iEnumCP, 1, &cpinfo2, &n); ok(n == 1 && ret == S_OK, "IEnumCodePage_Next: expected 1/S_OK, got %u/%08x\n", n, ret); - cpinfo_cmp(&cpinfo[0], &cpinfo2); + cpinfo_cmp(cpinfo, &cpinfo2); if (0) { @@ -782,7 +782,7 @@ static void test_EnumScripts(IMultiLanguage2 *iML2, DWORD flags) n = 0; ret = IEnumScript_Next(iEnumScript, 1, &sinfo2, &n); ok(n == 1 && ret == S_OK, "IEnumScript_Next: expected 1/S_OK, got %u/%08x\n", n, ret); - scriptinfo_cmp(&sinfo[0], &sinfo2); + scriptinfo_cmp(sinfo, &sinfo2); if (0) { @@ -861,7 +861,7 @@ static void IMLangFontLink_Test(IMLangFontLink* iMLFL) dwCodePages = 0; processed = 0; - ret = IMLangFontLink_GetStrCodePages(iMLFL, &str[0], 1, 0, &dwCodePages, &processed); + ret = IMLangFontLink_GetStrCodePages(iMLFL, str, 1, 0, &dwCodePages, &processed); ok(ret == S_OK, "IMLangFontLink_GetStrCodePages error %x\n", ret); ok(dwCodePages == dwCmpCodePages, "expected %x, got %x\n", dwCmpCodePages, dwCodePages); ok(processed == 1, "expected 1, got %d\n", processed);
1
0
0
0
Dmitry Timoshkov : gdiplus: Add some GdipTransformPoints tests for a device with different x/ y resolutions.
by Alexandre Julliard
26 Jul '12
26 Jul '12
Module: wine Branch: master Commit: e6c69e9685d355a7c2aff55b46b1accfd08f1f7f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e6c69e9685d355a7c2aff55b4…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Wed Jul 25 14:52:46 2012 +0900 gdiplus: Add some GdipTransformPoints tests for a device with different x/y resolutions. --- dlls/gdiplus/tests/graphics.c | 101 ++++++++++++++++++++++++++++++++++++++++- 1 files changed, 100 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 7c53ced..e6b6513 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -26,7 +26,7 @@ #define expect(expected, got) ok((got) == (expected), "Expected %d, got %d\n", (INT)(expected), (INT)(got)) #define expectf_(expected, got, precision) ok(fabs((expected) - (got)) < (precision), "Expected %f, got %f\n", (expected), (got)) -#define expectf(expected, got) expectf_((expected), (got), 0.0001) +#define expectf(expected, got) expectf_((expected), (got), 0.001) #define TABLE_LEN (23) static HWND hwnd; @@ -3398,6 +3398,104 @@ static void test_GdipMeasureString(void) DeleteDC(hdc); } +static GpGraphics *create_graphics(REAL res_x, REAL res_y, GpUnit unit, REAL scale) +{ + GpStatus status; + union + { + GpBitmap *bitmap; + GpImage *image; + } u; + GpGraphics *graphics = NULL; + REAL res; + + status = GdipCreateBitmapFromScan0(1, 1, 4, PixelFormat24bppRGB, NULL, &u.bitmap); + expect(Ok, status); + + status = GdipBitmapSetResolution(u.bitmap, res_x, res_y); + expect(Ok, status); + status = GdipGetImageHorizontalResolution(u.image, &res); + expect(Ok, status); + expectf(res_x, res); + status = GdipGetImageVerticalResolution(u.image, &res); + expect(Ok, status); + expectf(res_y, res); + + status = GdipGetImageGraphicsContext(u.image, &graphics); + expect(Ok, status); + status = GdipDisposeImage(u.image); + expect(Ok, status); + + status = GdipGetDpiX(graphics, &res); + expect(Ok, status); + expectf(res_x, res); + status = GdipGetDpiY(graphics, &res); + expect(Ok, status); + expectf(res_y, res); + + status = GdipSetPageUnit(graphics, unit); + expect(Ok, status); + status = GdipSetPageScale(graphics, scale); + expect(Ok, status); + + return graphics; +} + +static void test_transform(void) +{ + static const struct test_data + { + REAL res_x, res_y, scale; + GpUnit unit; + GpPointF in[2], out[2]; + } td[] = + { + { 96.0, 96.0, 1.0, UnitPixel, + { { 100.0, 0.0 }, { 0.0, 100.0 } }, { { 100.0, 0.0 }, { 0.0, 100.0 } } }, + { 96.0, 96.0, 1.0, UnitDisplay, + { { 100.0, 0.0 }, { 0.0, 100.0 } }, { { 100.0, 0.0 }, { 0.0, 100.0 } } }, + { 96.0, 96.0, 1.0, UnitInch, + { { 100.0, 0.0 }, { 0.0, 100.0 } }, { { 9600.0, 0.0 }, { 0.0, 9600.0 } } }, + { 123.0, 456.0, 1.0, UnitPoint, + { { 100.0, 0.0 }, { 0.0, 100.0 } }, { { 170.833313, 0.0 }, { 0.0, 633.333252 } } }, + { 123.0, 456.0, 1.0, UnitDocument, + { { 100.0, 0.0 }, { 0.0, 100.0 } }, { { 40.999996, 0.0 }, { 0.0, 151.999985 } } }, + { 123.0, 456.0, 2.0, UnitMillimeter, + { { 100.0, 0.0 }, { 0.0, 100.0 } }, { { 968.503845, 0.0 }, { 0.0, 3590.550781 } } }, + { 196.0, 296.0, 1.0, UnitDisplay, + { { 100.0, 0.0 }, { 0.0, 100.0 } }, { { 100.0, 0.0 }, { 0.0, 100.0 } } }, + { 196.0, 296.0, 1.0, UnitPixel, + { { 100.0, 0.0 }, { 0.0, 100.0 } }, { { 100.0, 0.0 }, { 0.0, 100.0 } } }, + }; + GpStatus status; + GpGraphics *graphics; + GpPointF ptf[2]; + UINT i; + + for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) + { + graphics = create_graphics(td[i].res_x, td[i].res_y, td[i].unit, td[i].scale); + ptf[0].X = td[i].in[0].X; + ptf[0].Y = td[i].in[0].Y; + ptf[1].X = td[i].in[1].X; + ptf[1].Y = td[i].in[1].Y; + status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, ptf, 2); + expect(Ok, status); + expectf(td[i].out[0].X, ptf[0].X); + expectf(td[i].out[0].Y, ptf[0].Y); + expectf(td[i].out[1].X, ptf[1].X); + expectf(td[i].out[1].Y, ptf[1].Y); + status = GdipTransformPoints(graphics, CoordinateSpaceWorld, CoordinateSpaceDevice, ptf, 2); + expect(Ok, status); + expectf(td[i].in[0].X, ptf[0].X); + expectf(td[i].in[0].Y, ptf[0].Y); + expectf(td[i].in[1].X, ptf[1].X); + expectf(td[i].in[1].Y, ptf[1].Y); + status = GdipDeleteGraphics(graphics); + expect(Ok, status); + } +} + START_TEST(graphics) { struct GdiplusStartupInput gdiplusStartupInput; @@ -3424,6 +3522,7 @@ START_TEST(graphics) GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); + test_transform(); test_GdipMeasureString(); test_constructor_destructor(); test_save_restore();
1
0
0
0
Dmitry Timoshkov : gdiplus: Store device resolution in the graphics object.
by Alexandre Julliard
26 Jul '12
26 Jul '12
Module: wine Branch: master Commit: e536a128f7e14f755d6a24395a54ab925aec4616 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e536a128f7e14f755d6a24395…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Jul 24 17:18:48 2012 +0900 gdiplus: Store device resolution in the graphics object. --- dlls/gdiplus/gdiplus_private.h | 1 + dlls/gdiplus/graphics.c | 50 +++++++++++++++++++-------------------- dlls/gdiplus/image.c | 4 +++ dlls/gdiplus/tests/image.c | 31 ++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 26 deletions(-) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 5d1c685..0c7e055 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -156,6 +156,7 @@ struct GpGraphics{ TextRenderingHint texthint; GpUnit unit; /* page unit */ REAL scale; /* page scale */ + REAL xres, yres; GpMatrix * worldtrans; /* world transform */ BOOL busy; /* hdc handle obtained by GdipGetDC */ GpRegion *clip; diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 5dcd30a..5ad2f56 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -84,12 +84,6 @@ static BYTE convert_path_point_type(BYTE type) return ret; } -static REAL graphics_res(GpGraphics *graphics) -{ - if (graphics->image) return graphics->image->xres; - else return (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSX); -} - static COLORREF get_gdi_brush_color(const GpBrush *brush) { ARGB argb; @@ -260,7 +254,7 @@ static INT prepare_dc(GpGraphics *graphics, GpPen *pen) width = sqrt((pt[1].X - pt[0].X) * (pt[1].X - pt[0].X) + (pt[1].Y - pt[0].Y) * (pt[1].Y - pt[0].Y)) / sqrt(2.0); - width *= pen->width * convert_unit(graphics_res(graphics), + width *= pen->width * convert_unit(graphics->xres, pen->unit == UnitWorld ? graphics->unit : pen->unit); } @@ -313,18 +307,22 @@ static GpStatus get_graphics_transform(GpGraphics *graphics, GpCoordinateSpace d static void transform_and_round_points(GpGraphics *graphics, POINT *pti, GpPointF *ptf, INT count) { - REAL unitscale; + REAL scale_x, scale_y; GpMatrix *matrix; int i; - unitscale = convert_unit(graphics_res(graphics), graphics->unit); + scale_x = convert_unit(graphics->xres, graphics->unit); + scale_y = convert_unit(graphics->yres, graphics->unit); /* apply page scale */ if(graphics->unit != UnitDisplay) - unitscale *= graphics->scale; + { + scale_x *= graphics->scale; + scale_y *= graphics->scale; + } GdipCloneMatrix(graphics->worldtrans, &matrix); - GdipScaleMatrix(matrix, unitscale, unitscale, MatrixOrderAppend); + GdipScaleMatrix(matrix, scale_x, scale_y, MatrixOrderAppend); GdipTransformMatrixPoints(matrix, ptf, count); GdipDeleteMatrix(matrix); @@ -2200,6 +2198,8 @@ GpStatus WINGDIPAPI GdipCreateFromHDC2(HDC hdc, HANDLE hDevice, GpGraphics **gra (*graphics)->compmode = CompositingModeSourceOver; (*graphics)->unit = UnitDisplay; (*graphics)->scale = 1.0; + (*graphics)->xres = GetDeviceCaps(hdc, LOGPIXELSX); + (*graphics)->yres = GetDeviceCaps(hdc, LOGPIXELSY); (*graphics)->busy = FALSE; (*graphics)->textcontrast = 4; list_init(&(*graphics)->containers); @@ -2239,6 +2239,8 @@ GpStatus graphics_from_image(GpImage *image, GpGraphics **graphics) (*graphics)->compmode = CompositingModeSourceOver; (*graphics)->unit = UnitDisplay; (*graphics)->scale = 1.0; + (*graphics)->xres = image->xres; + (*graphics)->yres = image->yres; (*graphics)->busy = FALSE; (*graphics)->textcontrast = 4; list_init(&(*graphics)->containers); @@ -5792,11 +5794,7 @@ GpStatus WINGDIPAPI GdipGetDpiX(GpGraphics *graphics, REAL* dpi) if(graphics->busy) return ObjectBusy; - if (graphics->image) - *dpi = graphics->image->xres; - else - *dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSX); - + *dpi = graphics->xres; return Ok; } @@ -5810,11 +5808,7 @@ GpStatus WINGDIPAPI GdipGetDpiY(GpGraphics *graphics, REAL* dpi) if(graphics->busy) return ObjectBusy; - if (graphics->image) - *dpi = graphics->image->yres; - else - *dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSY); - + *dpi = graphics->yres; return Ok; } @@ -5999,14 +5993,18 @@ static GpStatus get_graphics_transform(GpGraphics *graphics, GpCoordinateSpace d GpCoordinateSpace src_space, GpMatrix **matrix) { GpStatus stat = GdipCreateMatrix(matrix); - REAL unitscale; + REAL scale_x, scale_y; if (dst_space != src_space && stat == Ok) { - unitscale = convert_unit(graphics_res(graphics), graphics->unit); + scale_x = convert_unit(graphics->xres, graphics->unit); + scale_y = convert_unit(graphics->yres, graphics->unit); if(graphics->unit != UnitDisplay) - unitscale *= graphics->scale; + { + scale_x *= graphics->scale; + scale_y *= graphics->scale; + } /* transform from src_space to CoordinateSpacePage */ switch (src_space) @@ -6017,7 +6015,7 @@ static GpStatus get_graphics_transform(GpGraphics *graphics, GpCoordinateSpace d case CoordinateSpacePage: break; case CoordinateSpaceDevice: - GdipScaleMatrix(*matrix, 1.0/unitscale, 1.0/unitscale, MatrixOrderAppend); + GdipScaleMatrix(*matrix, 1.0/scale_x, 1.0/scale_y, MatrixOrderAppend); break; } @@ -6040,7 +6038,7 @@ static GpStatus get_graphics_transform(GpGraphics *graphics, GpCoordinateSpace d case CoordinateSpacePage: break; case CoordinateSpaceDevice: - GdipScaleMatrix(*matrix, unitscale, unitscale, MatrixOrderAppend); + GdipScaleMatrix(*matrix, scale_x, scale_y, MatrixOrderAppend); break; } } diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 9972f40..f415a45 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -2305,7 +2305,11 @@ GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage *image, stat = GdipCreateFromHDC(hdc, graphics); if (stat == Ok) + { (*graphics)->image = image; + (*graphics)->xres = image->xres; + (*graphics)->yres = image->yres; + } } else if (image->type == ImageTypeMetafile) stat = METAFILE_GetGraphicsContext((GpMetafile*)image, graphics); diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 3d17f3d..0595cc2 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -1517,6 +1517,7 @@ static void test_resolution(void) { GpStatus stat; GpBitmap *bitmap; + GpGraphics *graphics; REAL res=-1.0; HDC screendc; int screenxres, screenyres; @@ -1560,6 +1561,15 @@ static void test_resolution(void) expect(Ok, stat); expectf((REAL)screenyres, res); + stat = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); + expect(Ok, stat); + stat = GdipGetDpiX(graphics, &res); + expect(Ok, stat); + expectf((REAL)screenxres, res); + stat = GdipGetDpiY(graphics, &res); + expect(Ok, stat); + expectf((REAL)screenyres, res); + /* test changing the resolution */ stat = GdipBitmapSetResolution(bitmap, screenxres*2.0, screenyres*3.0); expect(Ok, stat); @@ -1572,6 +1582,27 @@ static void test_resolution(void) expect(Ok, stat); expectf(screenyres*3.0, res); + stat = GdipGetDpiX(graphics, &res); + expect(Ok, stat); + expectf((REAL)screenxres, res); + stat = GdipGetDpiY(graphics, &res); + expect(Ok, stat); + expectf((REAL)screenyres, res); + + stat = GdipDeleteGraphics(graphics); + expect(Ok, stat); + + stat = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); + expect(Ok, stat); + stat = GdipGetDpiX(graphics, &res); + expect(Ok, stat); + expectf(screenxres*2.0, res); + stat = GdipGetDpiY(graphics, &res); + expect(Ok, stat); + expectf(screenyres*3.0, res); + stat = GdipDeleteGraphics(graphics); + expect(Ok, stat); + stat = GdipDisposeImage((GpImage*)bitmap); expect(Ok, stat); }
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
72
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Results per page:
10
25
50
100
200