Commit 1e469c95 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

shell32: Avoid ARRAY_SIZE-like macros.

parent 9cad95d1
...@@ -87,8 +87,6 @@ static const shvheader mycomputer_header[] = ...@@ -87,8 +87,6 @@ static const shvheader mycomputer_header[] =
{ NULL, 0, IDS_SHV_COLUMN7, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10 }, { NULL, 0, IDS_SHV_COLUMN7, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10 },
}; };
#define MYCOMPUTERSHELLVIEWCOLUMNS sizeof(mycomputer_header)/sizeof(shvheader)
/************************************************************************** /**************************************************************************
* ISF_MyComputer_Constructor * ISF_MyComputer_Constructor
*/ */
...@@ -799,7 +797,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumnState ( ...@@ -799,7 +797,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumnState (
TRACE ("(%p)->(%d %p)\n", This, iColumn, pcsFlags); TRACE ("(%p)->(%d %p)\n", This, iColumn, pcsFlags);
if (!pcsFlags || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS) if (!pcsFlags || iColumn >= ARRAY_SIZE(mycomputer_header))
return E_INVALIDARG; return E_INVALIDARG;
*pcsFlags = mycomputer_header[iColumn].pcsFlags; *pcsFlags = mycomputer_header[iColumn].pcsFlags;
...@@ -826,7 +824,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 *iface, ...@@ -826,7 +824,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 *iface,
TRACE ("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd); TRACE ("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd);
if (!psd || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS) if (!psd || iColumn >= ARRAY_SIZE(mycomputer_header))
return E_INVALIDARG; return E_INVALIDARG;
if (!pidl) if (!pidl)
...@@ -871,7 +869,7 @@ static HRESULT WINAPI ISF_MyComputer_fnMapColumnToSCID (IShellFolder2 *iface, UI ...@@ -871,7 +869,7 @@ static HRESULT WINAPI ISF_MyComputer_fnMapColumnToSCID (IShellFolder2 *iface, UI
TRACE("(%p)->(%u %p)\n", This, column, scid); TRACE("(%p)->(%u %p)\n", This, column, scid);
if (column >= MYCOMPUTERSHELLVIEWCOLUMNS) if (column >= ARRAY_SIZE(mycomputer_header))
return E_INVALIDARG; return E_INVALIDARG;
return shellfolder_map_column_to_scid(mycomputer_header, column, scid); return shellfolder_map_column_to_scid(mycomputer_header, column, scid);
......
...@@ -63,8 +63,6 @@ static const shvheader printers_header[] = { ...@@ -63,8 +63,6 @@ static const shvheader printers_header[] = {
{ NULL, 0, IDS_SHV_COL_MODEL, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 20 } { NULL, 0, IDS_SHV_COL_MODEL, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 20 }
}; };
#define PRINTERS_FOLDER_COL_NUM sizeof(printers_header)/sizeof(shvheader)
static HRESULT WINAPI IShellFolder_Printers_fnQueryInterface(IShellFolder2 *iface, static HRESULT WINAPI IShellFolder_Printers_fnQueryInterface(IShellFolder2 *iface,
REFIID riid, LPVOID *ppvObj) REFIID riid, LPVOID *ppvObj)
{ {
...@@ -283,7 +281,7 @@ static HRESULT WINAPI IShellFolder_Printers_fnGetDefaultColumnState ( ...@@ -283,7 +281,7 @@ static HRESULT WINAPI IShellFolder_Printers_fnGetDefaultColumnState (
TRACE("(%p)->(%d %p)\n", This, iColumn, pcsFlags); TRACE("(%p)->(%d %p)\n", This, iColumn, pcsFlags);
if (iColumn >= PRINTERS_FOLDER_COL_NUM) if (iColumn >= ARRAY_SIZE(printers_header))
return E_INVALIDARG; return E_INVALIDARG;
*pcsFlags = printers_header[iColumn].pcsFlags; *pcsFlags = printers_header[iColumn].pcsFlags;
...@@ -306,7 +304,7 @@ static HRESULT WINAPI IShellFolder_Printers_fnGetDetailsOf (IShellFolder2 *iface ...@@ -306,7 +304,7 @@ static HRESULT WINAPI IShellFolder_Printers_fnGetDetailsOf (IShellFolder2 *iface
TRACE("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd); TRACE("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd);
if (iColumn >= PRINTERS_FOLDER_COL_NUM) if (iColumn >= ARRAY_SIZE(printers_header))
return E_NOTIMPL; return E_NOTIMPL;
if (!pidl) if (!pidl)
...@@ -323,7 +321,7 @@ static HRESULT WINAPI IShellFolder_Printers_fnMapColumnToSCID (IShellFolder2 *if ...@@ -323,7 +321,7 @@ static HRESULT WINAPI IShellFolder_Printers_fnMapColumnToSCID (IShellFolder2 *if
TRACE("(%p)->(%u %p)\n", This, column, scid); TRACE("(%p)->(%u %p)\n", This, column, scid);
if (column >= PRINTERS_FOLDER_COL_NUM) if (column >= ARRAY_SIZE(printers_header))
return E_INVALIDARG; return E_INVALIDARG;
return shellfolder_map_column_to_scid(printers_header, column, scid); return shellfolder_map_column_to_scid(printers_header, column, scid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment