[SDK][SHELL32_APITEST] Fix some warnings (#7031)

This commit is contained in:
Whindmar Saksit 2025-07-06 21:12:37 +02:00 committed by GitHub
parent c0ea1c0e9f
commit 212a1a5c74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 21 additions and 28 deletions

View file

@ -547,7 +547,7 @@ void TConfig::keyfile_init() {
// if there is no environment variable // if there is no environment variable
GetPrivateProfileString("Keyboard", "Keyfile", "", keyfile, GetPrivateProfileString("Keyboard", "Keyfile", "", keyfile,
sizeof(keyfile), inifile); sizeof(keyfile), inifile);
if(keyfile == 0 || *keyfile == 0) { if (!*keyfile) {
// and there is no profile string // and there is no profile string
strcpy(keyfile, startdir); strcpy(keyfile, startdir);
if (sizeof(keyfile) >= strlen(keyfile)+strlen("telnet.cfg")) { if (sizeof(keyfile) >= strlen(keyfile)+strlen("telnet.cfg")) {

View file

@ -2046,9 +2046,9 @@ static LRESULT OnNotify( HWND hWnd, LPARAM lParam)
update_font_list(); update_font_list();
sprintf( buf,"selection = %d..%d, line count=%ld", sprintf( buf,"Selection: %d..%d | Lines: %u",
pSC->chrg.cpMin, pSC->chrg.cpMax, pSC->chrg.cpMin, pSC->chrg.cpMax,
SendMessageW(hwndEditor, EM_GETLINECOUNT, 0, 0)); (UINT)SendMessageW(hwndEditor, EM_GETLINECOUNT, 0, 0));
SetWindowTextA(GetDlgItem(hWnd, IDC_STATUSBAR), buf); SetWindowTextA(GetDlgItem(hWnd, IDC_STATUSBAR), buf);
SendMessageW(hWnd, WM_USER, 0, 0); SendMessageW(hWnd, WM_USER, 0, 0);
return 1; return 1;

View file

@ -19,7 +19,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef NONAMELESSUNION /* Required to avoid a warning when NOT CMAKE_CROSSCOMPILING */
#define NONAMELESSUNION #define NONAMELESSUNION
#endif
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>

View file

@ -213,7 +213,7 @@ static void DoStepCheck(INT iStage, INT iStep, LPCSTR checks)
} }
LPCSTR answer = NULL; LPCSTR answer = NULL;
INT lineno; INT lineno = 0;
switch (iStage) switch (iStage)
{ {
case 0: case 0:
@ -285,11 +285,7 @@ static void DoStepCheck(INT iStage, INT iStep, LPCSTR checks)
} }
break; break;
} }
default: DEFAULT_UNREACHABLE;
{
assert(0);
break;
}
} }
ok(lstrcmpA(checks, answer) == 0, ok(lstrcmpA(checks, answer) == 0,

View file

@ -28,7 +28,6 @@
#define shell32_hInstance GetModuleHandle(NULL) #define shell32_hInstance GetModuleHandle(NULL)
#define IDS_FILE_NOT_FOUND (-1) #define IDS_FILE_NOT_FOUND (-1)
static const WCHAR wszOpen[] = L"open";
static const WCHAR wszExe[] = L".exe"; static const WCHAR wszExe[] = L".exe";
static const WCHAR wszCom[] = L".com"; static const WCHAR wszCom[] = L".com";

View file

@ -91,8 +91,8 @@ static BOOL InitSHCN(HWND hwnd)
assert(s_iStage < NUM_STAGE); assert(s_iStage < NUM_STAGE);
SHChangeNotifyEntry entry; SHChangeNotifyEntry entry;
INT sources; INT sources = 0;
LONG events; LONG events = EVENTS;
switch (s_iStage) switch (s_iStage)
{ {
case 0: case 0:
@ -176,11 +176,7 @@ static BOOL InitSHCN(HWND hwnd)
events = EVENTS; events = EVENTS;
break; break;
} }
default: DEFAULT_UNREACHABLE;
{
assert(0);
break;
}
} }
s_uRegID = SHChangeNotifyRegister(hwnd, sources, events, WM_SHELL_NOTIFY, 1, &entry); s_uRegID = SHChangeNotifyRegister(hwnd, sources, events, WM_SHELL_NOTIFY, 1, &entry);

View file

@ -764,7 +764,7 @@ const char *wine_dbgstr_guid( const GUID *guid )
if (!guid) return "(null)"; if (!guid) return "(null)";
res = get_temp_buffer( 39 ); /* CHARS_IN_GUID */ res = get_temp_buffer( 39 ); /* CHARS_IN_GUID */
sprintf( res, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", sprintf( res, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], (unsigned int)guid->Data1, guid->Data2, guid->Data3, guid->Data4[0],
guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4],
guid->Data4[5], guid->Data4[6], guid->Data4[7] ); guid->Data4[5], guid->Data4[6], guid->Data4[7] );
return res; return res;

View file

@ -29,7 +29,7 @@
typedef LONG NTSTATUS; /* same as in ntdef.h / winternl.h */ typedef LONG NTSTATUS; /* same as in ntdef.h / winternl.h */
#define UNW_FLAG_NHANDLER 0x00 #define UNW_FLAG_NHANDLER 0x0
typedef union typedef union
{ {