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 2018
----- 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
405 discussions
Start a n
N
ew thread
Józef Kucia : libs/vkd3d: Return E_INVALIDARG for invalid pipeline state desc.
by Alexandre Julliard
18 Jul '18
18 Jul '18
Module: vkd3d Branch: master Commit: 7892a1e938463cce4a5591c5d79ffe17c540f961 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=7892a1e938463cce4a5591c…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Jul 18 12:05:45 2018 +0200 libs/vkd3d: Return E_INVALIDARG for invalid pipeline state desc. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d/state.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 1c550e2..861f5bb 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -1866,7 +1866,7 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s if (!(format = vkd3d_get_format(desc->DSVFormat, true))) { WARN("Invalid DXGI format %#x.\n", desc->DSVFormat); - hr = E_FAIL; + hr = E_INVALIDARG; goto fail; } @@ -1915,7 +1915,7 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s if (!(format = vkd3d_get_format(desc->RTVFormats[i], false))) { WARN("Invalid DXGI format %#x.\n", desc->RTVFormats[i]); - hr = E_FAIL; + hr = E_INVALIDARG; goto fail; } @@ -2007,14 +2007,14 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s if (!(format = vkd3d_get_format(e->Format, false))) { WARN("Invalid DXGI format %#x.\n", e->Format); - hr = E_FAIL; + hr = E_INVALIDARG; goto fail; } if (e->InputSlot >= ARRAY_SIZE(graphics->input_rates)) { WARN("Invalid input slot %#x.\n", e->InputSlot); - hr = E_FAIL; + hr = E_INVALIDARG; goto fail; } @@ -2048,7 +2048,7 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s default: FIXME("Unhandled input slot class %#x on input element %u.\n", e->InputSlotClass, i); - hr = E_FAIL; + hr = E_INVALIDARG; goto fail; } @@ -2056,7 +2056,7 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s { FIXME("Input slot class %#x on input element %u conflicts with earlier input slot class %#x.\n", e->InputSlotClass, e->InputSlot, graphics->input_rates[e->InputSlot]); - hr = E_FAIL; + hr = E_INVALIDARG; goto fail; } graphics->input_rates[e->InputSlot] = input_rate;
1
0
0
0
Józef Kucia : libs/vkd3d: Process shader stages according to pipeline order.
by Alexandre Julliard
18 Jul '18
18 Jul '18
Module: vkd3d Branch: master Commit: d266a5f7d05c9ddf6983e64d3f4d1a2bffcf19c5 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=d266a5f7d05c9ddf6983e64…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Jul 18 12:05:44 2018 +0200 libs/vkd3d: Process shader stages according to pipeline order. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d/state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 19e6549..1c550e2 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -1829,10 +1829,10 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s shader_stages[] = { {VK_SHADER_STAGE_VERTEX_BIT, offsetof(D3D12_GRAPHICS_PIPELINE_STATE_DESC, VS)}, - {VK_SHADER_STAGE_FRAGMENT_BIT, offsetof(D3D12_GRAPHICS_PIPELINE_STATE_DESC, PS)}, - {VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, offsetof(D3D12_GRAPHICS_PIPELINE_STATE_DESC, DS)}, {VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT, offsetof(D3D12_GRAPHICS_PIPELINE_STATE_DESC, HS)}, + {VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, offsetof(D3D12_GRAPHICS_PIPELINE_STATE_DESC, DS)}, {VK_SHADER_STAGE_GEOMETRY_BIT, offsetof(D3D12_GRAPHICS_PIPELINE_STATE_DESC, GS)}, + {VK_SHADER_STAGE_FRAGMENT_BIT, offsetof(D3D12_GRAPHICS_PIPELINE_STATE_DESC, PS)}, }; state->ID3D12PipelineState_iface.lpVtbl = &d3d12_pipeline_state_vtbl;
1
0
0
0
Józef Kucia : libs/vkd3d-shader: Add debug name for vDomainLocation register.
by Alexandre Julliard
18 Jul '18
18 Jul '18
Module: vkd3d Branch: master Commit: 6e8dae9d625bf7e281b1d3f49afe2efefe9a836f URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=6e8dae9d625bf7e281b1d3f…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Jul 18 12:05:43 2018 +0200 libs/vkd3d-shader: Add debug name for vDomainLocation register. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/spirv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 3260b28..d236db9 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2160,6 +2160,9 @@ static bool vkd3d_dxbc_compiler_get_register_name(char *buffer, unsigned int buf case VKD3DSPR_DEPTHOUT: snprintf(buffer, buffer_size, "oDepth"); break; + case VKD3DSPR_TESSCOORD: + snprintf(buffer, buffer_size, "vDomainLocation"); + break; case VKD3DSPR_THREADID: snprintf(buffer, buffer_size, "vThreadID"); break;
1
0
0
0
Józef Kucia : libs/vkd3d-shader: Treat vicp register as regular shader input.
by Alexandre Julliard
18 Jul '18
18 Jul '18
Module: vkd3d Branch: master Commit: 054b1e41dd62a60d006c3b8a0cba19e07ad3154d URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=054b1e41dd62a60d006c3b8…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Jul 18 12:05:42 2018 +0200 libs/vkd3d-shader: Treat vicp register as regular shader input. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/spirv.c | 11 +++++++---- libs/vkd3d-shader/vkd3d_shader_private.h | 5 +++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 1755c25..3260b28 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -1729,7 +1729,7 @@ static void vkd3d_symbol_make_register(struct vkd3d_symbol *symbol, symbol->type = VKD3D_SYMBOL_REGISTER; memset(&symbol->key, 0, sizeof(symbol->key)); symbol->key.reg.type = reg->type; - if (reg->type == VKD3DSPR_INPUT && reg->idx[1].offset != ~0u) + if (vkd3d_shader_register_is_input(reg) && reg->idx[1].offset != ~0u) symbol->key.reg.idx = reg->idx[1].offset; else if (reg->type != VKD3DSPR_IMMCONSTBUFFER) symbol->key.reg.idx = reg->idx[0].offset; @@ -2150,6 +2150,9 @@ static bool vkd3d_dxbc_compiler_get_register_name(char *buffer, unsigned int buf case VKD3DSPR_INPUT: snprintf(buffer, buffer_size, "v%u", idx); break; + case VKD3DSPR_INCONTROLPOINT: + snprintf(buffer, buffer_size, "vicp%u", idx); + break; case VKD3DSPR_OUTPUT: case VKD3DSPR_COLOROUT: snprintf(buffer, buffer_size, "o%u", idx); @@ -3755,10 +3758,10 @@ static void vkd3d_dxbc_compiler_emit_dcl_input(struct vkd3d_dxbc_compiler *compi { const struct vkd3d_shader_dst_param *dst = &instruction->declaration.dst; - if (dst->reg.type != VKD3DSPR_INPUT) - vkd3d_dxbc_compiler_emit_input_register(compiler, dst); - else + if (vkd3d_shader_register_is_input(&dst->reg)) vkd3d_dxbc_compiler_emit_input(compiler, dst, VKD3D_SIV_NONE); + else + vkd3d_dxbc_compiler_emit_input_register(compiler, dst); } static void vkd3d_dxbc_compiler_emit_interpolation_decorations(struct vkd3d_dxbc_compiler *compiler, diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 9eb2c12..b1eadde 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -778,6 +778,11 @@ static inline BOOL vkd3d_shader_instruction_has_texel_offset(const struct vkd3d_ return ins->texel_offset.u || ins->texel_offset.v || ins->texel_offset.w; } +static inline bool vkd3d_shader_register_is_input(const struct vkd3d_shader_register *reg) +{ + return reg->type == VKD3DSPR_INPUT || reg->type == VKD3DSPR_INCONTROLPOINT; +} + void vkd3d_shader_trace(void *data) DECLSPEC_HIDDEN; void *shader_sm4_init(const DWORD *byte_code, size_t byte_code_size,
1
0
0
0
Józef Kucia : libs/vkd3d-shader: Enable arrayed inputs for all shader types.
by Alexandre Julliard
18 Jul '18
18 Jul '18
Module: vkd3d Branch: master Commit: faa11182023453ad2f3bfcec840bd185079897c4 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=faa11182023453ad2f3bfce…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Jul 18 12:05:41 2018 +0200 libs/vkd3d-shader: Enable arrayed inputs for all shader types. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/spirv.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index bfa2bc0..1755c25 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -3000,11 +3000,6 @@ static const struct vkd3d_shader_signature_element *vkd3d_find_signature_element return NULL; } -static bool vkd3d_dxbc_compiler_is_input_arrayed(struct vkd3d_dxbc_compiler *compiler) -{ - return compiler->shader_type == VKD3D_SHADER_TYPE_GEOMETRY; -} - static uint32_t vkd3d_dxbc_compiler_emit_input(struct vkd3d_dxbc_compiler *compiler, const struct vkd3d_shader_dst_param *dst, enum vkd3d_shader_input_sysval_semantic sysval) { @@ -3027,7 +3022,7 @@ static uint32_t vkd3d_dxbc_compiler_emit_input(struct vkd3d_dxbc_compiler *compi assert(!reg->idx[0].rel_addr); assert(!reg->idx[1].rel_addr); - if (vkd3d_dxbc_compiler_is_input_arrayed(compiler)) + if (reg->idx[1].offset != ~0u) { array_size = reg->idx[0].offset; reg_idx = reg->idx[1].offset;
1
0
0
0
Michael Stefaniuc : oledlg: Use the ARRAY_SIZE() macro.
by Alexandre Julliard
17 Jul '18
17 Jul '18
Module: wine Branch: master Commit: b03718f09cfad27335b9c13f5eb1152a4794f4b3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b03718f09cfad27335b9c13f…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Jul 17 21:20:07 2018 +0200 oledlg: Use the ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oledlg/insobjdlg.c | 2 +- dlls/oledlg/oledlg_main.c | 8 ++++---- dlls/oledlg/pastespl.c | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/oledlg/insobjdlg.c b/dlls/oledlg/insobjdlg.c index 506196e..00b991e 100644 --- a/dlls/oledlg/insobjdlg.c +++ b/dlls/oledlg/insobjdlg.c @@ -350,7 +350,7 @@ static BOOL UIINSERTOBJECTDLG_PopulateObjectTypes(InsertObjectDlgInfo* pdlgInfo) RegOpenKeyExW(HKEY_CLASSES_ROOT, szClsid, 0, KEY_READ, &hkclsids); - while (ERROR_SUCCESS == (ret = RegEnumKeyW(hkclsids, index, szclsid, sizeof(szclsid)/sizeof(szclsid[0])))) + while (ERROR_SUCCESS == (ret = RegEnumKeyW(hkclsids, index, szclsid, ARRAY_SIZE(szclsid)))) { index++; diff --git a/dlls/oledlg/oledlg_main.c b/dlls/oledlg/oledlg_main.c index 8ba9f17..ba5b7c8 100644 --- a/dlls/oledlg/oledlg_main.c +++ b/dlls/oledlg/oledlg_main.c @@ -181,7 +181,7 @@ BOOL WINAPI OleUIAddVerbMenuW(IOleObject *object, LPCWSTR shorttype, if (object) IOleObject_EnumVerbs(object, &enumverbs); - LoadStringW(OLEDLG_hInstance, IDS_VERBMENU_OBJECT, resstrW, sizeof(resstrW)/sizeof(WCHAR)); + LoadStringW(OLEDLG_hInstance, IDS_VERBMENU_OBJECT, resstrW, ARRAY_SIZE(resstrW)); /* no object, or object without enumeration support */ if (!object || !enumverbs) { RemoveMenu(hMenu, uPos, MF_BYPOSITION); @@ -202,7 +202,7 @@ BOOL WINAPI OleUIAddVerbMenuW(IOleObject *object, LPCWSTR shorttype, singleverb = get_next_insertable_verb(enumverbs, idmin, idmax, &verb) != S_OK; if (singleverb && !addConvert) { - LoadStringW(OLEDLG_hInstance, IDS_VERBMENU_SINGLEVERB_OBJECT, resstrW, sizeof(resstrW)/sizeof(WCHAR)); + LoadStringW(OLEDLG_hInstance, IDS_VERBMENU_SINGLEVERB_OBJECT, resstrW, ARRAY_SIZE(resstrW)); args[0] = (DWORD_PTR)firstverb.lpszVerbName; args[1] = (DWORD_PTR)objecttype; @@ -235,7 +235,7 @@ BOOL WINAPI OleUIAddVerbMenuW(IOleObject *object, LPCWSTR shorttype, /* convert verb is at the bottom of a popup, separated from verbs */ if (addConvert) { - LoadStringW(OLEDLG_hInstance, IDS_VERBMENU_CONVERT, resstrW, sizeof(resstrW)/sizeof(WCHAR)); + LoadStringW(OLEDLG_hInstance, IDS_VERBMENU_CONVERT, resstrW, ARRAY_SIZE(resstrW)); InsertMenuW(submenu, ~0, MF_BYPOSITION|MF_SEPARATOR, 0, NULL); InsertMenuW(submenu, ~0, MF_BYPOSITION|MF_STRING, idConvert, resstrW); } @@ -244,7 +244,7 @@ BOOL WINAPI OleUIAddVerbMenuW(IOleObject *object, LPCWSTR shorttype, *ret_submenu = submenu; /* now submenu is ready, add root entry to original menu, attach submenu */ - LoadStringW(OLEDLG_hInstance, IDS_VERBMENU_OBJECT_WITH_NAME, resstrW, sizeof(resstrW)/sizeof(WCHAR)); + LoadStringW(OLEDLG_hInstance, IDS_VERBMENU_OBJECT_WITH_NAME, resstrW, ARRAY_SIZE(resstrW)); args[0] = (DWORD_PTR)objecttype; FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_ARGUMENT_ARRAY, diff --git a/dlls/oledlg/pastespl.c b/dlls/oledlg/pastespl.c index 530c4ed..0b8c8c9 100644 --- a/dlls/oledlg/pastespl.c +++ b/dlls/oledlg/pastespl.c @@ -182,14 +182,14 @@ static void get_descriptors(HWND hdlg, ps_struct_t *ps_struct) if(ps_struct->source_name == NULL && ps_struct->link_source_name == NULL) { WCHAR buf[200]; - LoadStringW(OLEDLG_hInstance, IDS_PS_UNKNOWN_SRC, buf, sizeof(buf)/sizeof(WCHAR)); + LoadStringW(OLEDLG_hInstance, IDS_PS_UNKNOWN_SRC, buf, ARRAY_SIZE(buf)); ps_struct->source_name = strdupW(buf); } if(ps_struct->type_name == NULL && ps_struct->link_type_name == NULL) { WCHAR buf[200]; - LoadStringW(OLEDLG_hInstance, IDS_PS_UNKNOWN_TYPE, buf, sizeof(buf)/sizeof(WCHAR)); + LoadStringW(OLEDLG_hInstance, IDS_PS_UNKNOWN_TYPE, buf, ARRAY_SIZE(buf)); ps_struct->type_name = strdupW(buf); } } @@ -228,7 +228,7 @@ static DWORD init_pastelist(HWND hdlg, OLEUIPASTESPECIALW *ps) } /* The native version grabs only the first 20 fmts and we do the same */ - hr = IEnumFORMATETC_Next(penum, sizeof(fmts)/sizeof(fmts[0]), fmts, &fetched); + hr = IEnumFORMATETC_Next(penum, ARRAY_SIZE(fmts), fmts, &fetched); TRACE("got %d formats hr %08x\n", fetched, hr); if(SUCCEEDED(hr)) @@ -431,7 +431,7 @@ static void update_result_text(HWND hdlg, const ps_struct_t *ps_struct) res_id = IDS_PS_PASTE_LINK_DATA; } - LoadStringW(OLEDLG_hInstance, res_id, resource_txt, sizeof(resource_txt)/sizeof(WCHAR)); + LoadStringW(OLEDLG_hInstance, res_id, resource_txt, ARRAY_SIZE(resource_txt)); if((ptr = strstrW(resource_txt, percent_s))) { /* FIXME handle %s in ResultText. Sub appname if IDS_PS_PASTE_OBJECT{_AS_ICON}. Else sub appropriate type name */
1
0
0
0
Michael Stefaniuc : ntdll/tests: Avoid temp variables holding ARRAY_SIZE results.
by Alexandre Julliard
17 Jul '18
17 Jul '18
Module: wine Branch: master Commit: 9f7d802341c9714cc98318805dc45daf438565a2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9f7d802341c9714cc9831880…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Jul 17 21:20:05 2018 +0200 ntdll/tests: Avoid temp variables holding ARRAY_SIZE results. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/rtl.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c index 22f3df9..07fa1cd 100644 --- a/dlls/ntdll/tests/rtl.c +++ b/dlls/ntdll/tests/rtl.c @@ -1239,7 +1239,6 @@ static struct { "::1", STATUS_INVALID_PARAMETER, 0, { -1 } }, { ":1", STATUS_INVALID_PARAMETER, 0, { -1 } }, }; -const unsigned int ipv4_testcount = sizeof(ipv4_tests) / sizeof(ipv4_tests[0]); static void init_ip4(IN_ADDR* addr, const int src[4]) { @@ -1284,7 +1283,7 @@ static void test_RtlIpv4StringToAddress(void) */ } - for (i = 0; i < ipv4_testcount; i++) + for (i = 0; i < ARRAY_SIZE(ipv4_tests); i++) { /* non-strict */ terminator = &dummy; @@ -1361,7 +1360,6 @@ static void test_RtlIpv4StringToAddressEx(void) { "1.2.3.4: 1234", STATUS_INVALID_PARAMETER, { 1, 2, 3, 4 }, 0xdead }, { "1.2.3.4:\t1234", STATUS_INVALID_PARAMETER, { 1, 2, 3, 4 }, 0xdead }, }; - const unsigned int ipv4_ex_testcount = sizeof(ipv4_ex_tests) / sizeof(ipv4_ex_tests[0]); unsigned int i; BOOLEAN strict; @@ -1395,7 +1393,7 @@ static void test_RtlIpv4StringToAddressEx(void) ok(port == 0xdead, "RtlIpv4StringToAddressExA should not touch the port!, port == %x\n", port); /* first we run the non-ex testcases on the ex function */ - for (i = 0; i < ipv4_testcount; i++) + for (i = 0; i < ARRAY_SIZE(ipv4_tests); i++) { NTSTATUS expect_res = (ipv4_tests[i].flags & ex_fail_4) ? STATUS_INVALID_PARAMETER : ipv4_tests[i].res; @@ -1433,7 +1431,7 @@ static void test_RtlIpv4StringToAddressEx(void) } - for (i = 0; i < ipv4_ex_testcount; i++) + for (i = 0; i < ARRAY_SIZE(ipv4_ex_tests); i++) { /* Strict is only relevant for the ip address, so make sure that it does not influence the port */ for (strict = 0; strict < 2; strict++) @@ -1726,7 +1724,6 @@ static const struct { "[::]", STATUS_INVALID_PARAMETER, 0, { -1 }, ex_skip_6 }, }; -const unsigned int ipv6_testcount = sizeof(ipv6_tests) / sizeof(ipv6_tests[0]); static void init_ip6(IN6_ADDR* addr, const int src[8]) { @@ -1824,7 +1821,6 @@ static void test_RtlIpv6AddressToString(void) { "2001:0:1234::c1c0:abcd:876", { 0x120, 0, 0x3412, 0, 0, 0xc0c1, 0xcdab, 0x7608 } }, { "2001::ffd3", { 0x120, 0, 0, 0, 0, 0, 0, 0xd3ff } }, }; - const size_t testcount = sizeof(tests) / sizeof(tests[0]); unsigned int i; if (!pRtlIpv6AddressToStringA) @@ -1846,7 +1842,7 @@ static void test_RtlIpv6AddressToString(void) ok(result == (LPCSTR)~0 || broken(result == (LPCSTR)len) /* WinXP / Win2k3 */, "got %p, expected %p\n", result, (LPCSTR)~0); - for (i = 0; i < testcount; i++) + for (i = 0; i < ARRAY_SIZE(tests); i++) { init_ip6(&ip, tests[i].ip); memset(buffer, '#', sizeof(buffer)); @@ -1927,7 +1923,6 @@ static void test_RtlIpv6AddressToStringEx(void) { "[2001::ffd3%4294949819]:256", 0xffffbbbb, 1, { 0x120, 0, 0, 0, 0, 0, 0, 0xd3ff } }, { "[2001::ffd3]:256", 0, 1, { 0x120, 0, 0, 0, 0, 0, 0, 0xd3ff } }, }; - const size_t testcount = sizeof(tests) / sizeof(tests[0]); unsigned int i; if (!pRtlIpv6AddressToStringExA) @@ -1968,7 +1963,7 @@ static void test_RtlIpv6AddressToStringEx(void) ok(buffer[0] == '#', "got first char %c (expected '#')\n", buffer[0]); ok(len == 3, "got len %d (expected len 3)\n", len); - for (i = 0; i < testcount; i++) + for (i = 0; i < ARRAY_SIZE(tests); i++) { init_ip6(&ip, tests[i].ip); len = sizeof(buffer); @@ -2058,7 +2053,7 @@ static void test_RtlIpv6StringToAddress(void) /* sanity check */ ok(sizeof(ip) == sizeof(USHORT)* 8, "sizeof(ip)\n"); - for (i = 0; i < ipv6_testcount; i++) + for (i = 0; i < ARRAY_SIZE(ipv6_tests); i++) { init_ip6(&ip, NULL); terminator = (void *)0xdeadbeef; @@ -2222,7 +2217,6 @@ static void test_RtlIpv6StringToAddressEx(void) { "[ff01::8:800:200C:417A/16]:8080", STATUS_INVALID_PARAMETER, 0xbadf00d, 0xbeef, { 0x1ff, 0, 0, 0, 0x800, 8, 0xc20, 0x7a41 } }, }; - const unsigned int ipv6_ex_testcount = sizeof(ipv6_ex_tests) / sizeof(ipv6_ex_tests[0]); const char *simple_ip = "::"; unsigned int i; @@ -2291,7 +2285,7 @@ static void test_RtlIpv6StringToAddressEx(void) ok(sizeof(ip) == sizeof(USHORT)* 8, "sizeof(ip)\n"); /* first we run all ip related tests, to make sure someone didnt accidentally reimplement instead of re-use. */ - for (i = 0; i < ipv6_testcount; i++) + for (i = 0; i < ARRAY_SIZE(ipv6_tests); i++) { ULONG scope = 0xbadf00d; USHORT port = 0xbeef; @@ -2350,7 +2344,7 @@ static void test_RtlIpv6StringToAddressEx(void) } /* now we run scope / port related tests */ - for (i = 0; i < ipv6_ex_testcount; i++) + for (i = 0; i < ARRAY_SIZE(ipv6_ex_tests); i++) { scope = 0xbadf00d; port = 0xbeef;
1
0
0
0
Michael Stefaniuc : quartz: Use the ARRAY_SIZE() macro.
by Alexandre Julliard
17 Jul '18
17 Jul '18
Module: wine Branch: master Commit: 53c80a2bd16cfe338a103a8de48d260289cd5f0a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=53c80a2bd16cfe338a103a8d…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Jul 17 21:20:08 2018 +0200 quartz: Use the ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/avisplit.c | 2 +- dlls/quartz/filesource.c | 6 +++--- dlls/quartz/filtermapper.c | 2 +- dlls/quartz/main.c | 4 ++-- dlls/quartz/parser.c | 2 +- dlls/quartz/vmr9.c | 6 +++--- dlls/quartz/waveparser.c | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dlls/quartz/avisplit.c b/dlls/quartz/avisplit.c index 564ccd3..6f27c29 100644 --- a/dlls/quartz/avisplit.c +++ b/dlls/quartz/avisplit.c @@ -794,7 +794,7 @@ static HRESULT AVISplitter_ProcessStreamList(AVISplitterImpl * This, const BYTE case ckidSTREAMNAME: TRACE("processing stream name\n"); /* FIXME: this doesn't exactly match native version (we omit the "##)" prefix), but hey... */ - MultiByteToWideChar(CP_ACP, 0, (LPCSTR)(pChunk + 1), pChunk->cb, piOutput.achName, sizeof(piOutput.achName) / sizeof(piOutput.achName[0])); + MultiByteToWideChar(CP_ACP, 0, (LPCSTR)(pChunk + 1), pChunk->cb, piOutput.achName, ARRAY_SIZE(piOutput.achName)); break; case ckidSTREAMHANDLERDATA: FIXME("process stream handler data\n"); diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index bcce0e1..67af560 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -282,7 +282,7 @@ HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName, GUID * { HKEY hkeyMajor; WCHAR wszMajorKeyName[CHARS_IN_GUID]; - DWORD dwKeyNameLength = sizeof(wszMajorKeyName) / sizeof(wszMajorKeyName[0]); + DWORD dwKeyNameLength = ARRAY_SIZE(wszMajorKeyName); static const WCHAR wszExtensions[] = {'E','x','t','e','n','s','i','o','n','s',0}; if (RegEnumKeyExW(hkeyMediaType, indexMajor, wszMajorKeyName, &dwKeyNameLength, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) @@ -304,7 +304,7 @@ HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName, GUID * { HKEY hkeyMinor; WCHAR wszMinorKeyName[CHARS_IN_GUID]; - DWORD dwMinorKeyNameLen = sizeof(wszMinorKeyName) / sizeof(wszMinorKeyName[0]); + DWORD dwMinorKeyNameLen = ARRAY_SIZE(wszMinorKeyName); WCHAR wszSourceFilterKeyName[CHARS_IN_GUID]; DWORD dwSourceFilterKeyNameLen = sizeof(wszSourceFilterKeyName); DWORD maxValueLen; @@ -326,7 +326,7 @@ HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName, GUID * DWORD dwType; WCHAR wszValueName[14]; /* longest name we should encounter will be "Source Filter" */ LPWSTR wszPatternString = HeapAlloc(GetProcessHeap(), 0, maxValueLen); - DWORD dwValueNameLen = sizeof(wszValueName) / sizeof(wszValueName[0]); /* remember this is in chars */ + DWORD dwValueNameLen = ARRAY_SIZE(wszValueName); DWORD dwDataLen = maxValueLen; /* remember this is in bytes */ if (RegEnumValueW(hkeyMinor, indexValue, wszValueName, &dwValueNameLen, NULL, &dwType, (LPBYTE)wszPatternString, &dwDataLen) != ERROR_SUCCESS) diff --git a/dlls/quartz/filtermapper.c b/dlls/quartz/filtermapper.c index d189d1d..0d26198 100644 --- a/dlls/quartz/filtermapper.c +++ b/dlls/quartz/filtermapper.c @@ -703,7 +703,7 @@ static HRESULT WINAPI FilterMapper3_RegisterFilter( * the + 1 is for the separator ('\\'). The -1 is * because CHARS_IN_GUID includes the null terminator */ - nameLen = sizeof(wszDevice)/sizeof(wszDevice[0]) + CHARS_IN_GUID - 1 + 1; + nameLen = ARRAY_SIZE(wszDevice) + CHARS_IN_GUID - 1 + 1; if (szInstance) nameLen += strlenW(szInstance); diff --git a/dlls/quartz/main.c b/dlls/quartz/main.c index 7c2accb..4575c6e 100644 --- a/dlls/quartz/main.c +++ b/dlls/quartz/main.c @@ -185,7 +185,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) if (IsEqualGUID( &IID_IClassFactory, riid ) || IsEqualGUID( &IID_IUnknown, riid)) { - for (i=0; i < sizeof(object_creation)/sizeof(object_creation[0]); i++) + for (i = 0; i < ARRAY_SIZE(object_creation); i++) { if (IsEqualGUID(object_creation[i].clsid, rclsid)) { @@ -313,7 +313,7 @@ DWORD WINAPI AMGetErrorTextA(HRESULT hr, LPSTR buffer, DWORD maxlen) if (!buffer) return 0; - res = AMGetErrorTextW(hr, errorW, sizeof(errorW)/sizeof(*errorW)); + res = AMGetErrorTextW(hr, errorW, ARRAY_SIZE(errorW)); return WideCharToMultiByte(CP_ACP, 0, errorW, res, buffer, maxlen, 0, 0); } diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index 034bca0..49b0adf 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -109,7 +109,7 @@ HRESULT Parser_Create(ParserImpl* pParser, const IBaseFilterVtbl *Parser_Vtbl, c /* construct input pin */ piInput.dir = PINDIR_INPUT; piInput.pFilter = &pParser->filter.IBaseFilter_iface; - lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0])); + lstrcpynW(piInput.achName, wcsInputPinName, ARRAY_SIZE(piInput.achName)); if (!start) start = Parser_ChangeStart; diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index d9e4f46..5aa9799 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -1322,7 +1322,7 @@ static BOOL CALLBACK get_available_monitors_proc(HMONITOR hmon, HDC hdc, LPRECT info->hMon = hmon; info->dwFlags = mi.dwFlags; - lstrcpynW(info->szDevice, mi.szDevice, sizeof(info->szDevice)/sizeof(WCHAR)); + lstrcpynW(info->szDevice, mi.szDevice, ARRAY_SIZE(info->szDevice)); /* FIXME: how to get these values? */ info->szDescription[0] = 0; @@ -1339,7 +1339,7 @@ static BOOL CALLBACK get_available_monitors_proc(HMONITOR hmon, HDC hdc, LPRECT info->hMon = hmon; info->dwFlags = mi.dwFlags; - lstrcpynW(info->szDevice, mi.szDevice, sizeof(info->szDevice)/sizeof(WCHAR)); + lstrcpynW(info->szDevice, mi.szDevice, ARRAY_SIZE(info->szDevice)); /* FIXME: how to get these values? */ info->szDescription[0] = 0; @@ -2958,7 +2958,7 @@ static HRESULT VMR9_SurfaceAllocator_UpdateDeviceReset(VMR9DefaultAllocatorPrese width = This->info.dwWidth; height = This->info.dwHeight; - for (i = 0; i < sizeof(t_vert) / sizeof(t_vert[0]); ++i) + for (i = 0; i < ARRAY_SIZE(t_vert); ++i) { if (i % 2) { diff --git a/dlls/quartz/waveparser.c b/dlls/quartz/waveparser.c index 0a84fcb..403c052 100644 --- a/dlls/quartz/waveparser.c +++ b/dlls/quartz/waveparser.c @@ -254,8 +254,8 @@ static HRESULT WAVEParser_InputPin_PreConnect(IPin * iface, IPin * pConnectPin, piOutput.dir = PINDIR_OUTPUT; piOutput.pFilter = &pWAVEParser->Parser.filter.IBaseFilter_iface; - lstrcpynW(piOutput.achName, wcsOutputPinName, sizeof(piOutput.achName) / sizeof(piOutput.achName[0])); - + lstrcpynW(piOutput.achName, wcsOutputPinName, ARRAY_SIZE(piOutput.achName)); + hr = IAsyncReader_SyncRead(This->pReader, pos, sizeof(list), (BYTE *)&list); pos += sizeof(list);
1
0
0
0
Michael Stefaniuc : ole32: Use the ARRAY_SIZE() macro.
by Alexandre Julliard
17 Jul '18
17 Jul '18
Module: wine Branch: master Commit: d93954bd93ea7633e8938e38744369e79944a3f8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d93954bd93ea7633e8938e38…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Jul 17 21:20:06 2018 +0200 ole32: Use the ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/classmoniker.c | 6 +++--- dlls/ole32/clipboard.c | 2 +- dlls/ole32/datacache.c | 2 +- dlls/ole32/moniker.c | 2 +- dlls/ole32/ole2.c | 2 +- dlls/ole32/ole2impl.c | 2 +- dlls/ole32/rpc.c | 4 ++-- dlls/ole32/storage32.c | 9 ++++----- dlls/ole32/usrmarshal.c | 4 ++-- 9 files changed, 16 insertions(+), 17 deletions(-) diff --git a/dlls/ole32/classmoniker.c b/dlls/ole32/classmoniker.c index ebad794..30a24d2 100644 --- a/dlls/ole32/classmoniker.c +++ b/dlls/ole32/classmoniker.c @@ -536,14 +536,14 @@ static HRESULT WINAPI ClassMoniker_GetDisplayName(IMoniker* iface, *ppszDisplayName = CoTaskMemAlloc(sizeof(wszClsidPrefix) + (CHARS_IN_GUID-2) * sizeof(WCHAR)); - StringFromGUID2(&This->clsid, *ppszDisplayName+sizeof(wszClsidPrefix)/sizeof(WCHAR)-2, CHARS_IN_GUID); + StringFromGUID2(&This->clsid, *ppszDisplayName+ARRAY_SIZE(wszClsidPrefix)-2, CHARS_IN_GUID); /* note: this overwrites the opening curly bracket of the CLSID string generated above */ memcpy(*ppszDisplayName, wszClsidPrefix, sizeof(wszClsidPrefix)-sizeof(WCHAR)); /* note: this overwrites the closing curly bracket of the CLSID string generated above */ - (*ppszDisplayName)[sizeof(wszClsidPrefix)/sizeof(WCHAR)-2+CHARS_IN_GUID-2] = ':'; - (*ppszDisplayName)[sizeof(wszClsidPrefix)/sizeof(WCHAR)-2+CHARS_IN_GUID-1] = '\0'; + (*ppszDisplayName)[ARRAY_SIZE(wszClsidPrefix)-2+CHARS_IN_GUID-2] = ':'; + (*ppszDisplayName)[ARRAY_SIZE(wszClsidPrefix)-2+CHARS_IN_GUID-1] = '\0'; TRACE("string is %s\n", debugstr_w(*ppszDisplayName)); return S_OK; diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index 919d9e3..cb005d3 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -1197,7 +1197,7 @@ static HRESULT get_priv_data(ole_priv_data **data) for(cf = 0; (cf = EnumClipboardFormats(cf)) != 0; count++) { WCHAR buf[256]; - if (GetClipboardFormatNameW(cf, buf, sizeof(buf) / sizeof(WCHAR))) + if (GetClipboardFormatNameW(cf, buf, ARRAY_SIZE(buf))) TRACE("cf %04x %s\n", cf, debugstr_w(buf)); else TRACE("cf %04x\n", cf); diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c index b72b8ff..3eff569 100644 --- a/dlls/ole32/datacache.c +++ b/dlls/ole32/datacache.c @@ -2667,7 +2667,7 @@ static HRESULT WINAPI DataCache_UpdateCache( IOleCache2 *iface, IDataObject *dat } else { - for (i = 0; i < sizeof(view_list) / sizeof(view_list[0]); i++) + for (i = 0; i < ARRAY_SIZE(view_list); i++) { fmt.cfFormat = view_list[i]; fmt.tymed = tymed_from_cf( fmt.cfFormat ); diff --git a/dlls/ole32/moniker.c b/dlls/ole32/moniker.c index ffbaa61..c1312d1 100644 --- a/dlls/ole32/moniker.c +++ b/dlls/ole32/moniker.c @@ -1152,7 +1152,7 @@ HRESULT WINAPI MkParseDisplayName(LPBC pbc, LPCOLESTR szDisplayName, *pchEaten = 0; *ppmk = NULL; - if (!strncmpiW(szDisplayName, wszClsidColon, sizeof(wszClsidColon)/sizeof(wszClsidColon[0]))) + if (!strncmpiW(szDisplayName, wszClsidColon, ARRAY_SIZE(wszClsidColon))) { hr = ClassMoniker_CreateFromDisplayName(pbc, szDisplayName, &chEaten, &moniker); if (FAILED(hr) && (hr != MK_E_SYNTAX)) diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c index c7a9b27..2de9edb 100644 --- a/dlls/ole32/ole2.c +++ b/dlls/ole32/ole2.c @@ -967,7 +967,7 @@ static HRESULT WINAPI EnumOLEVERB_Next( LPWSTR pwszOLEVERB; LPWSTR pwszMenuFlags; LPWSTR pwszAttribs; - LONG res = RegEnumKeyW(This->hkeyVerb, This->index, wszSubKey, sizeof(wszSubKey)/sizeof(wszSubKey[0])); + LONG res = RegEnumKeyW(This->hkeyVerb, This->index, wszSubKey, ARRAY_SIZE(wszSubKey)); if (res == ERROR_NO_MORE_ITEMS) { hr = S_FALSE; diff --git a/dlls/ole32/ole2impl.c b/dlls/ole32/ole2impl.c index ccf31fa..fa5777b 100644 --- a/dlls/ole32/ole2impl.c +++ b/dlls/ole32/ole2impl.c @@ -135,7 +135,7 @@ static HRESULT get_storage(IDataObject *data, IStorage *stg, UINT *src_cf, BOOL if (other_fmts) { - for (i = 0; i < sizeof(fmt_id)/sizeof(fmt_id[0]); i++) + for (i = 0; i < ARRAY_SIZE(fmt_id); i++) { init_fmtetc(&fmt, fmt_id[i], TYMED_ISTORAGE); hr = IDataObject_QueryGetData(data, &fmt); diff --git a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c index a73d23c..9aa945b 100644 --- a/dlls/ole32/rpc.c +++ b/dlls/ole32/rpc.c @@ -1658,7 +1658,7 @@ static HRESULT create_server(REFCLSID rclsid, HANDLE *process) static const WCHAR embedding[] = { ' ', '-','E','m','b','e','d','d','i','n','g',0 }; HKEY key; HRESULT hres; - WCHAR command[MAX_PATH+sizeof(embedding)/sizeof(WCHAR)]; + WCHAR command[MAX_PATH+ARRAY_SIZE(embedding)]; DWORD size = (MAX_PATH+1) * sizeof(WCHAR); STARTUPINFOW sinfo; PROCESS_INFORMATION pinfo; @@ -1799,7 +1799,7 @@ static void get_localserver_pipe_name(WCHAR *pipefn, REFCLSID rclsid) { static const WCHAR wszPipeRef[] = {'\\','\\','.','\\','p','i','p','e','\\',0}; strcpyW(pipefn, wszPipeRef); - StringFromGUID2(rclsid, pipefn + sizeof(wszPipeRef)/sizeof(wszPipeRef[0]) - 1, CHARS_IN_GUID); + StringFromGUID2(rclsid, pipefn + ARRAY_SIZE(wszPipeRef) - 1, CHARS_IN_GUID); } /* FIXME: should call to rpcss instead */ diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 51f178b..886d9b9 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -5057,7 +5057,7 @@ static HRESULT StorageImpl_LockOne(StorageImpl *This, ULONG start, ULONG end) if (SUCCEEDED(hr)) { - for (j=0; j<sizeof(This->locked_bytes)/sizeof(This->locked_bytes[0]); j++) + for (j = 0; j < ARRAY_SIZE(This->locked_bytes); j++) { if (This->locked_bytes[j] == 0) { @@ -5200,10 +5200,10 @@ static void StorageImpl_Destroy(StorageBaseImpl* iface) BlockChainStream_Destroy(This->rootBlockChain); BlockChainStream_Destroy(This->smallBlockDepotChain); - for (i=0; i<BLOCKCHAIN_CACHE_SIZE; i++) + for (i = 0; i < BLOCKCHAIN_CACHE_SIZE; i++) BlockChainStream_Destroy(This->blockChainCache[i]); - for (i=0; i<sizeof(This->locked_bytes)/sizeof(This->locked_bytes[0]); i++) + for (i = 0; i < ARRAY_SIZE(This->locked_bytes); i++) { ULARGE_INTEGER offset, cb; cb.QuadPart = 1; @@ -9369,8 +9369,7 @@ HRESULT WINAPI WriteFmtUserTypeStg( /* get the clipboard format name */ if( cf ) { - n = GetClipboardFormatNameW( cf, szwClipName, - sizeof(szwClipName)/sizeof(szwClipName[0]) ); + n = GetClipboardFormatNameW(cf, szwClipName, ARRAY_SIZE(szwClipName)); szwClipName[n]=0; } diff --git a/dlls/ole32/usrmarshal.c b/dlls/ole32/usrmarshal.c index 8d36e13..772bff5 100644 --- a/dlls/ole32/usrmarshal.c +++ b/dlls/ole32/usrmarshal.c @@ -116,7 +116,7 @@ ULONG __RPC_USER CLIPFORMAT_UserSize(ULONG *pFlags, ULONG size, CLIPFORMAT *pCF) /* urg! this function is badly designed because it won't tell us how * much space is needed without doing a dummy run of storing the * name into a buffer */ - ret = GetClipboardFormatNameW(*pCF, format, sizeof(format)/sizeof(format[0])-1); + ret = GetClipboardFormatNameW(*pCF, format, ARRAY_SIZE(format)-1); if (!ret) RaiseException(DV_E_CLIPFORMAT, 0, 0, NULL); size += (ret + 1) * sizeof(WCHAR); @@ -161,7 +161,7 @@ unsigned char * __RPC_USER CLIPFORMAT_UserMarshal(ULONG *pFlags, unsigned char * *(DWORD *)pBuffer = *pCF; pBuffer += 4; - len = GetClipboardFormatNameW(*pCF, format, sizeof(format)/sizeof(format[0])-1); + len = GetClipboardFormatNameW(*pCF, format, ARRAY_SIZE(format)-1); if (!len) RaiseException(DV_E_CLIPFORMAT, 0, 0, NULL); len += 1;
1
0
0
0
Nikolay Sivov : comctl32/trackbar: Scale thumb size with resolution.
by Alexandre Julliard
17 Jul '18
17 Jul '18
Module: wine Branch: master Commit: 489c01eeb24ed17e792422071ba05b5e58be81ba URL:
https://source.winehq.org/git/wine.git/?a=commit;h=489c01eeb24ed17e79242207…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jul 17 14:13:03 2018 +0300 comctl32/trackbar: Scale thumb size with resolution. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/trackbar.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c index d774823..7cb73ca 100644 --- a/dlls/comctl32/trackbar.c +++ b/dlls/comctl32/trackbar.c @@ -1468,25 +1468,28 @@ TRACKBAR_SetUnicodeFormat (TRACKBAR_INFO *infoPtr, BOOL fUnicode) return bTemp; } +static int get_scaled_metric(const TRACKBAR_INFO *infoPtr, int value) +{ + return MulDiv(value, GetDpiForWindow(infoPtr->hwndSelf), 96); +} static LRESULT TRACKBAR_InitializeThumb (TRACKBAR_INFO *infoPtr) { + int client_size; RECT rect; - int clientWidth, clientMetric; - /* initial thumb length */ - clientMetric = (infoPtr->dwStyle & TBS_ENABLESELRANGE) ? 23 : 21; + infoPtr->uThumbLen = get_scaled_metric(infoPtr, infoPtr->dwStyle & TBS_ENABLESELRANGE ? 23 : 21); + GetClientRect(infoPtr->hwndSelf,&rect); - if (infoPtr->dwStyle & TBS_VERT) { - clientWidth = rect.right - rect.left; - } else { - clientWidth = rect.bottom - rect.top; - } - if (clientWidth >= clientMetric) - infoPtr->uThumbLen = clientMetric; + if (infoPtr->dwStyle & TBS_VERT) + client_size = rect.right - rect.left; else - infoPtr->uThumbLen = clientWidth > 9 ? clientWidth - 6 : 4; + client_size = rect.bottom - rect.top; + + if (client_size < infoPtr->uThumbLen) + infoPtr->uThumbLen = client_size > get_scaled_metric(infoPtr, 9) ? + client_size - get_scaled_metric(infoPtr, 5) : get_scaled_metric(infoPtr, 4); TRACKBAR_CalcChannel (infoPtr); TRACKBAR_UpdateThumb (infoPtr);
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
41
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
Results per page:
10
25
50
100
200