Skip to content

Commit 73aaabc

Browse files
Pierrick Bouvierkostyanf14
authored andcommitted
qga: fix missing static and prototypes windows warnings
Reported by clang++, but not by g++. ../qga/vss-win32/provider.cpp:48:6: error: no previous prototype for function 'LockModule' [-Werror,-Wmissing-prototypes] 48 | void LockModule(BOOL lock) | ^ ../qga/vss-win32/provider.cpp:48:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 48 | void LockModule(BOOL lock) | ^ | static ../qga/vss-win32/provider.cpp:531:13: error: no previous prototype for function 'DllMain' [-Werror,-Wmissing-prototypes] 531 | BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD dwReason, LPVOID lpReserved) | ^ ../qga/vss-win32/provider.cpp:531:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 531 | BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD dwReason, LPVOID lpReserved) | ^ | static Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> Link: https://lore.kernel.org/r/20241031040426.772604-7-pierrick.bouvier@linaro.org Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
1 parent 24287d4 commit 73aaabc

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

qga/vss-win32/install.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const GUID CLSID_WbemLocator = { 0x4590f811, 0x1d3a, 0x11d0,
3939
const GUID IID_IWbemLocator = { 0xdc12a687, 0x737f, 0x11cf,
4040
{0x88, 0x4d, 0x00, 0xaa, 0x00, 0x4b, 0x2e, 0x24} };
4141

42-
void errmsg(DWORD err, const char *text)
42+
static void errmsg(DWORD err, const char *text)
4343
{
4444
/*
4545
* `text' contains function call statement when errmsg is called via chk().
@@ -242,6 +242,7 @@ static HRESULT QGAProviderRemove(ICatalogCollection *coll, int i, void *arg)
242242
}
243243

244244
/* Unregister this module from COM+ Applications Catalog */
245+
STDAPI COMUnregister(void);
245246
STDAPI COMUnregister(void)
246247
{
247248
qga_debug_begin;
@@ -256,6 +257,7 @@ STDAPI COMUnregister(void)
256257
}
257258

258259
/* Register this module to COM+ Applications Catalog */
260+
STDAPI COMRegister(void);
259261
STDAPI COMRegister(void)
260262
{
261263
qga_debug_begin;
@@ -380,11 +382,13 @@ STDAPI COMRegister(void)
380382
return hr;
381383
}
382384

385+
STDAPI_(void) CALLBACK DLLCOMRegister(HWND, HINSTANCE, LPSTR, int);
383386
STDAPI_(void) CALLBACK DLLCOMRegister(HWND, HINSTANCE, LPSTR, int)
384387
{
385388
COMRegister();
386389
}
387390

391+
STDAPI_(void) CALLBACK DLLCOMUnregister(HWND, HINSTANCE, LPSTR, int);
388392
STDAPI_(void) CALLBACK DLLCOMUnregister(HWND, HINSTANCE, LPSTR, int)
389393
{
390394
COMUnregister();

qga/vss-win32/provider.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const IID IID_IVssEnumObject = { 0xAE1C7110, 0x2F60, 0x11d3,
4545
{0x8A, 0x39, 0x00, 0xC0, 0x4F, 0x72, 0xD8, 0xE3} };
4646

4747

48-
void LockModule(BOOL lock)
48+
static void LockModule(BOOL lock)
4949
{
5050
if (lock) {
5151
InterlockedIncrement(&g_nComObjsInUse);
@@ -527,6 +527,9 @@ STDAPI DllCanUnloadNow()
527527
return g_nComObjsInUse == 0 ? S_OK : S_FALSE;
528528
}
529529

530+
EXTERN_C
531+
BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD dwReason, LPVOID lpReserved);
532+
530533
EXTERN_C
531534
BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD dwReason, LPVOID lpReserved)
532535
{

qga/vss-win32/requester.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ static void AddComponents(ErrorSet *errset)
254254
qga_debug_end;
255255
}
256256

257-
DWORD get_reg_dword_value(HKEY baseKey, LPCSTR subKey, LPCSTR valueName,
258-
DWORD defaultData)
257+
static DWORD get_reg_dword_value(HKEY baseKey, LPCSTR subKey, LPCSTR valueName,
258+
DWORD defaultData)
259259
{
260260
qga_debug_begin;
261261

@@ -272,12 +272,12 @@ DWORD get_reg_dword_value(HKEY baseKey, LPCSTR subKey, LPCSTR valueName,
272272
return dwordData;
273273
}
274274

275-
bool is_valid_vss_backup_type(VSS_BACKUP_TYPE vssBT)
275+
static bool is_valid_vss_backup_type(VSS_BACKUP_TYPE vssBT)
276276
{
277277
return (vssBT > VSS_BT_UNDEFINED && vssBT < VSS_BT_OTHER);
278278
}
279279

280-
VSS_BACKUP_TYPE get_vss_backup_type(
280+
static VSS_BACKUP_TYPE get_vss_backup_type(
281281
VSS_BACKUP_TYPE defaultVssBT = DEFAULT_VSS_BACKUP_TYPE)
282282
{
283283
qga_debug_begin;

0 commit comments

Comments
 (0)