Skip to content

Commit

Permalink
[win32] Silence a lot of unused parameter warnings.
Browse files Browse the repository at this point in the history
KeyStore_OwnerDataCallback: s/occurence/occurrence/gi
  • Loading branch information
GerbilSoft committed Jul 6, 2022
1 parent e2a72cf commit ef0f7d2
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/libwin32common/sdk/IOwnerDataCallback.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ IOwnerDataCallback : public IUnknown
/// specified copy of the specified item.
///
/// \return An \c HRESULT error code.
virtual HRESULT STDMETHODCALLTYPE GetItemGroup(int itemIndex, int occurenceIndex, PINT pGroupIndex) = 0;
virtual HRESULT STDMETHODCALLTYPE GetItemGroup(int itemIndex, int occurrenceIndex, PINT pGroupIndex) = 0;
/// \brief <em>Will be called to determine how often an item occurs in the listview control</em>
///
/// This method is called by the listview control to determine how often the specified item occurs in the
Expand All @@ -74,7 +74,7 @@ IOwnerDataCallback : public IUnknown
/// \param[out] pOccurrencesCount Receives the number of occurrences of the item in the listview control.
///
/// \return An \c HRESULT error code.
virtual HRESULT STDMETHODCALLTYPE GetItemGroupCount(int itemIndex, PINT pOccurenceCount) = 0;
virtual HRESULT STDMETHODCALLTYPE GetItemGroupCount(int itemIndex, PINT pOccurrenceCount) = 0;
/// \brief <em>Will be called to prepare the client app that the data for a certain range of items will be required very soon</em>
///
/// This method is similar to the \c LVN_ODCACHEHINT notification. It tells the client application that
Expand Down
2 changes: 2 additions & 0 deletions src/libwin32ui/WinUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,8 @@ LRESULT CALLBACK ListViewNoDividerDblClickSubclassProc(
WPARAM wParam, LPARAM lParam,
UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
{
((void)dwRefData);

switch (uMsg) {
case WM_NCDESTROY:
// Remove the window subclass.
Expand Down
5 changes: 3 additions & 2 deletions src/svrplus/svrplus.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* svrplus.c: Win32 installer for rom-properties. *
* *
* Copyright (c) 2017-2018 by Egor. *
* Copyright (c) 2017-2021 by David Korth. *
* Copyright (c) 2017-2022 by David Korth. *
* SPDX-License-Identifier: GPL-2.0-or-later *
***************************************************************************/

Expand Down Expand Up @@ -887,8 +887,9 @@ int CALLBACK wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance
param.bHighSec = FALSE;
rp_secure_enable(param);

// Unused parameters. (Win16 baggage)
// Unused parameters
((void)hPrevInstance);
((void)lpCmdLine);

// Check if another instance of svrplus is already running.
// References:
Expand Down
5 changes: 5 additions & 0 deletions src/win32/config/AboutTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ AboutTabPrivate::~AboutTabPrivate()
*/
INT_PTR CALLBACK AboutTabPrivate::dlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
RP_UNUSED(wParam);

switch (uMsg) {
case WM_INITDIALOG: {
// Get the pointer to the property sheet page object. This is
Expand Down Expand Up @@ -334,6 +336,9 @@ INT_PTR CALLBACK AboutTabPrivate::dlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, L
*/
UINT CALLBACK AboutTabPrivate::callbackProc(HWND hWnd, UINT uMsg, LPPROPSHEETPAGE ppsp)
{
RP_UNUSED(hWnd);
RP_UNUSED(ppsp);

switch (uMsg) {
case PSPCB_CREATE: {
// Must return TRUE to enable the page to be created.
Expand Down
5 changes: 5 additions & 0 deletions src/win32/config/AchievementsTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ AchievementsTabPrivate::~AchievementsTabPrivate()
*/
INT_PTR CALLBACK AchievementsTabPrivate::dlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
RP_UNUSED(wParam);

switch (uMsg) {
case WM_INITDIALOG: {
// Get the pointer to the property sheet page object. This is
Expand Down Expand Up @@ -190,6 +192,9 @@ INT_PTR CALLBACK AchievementsTabPrivate::dlgProc(HWND hDlg, UINT uMsg, WPARAM wP
*/
UINT CALLBACK AchievementsTabPrivate::callbackProc(HWND hWnd, UINT uMsg, LPPROPSHEETPAGE ppsp)
{
RP_UNUSED(hWnd);
RP_UNUSED(ppsp);

switch (uMsg) {
case PSPCB_CREATE: {
// Must return TRUE to enable the page to be created.
Expand Down
3 changes: 3 additions & 0 deletions src/win32/config/CacheTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,9 @@ INT_PTR CALLBACK CacheTabPrivate::dlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, L
*/
UINT CALLBACK CacheTabPrivate::callbackProc(HWND hWnd, UINT uMsg, LPPROPSHEETPAGE ppsp)
{
RP_UNUSED(hWnd);
RP_UNUSED(ppsp);

switch (uMsg) {
case PSPCB_CREATE: {
// Must return TRUE to enable the page to be created.
Expand Down
20 changes: 13 additions & 7 deletions src/win32/config/ConfigDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ ConfigDialogPrivate::~ConfigDialogPrivate()
*/
int CALLBACK ConfigDialogPrivate::callbackProc(HWND hDlg, UINT uMsg, LPARAM lParam)
{
RP_UNUSED(lParam);

switch (uMsg) {
case PSCB_INITIALIZED: {
// Property sheet has been initialized.
Expand Down Expand Up @@ -232,7 +234,15 @@ LRESULT CALLBACK ConfigDialogPrivate::subclassProc(
WPARAM wParam, LPARAM lParam,
UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
{
RP_UNUSED(dwRefData);

switch (uMsg) {
case WM_NCDESTROY:
// Remove the window subclass.
// Reference: https://devblogs.microsoft.com/oldnewthing/20031111-00/?p=41883
RemoveWindowSubclass(hWnd, subclassProc, uIdSubclass);
break;

case WM_SHOWWINDOW: {
// Check for RTL.
if (LibWin32UI::isSystemRTL() != 0) {
Expand Down Expand Up @@ -392,12 +402,6 @@ LRESULT CALLBACK ConfigDialogPrivate::subclassProc(
EnableWindow(GetDlgItem(hWnd, IDC_RP_RESET), TRUE);
break;

case WM_NCDESTROY:
// Remove the window subclass.
// Reference: https://devblogs.microsoft.com/oldnewthing/20031111-00/?p=41883
RemoveWindowSubclass(hWnd, subclassProc, uIdSubclass);
break;

case WM_RP_PROP_SHEET_ENABLE_DEFAULTS:
// Enable/disable the "Defaults" button.
EnableWindow(GetDlgItem(hWnd, IDC_RP_DEFAULTS), (BOOL)wParam);
Expand Down Expand Up @@ -443,7 +447,9 @@ extern "C"
int CALLBACK rp_show_config_dialog(
HWND hWnd, HINSTANCE hInstance, LPSTR pszCmdLine, int nCmdShow)
{
// TODO: nCmdShow.
// TODO: Handle hWnd and nCmdShow?
RP_UNUSED(hInstance);
RP_UNUSED(pszCmdLine);

#if defined(_MSC_VER) && defined(ENABLE_NLS)
// Delay load verification.
Expand Down
3 changes: 3 additions & 0 deletions src/win32/config/ImageTypesTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,9 @@ INT_PTR CALLBACK ImageTypesTabPrivate::dlgProc(HWND hDlg, UINT uMsg, WPARAM wPar
*/
UINT CALLBACK ImageTypesTabPrivate::callbackProc(HWND hWnd, UINT uMsg, LPPROPSHEETPAGE ppsp)
{
RP_UNUSED(hWnd);
RP_UNUSED(ppsp);

switch (uMsg) {
case PSPCB_CREATE: {
// Must return TRUE to enable the page to be created.
Expand Down
3 changes: 3 additions & 0 deletions src/win32/config/KeyManagerTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,9 @@ INT_PTR CALLBACK KeyManagerTabPrivate::dlgProc(HWND hDlg, UINT uMsg, WPARAM wPar
*/
UINT CALLBACK KeyManagerTabPrivate::callbackProc(HWND hWnd, UINT uMsg, LPPROPSHEETPAGE ppsp)
{
RP_UNUSED(hWnd);
RP_UNUSED(ppsp);

switch (uMsg) {
case PSPCB_CREATE: {
// Must return true to enable the page to be created.
Expand Down
6 changes: 4 additions & 2 deletions src/win32/config/KeyStore_OwnerDataCallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* ROM Properties Page shell extension. (Win32) *
* KeyStore_OwnerDataCallback.hpp: LVS_OWNERDATA callback for Vista. *
* *
* Copyright (c) 2016-2021 by David Korth. *
* Copyright (c) 2016-2022 by David Korth. *
* SPDX-License-Identifier: GPL-2.0-or-later *
***************************************************************************/

Expand Down Expand Up @@ -73,8 +73,10 @@ IFACEMETHODIMP KeyStore_OwnerDataCallback::GetItemInGroup(int groupIndex, int gr
* @param occurrenceIndex [in] Instance of the item. (usually 0 here)
* @param pGroupIndex [out] Section index.
*/
IFACEMETHODIMP KeyStore_OwnerDataCallback::GetItemGroup(int itemIndex, int occurenceIndex, PINT pGroupIndex)
IFACEMETHODIMP KeyStore_OwnerDataCallback::GetItemGroup(int itemIndex, int occurrenceIndex, PINT pGroupIndex)
{
RP_UNUSED(occurrenceIndex);

// TODO: Handle this.
if (!pGroupIndex)
return E_POINTER;
Expand Down
4 changes: 2 additions & 2 deletions src/win32/config/KeyStore_OwnerDataCallback.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class KeyStore_OwnerDataCallback final : public LibWin32Common::ComBase<IOwnerDa
IFACEMETHODIMP GetItemPosition(int itemIndex, LPPOINT pPosition) final;
IFACEMETHODIMP SetItemPosition(int itemIndex, POINT position) final;
IFACEMETHODIMP GetItemInGroup(int groupIndex, int groupWideItemIndex, PINT pTotalItemIndex) final;
IFACEMETHODIMP GetItemGroup(int itemIndex, int occurenceIndex, PINT pGroupIndex) final;
IFACEMETHODIMP GetItemGroupCount(int itemIndex, PINT pOccurenceCount) final;
IFACEMETHODIMP GetItemGroup(int itemIndex, int occurrenceIndex, PINT pGroupIndex) final;
IFACEMETHODIMP GetItemGroupCount(int itemIndex, PINT pOccurrenceCount) final;
IFACEMETHODIMP OnCacheHint(LVITEMINDEX firstItem, LVITEMINDEX lastItem) final;

private:
Expand Down
7 changes: 6 additions & 1 deletion src/win32/config/OptionsTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ void OptionsTabPrivate::loadDefaults(void)
static const int palLanguageForGameTDB_default =
OptionsTabPrivate::pal_lc_idx_def; // cboGameTDBPAL index ('en')
// Options
static const bool showDangerousPermissionsOverlayIcon_default = true;
// FIXME: Uncomment this once the "dangerous" permissions overlay
// is working on Windows.
//static const bool showDangerousPermissionsOverlayIcon_default = true;
static const bool enableThumbnailOnNetworkFS_default = false;
bool isDefChanged = false;

Expand Down Expand Up @@ -439,6 +441,9 @@ INT_PTR CALLBACK OptionsTabPrivate::dlgProc(HWND hDlg, UINT uMsg, WPARAM wParam,
*/
UINT CALLBACK OptionsTabPrivate::callbackProc(HWND hWnd, UINT uMsg, LPPROPSHEETPAGE ppsp)
{
RP_UNUSED(hWnd);
RP_UNUSED(ppsp);

switch (uMsg) {
case PSPCB_CREATE: {
// Must return TRUE to enable the page to be created.
Expand Down
10 changes: 9 additions & 1 deletion src/win32/config/RP_EmptyVolumeCacheCallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* ROM Properties Page shell extension. (Win32) *
* RP_EmptyVolumeCacheCallback.cpp: RP_EmptyVolumeCacheCallback implementation. *
* *
* Copyright (c) 2016-2021 by David Korth. *
* Copyright (c) 2016-2022 by David Korth. *
* SPDX-License-Identifier: GPL-2.0-or-later *
********************************************************************************/

Expand Down Expand Up @@ -39,16 +39,24 @@ IFACEMETHODIMP RP_EmptyVolumeCacheCallback::QueryInterface(REFIID riid, LPVOID *

IFACEMETHODIMP RP_EmptyVolumeCacheCallback::ScanProgress(DWORDLONG dwlSpaceUsed, DWORD dwFlags, LPCWSTR pcwszStatus)
{
RP_UNUSED(dwlSpaceUsed);
RP_UNUSED(dwFlags);
RP_UNUSED(pcwszStatus);
return S_OK;
}

IFACEMETHODIMP RP_EmptyVolumeCacheCallback::PurgeProgress(DWORDLONG dwlSpaceFreed, DWORDLONG dwlSpaceToFree, DWORD dwFlags, LPCWSTR pcwszStatus)
{
RP_UNUSED(dwFlags);
RP_UNUSED(pcwszStatus);

// TODO: Verify that the UI gets updated here.
if (!m_hProgressBar) {
return S_OK;
}

// TODO: Better way to calculate a percentage?
// TODO: If dwFlags has EVCCBF_LASTNOTIFICATION, show 100% unconditionally?
float fPct = static_cast<float>(dwlSpaceFreed) / static_cast<float>(dwlSpaceToFree);
SendMessage(m_hProgressBar, PBM_SETSTATE, m_baseProgress + static_cast<unsigned int>(fPct * 100.0f), 0);
return S_OK;
Expand Down
5 changes: 4 additions & 1 deletion src/win32/config/SystemsTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* ROM Properties Page shell extension. (Win32) *
* SystemsTab.cpp: Systems tab for rp-config. *
* *
* Copyright (c) 2016-2021 by David Korth. *
* Copyright (c) 2016-2022 by David Korth. *
* SPDX-License-Identifier: GPL-2.0-or-later *
***************************************************************************/

Expand Down Expand Up @@ -336,6 +336,9 @@ INT_PTR CALLBACK SystemsTabPrivate::dlgProc(HWND hDlg, UINT uMsg, WPARAM wParam,
*/
UINT CALLBACK SystemsTabPrivate::callbackProc(HWND hWnd, UINT uMsg, LPPROPSHEETPAGE ppsp)
{
RP_UNUSED(hWnd);
RP_UNUSED(ppsp);

switch (uMsg) {
case PSPCB_CREATE: {
// Must return TRUE to enable the page to be created.
Expand Down

0 comments on commit ef0f7d2

Please sign in to comment.