Skip to content

Commit

Permalink
Fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
LibretroAdmin committed Dec 22, 2023
1 parent 9d90aff commit 146de90
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion gfx/common/win32_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2693,7 +2693,7 @@ bool win32_get_video_output(DEVMODE *dm, int mode, size_t len)
memset(dm, 0, len);
dm->dmSize = len;
win32_monitor_info(&current_mon, &hm_to_use, &mon_id);
if (WIN32_GET_VIDEO_OUTPUT(&current_mon.szDevice, (mode == -1)
if (WIN32_GET_VIDEO_OUTPUT((const char*)&current_mon.szDevice, (mode == -1)
? ENUM_CURRENT_SETTINGS
: (DWORD)mode,
dm) == 0)
Expand Down
30 changes: 15 additions & 15 deletions gfx/display_servers/dispserv_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
#ifdef __ITaskbarList3_INTERFACE_DEFINED__
#define HAS_TASKBAR_EXT

/* MSVC really doesn't want CINTERFACE to be used
/* MSVC really doesn't want CINTERFACE to be used
* with shobjidl for some reason, but since we use C++ mode,
* we need a workaround... so use the names of the
* we need a workaround... so use the names of the
* COBJMACROS functions instead. */
#if defined(__cplusplus) && !defined(CINTERFACE)
#define ITaskbarList3_HrInit(x) (x)->HrInit()
Expand All @@ -53,14 +53,14 @@
#endif

/*
NOTE: When an application displays a window,
NOTE: When an application displays a window,
its taskbar button is created by the system.
When the button is in place, the taskbar sends a
TaskbarButtonCreated message to the window.
TaskbarButtonCreated message to the window.
Its value is computed by calling RegisterWindowMessage(
L("TaskbarButtonCreated")).
That message must be received by your application before
That message must be received by your application before
it calls any ITaskbarList3 method.
*/
#endif
Expand Down Expand Up @@ -92,13 +92,13 @@ static void *win32_display_server_init(void)

#ifdef HAS_TASKBAR_EXT
#ifdef __cplusplus
/* When compiling in C++ mode, GUIDs
/* When compiling in C++ mode, GUIDs
are references instead of pointers */
if (FAILED(CoCreateInstance(CLSID_TaskbarList, NULL,
CLSCTX_INPROC_SERVER, IID_ITaskbarList3,
(void**)&dispserv->taskbar_list)))
#else
/* Mingw GUIDs are pointers
/* Mingw GUIDs are pointers
instead of references since we're in C mode */
if (FAILED(CoCreateInstance(&CLSID_TaskbarList, NULL,
CLSCTX_INPROC_SERVER, &IID_ITaskbarList3,
Expand Down Expand Up @@ -285,19 +285,19 @@ static bool win32_display_server_set_resolution(void *data,
continue;
#endif

dm.dmFields |= DM_PELSWIDTH | DM_PELSHEIGHT
dm.dmFields |= DM_PELSWIDTH | DM_PELSHEIGHT
| DM_BITSPERPEL | DM_DISPLAYFREQUENCY;
#if _WIN32_WINNT >= 0x0500
dm.dmFields |= DM_DISPLAYORIENTATION;
#endif

win32_monitor_info(&current_mon, &hm_to_use, &mon_id);
res = win32_change_display_settings(&current_mon.szDevice, &dm, CDS_TEST);
res = win32_change_display_settings((const char*)&current_mon.szDevice, &dm, CDS_TEST);

switch (res)
{
case DISP_CHANGE_SUCCESSFUL:
res = win32_change_display_settings(&current_mon.szDevice, &dm, 0);
res = win32_change_display_settings((const char*)&current_mon.szDevice, &dm, 0);
switch (res)
{
case DISP_CHANGE_SUCCESSFUL:
Expand Down Expand Up @@ -461,7 +461,7 @@ void win32_display_server_set_screen_orientation(void *data,
{
int width = dm.dmPelsWidth;

if (( dm.dmDisplayOrientation == DMDO_90
if (( dm.dmDisplayOrientation == DMDO_90
|| dm.dmDisplayOrientation == DMDO_270)
&& (width != (int)dm.dmPelsHeight))
{
Expand All @@ -477,8 +477,8 @@ void win32_display_server_set_screen_orientation(void *data,
{
int width = dm.dmPelsWidth;

if (( dm.dmDisplayOrientation == DMDO_DEFAULT
|| dm.dmDisplayOrientation == DMDO_180)
if (( dm.dmDisplayOrientation == DMDO_DEFAULT
|| dm.dmDisplayOrientation == DMDO_180)
&& (width != (int)dm.dmPelsHeight))
{
/* Device is changing orientations, swap the aspect */
Expand All @@ -493,7 +493,7 @@ void win32_display_server_set_screen_orientation(void *data,
{
int width = dm.dmPelsWidth;

if (( dm.dmDisplayOrientation == DMDO_90
if (( dm.dmDisplayOrientation == DMDO_90
|| dm.dmDisplayOrientation == DMDO_270)
&& (width != (int)dm.dmPelsHeight))
{
Expand All @@ -509,7 +509,7 @@ void win32_display_server_set_screen_orientation(void *data,
{
int width = dm.dmPelsWidth;

if (( dm.dmDisplayOrientation == DMDO_DEFAULT
if (( dm.dmDisplayOrientation == DMDO_DEFAULT
|| dm.dmDisplayOrientation == DMDO_180)
&& (width != (int)dm.dmPelsHeight))
{
Expand Down

0 comments on commit 146de90

Please sign in to comment.