Style nits

This commit is contained in:
twinaphex 2020-05-12 14:36:27 +02:00
parent 9088137051
commit bde18ba86a
2 changed files with 107 additions and 87 deletions

View File

@ -52,7 +52,10 @@ static VkDevice cached_device_vk;
static retro_vulkan_destroy_device_t cached_destroy_device_vk; static retro_vulkan_destroy_device_t cached_destroy_device_vk;
static struct string_list *vulkan_gpu_list = NULL; static struct string_list *vulkan_gpu_list = NULL;
//#define WSI_HARDENING_TEST #if 0
#define WSI_HARDENING_TEST
#endif
#ifdef WSI_HARDENING_TEST #ifdef WSI_HARDENING_TEST
static unsigned wsi_harden_counter = 0; static unsigned wsi_harden_counter = 0;
static unsigned wsi_harden_counter2 = 0; static unsigned wsi_harden_counter2 = 0;
@ -1978,9 +1981,7 @@ bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk,
#else #else
vulkan_library = dylib_load("libvulkan.so"); vulkan_library = dylib_load("libvulkan.so");
if (!vulkan_library) if (!vulkan_library)
{
vulkan_library = dylib_load("libvulkan.so.1"); vulkan_library = dylib_load("libvulkan.so.1");
}
#endif #endif
} }

View File

@ -117,24 +117,29 @@ extern bool dinput_handle_message(void *dinput, UINT message,
WPARAM wParam, LPARAM lParam); WPARAM wParam, LPARAM lParam);
#endif #endif
typedef struct DISPLAYCONFIG_RATIONAL_CUSTOM { typedef struct DISPLAYCONFIG_RATIONAL_CUSTOM
{
UINT32 Numerator; UINT32 Numerator;
UINT32 Denominator; UINT32 Denominator;
} DISPLAYCONFIG_RATIONAL_CUSTOM; } DISPLAYCONFIG_RATIONAL_CUSTOM;
typedef struct DISPLAYCONFIG_2DREGION_CUSTOM { typedef struct DISPLAYCONFIG_2DREGION_CUSTOM
{
UINT32 cx; UINT32 cx;
UINT32 cy; UINT32 cy;
} DISPLAYCONFIG_2DREGION_CUSTOM; } DISPLAYCONFIG_2DREGION_CUSTOM;
typedef struct DISPLAYCONFIG_VIDEO_SIGNAL_INFO_CUSTOM { typedef struct DISPLAYCONFIG_VIDEO_SIGNAL_INFO_CUSTOM
{
UINT64 pixelRate; UINT64 pixelRate;
DISPLAYCONFIG_RATIONAL_CUSTOM hSyncFreq; DISPLAYCONFIG_RATIONAL_CUSTOM hSyncFreq;
DISPLAYCONFIG_RATIONAL_CUSTOM vSyncFreq; DISPLAYCONFIG_RATIONAL_CUSTOM vSyncFreq;
DISPLAYCONFIG_2DREGION_CUSTOM activeSize; DISPLAYCONFIG_2DREGION_CUSTOM activeSize;
DISPLAYCONFIG_2DREGION_CUSTOM totalSize; DISPLAYCONFIG_2DREGION_CUSTOM totalSize;
union { union
struct { {
struct
{
UINT32 videoStandard :16; UINT32 videoStandard :16;
UINT32 vSyncFreqDivider :6; UINT32 vSyncFreqDivider :6;
UINT32 reserved :10; UINT32 reserved :10;
@ -144,16 +149,20 @@ typedef struct DISPLAYCONFIG_VIDEO_SIGNAL_INFO_CUSTOM {
UINT32 scanLineOrdering; UINT32 scanLineOrdering;
} DISPLAYCONFIG_VIDEO_SIGNAL_INFO_CUSTOM; } DISPLAYCONFIG_VIDEO_SIGNAL_INFO_CUSTOM;
typedef struct DISPLAYCONFIG_TARGET_MODE_CUSTOM { typedef struct DISPLAYCONFIG_TARGET_MODE_CUSTOM
{
DISPLAYCONFIG_VIDEO_SIGNAL_INFO_CUSTOM targetVideoSignalInfo; DISPLAYCONFIG_VIDEO_SIGNAL_INFO_CUSTOM targetVideoSignalInfo;
} DISPLAYCONFIG_TARGET_MODE_CUSTOM; } DISPLAYCONFIG_TARGET_MODE_CUSTOM;
typedef struct DISPLAYCONFIG_PATH_SOURCE_INFO_CUSTOM { typedef struct DISPLAYCONFIG_PATH_SOURCE_INFO_CUSTOM
{
LUID adapterId; LUID adapterId;
UINT32 id; UINT32 id;
union { union
{
UINT32 modeInfoIdx; UINT32 modeInfoIdx;
struct { struct
{
UINT32 cloneGroupId :16; UINT32 cloneGroupId :16;
UINT32 sourceModeInfoIdx :16; UINT32 sourceModeInfoIdx :16;
} dummystructname; } dummystructname;
@ -161,36 +170,43 @@ typedef struct DISPLAYCONFIG_PATH_SOURCE_INFO_CUSTOM {
UINT32 statusFlags; UINT32 statusFlags;
} DISPLAYCONFIG_PATH_SOURCE_INFO_CUSTOM; } DISPLAYCONFIG_PATH_SOURCE_INFO_CUSTOM;
typedef struct DISPLAYCONFIG_DESKTOP_IMAGE_INFO_CUSTOM { typedef struct DISPLAYCONFIG_DESKTOP_IMAGE_INFO_CUSTOM
{
POINTL PathSourceSize; POINTL PathSourceSize;
RECTL DesktopImageRegion; RECTL DesktopImageRegion;
RECTL DesktopImageClip; RECTL DesktopImageClip;
} DISPLAYCONFIG_DESKTOP_IMAGE_INFO_CUSTOM; } DISPLAYCONFIG_DESKTOP_IMAGE_INFO_CUSTOM;
typedef struct DISPLAYCONFIG_SOURCE_MODE_CUSTOM { typedef struct DISPLAYCONFIG_SOURCE_MODE_CUSTOM
{
UINT32 width; UINT32 width;
UINT32 height; UINT32 height;
UINT32 pixelFormat; UINT32 pixelFormat;
POINTL position; POINTL position;
} DISPLAYCONFIG_SOURCE_MODE_CUSTOM; } DISPLAYCONFIG_SOURCE_MODE_CUSTOM;
typedef struct DISPLAYCONFIG_MODE_INFO_CUSTOM { typedef struct DISPLAYCONFIG_MODE_INFO_CUSTOM
{
UINT32 infoType; UINT32 infoType;
UINT32 id; UINT32 id;
LUID adapterId; LUID adapterId;
union { union
{
DISPLAYCONFIG_TARGET_MODE_CUSTOM targetMode; DISPLAYCONFIG_TARGET_MODE_CUSTOM targetMode;
DISPLAYCONFIG_SOURCE_MODE_CUSTOM sourceMode; DISPLAYCONFIG_SOURCE_MODE_CUSTOM sourceMode;
DISPLAYCONFIG_DESKTOP_IMAGE_INFO_CUSTOM desktopImageInfo; DISPLAYCONFIG_DESKTOP_IMAGE_INFO_CUSTOM desktopImageInfo;
} dummyunionname; } dummyunionname;
} DISPLAYCONFIG_MODE_INFO_CUSTOM; } DISPLAYCONFIG_MODE_INFO_CUSTOM;
typedef struct DISPLAYCONFIG_PATH_TARGET_INFO_CUSTOM { typedef struct DISPLAYCONFIG_PATH_TARGET_INFO_CUSTOM
{
LUID adapterId; LUID adapterId;
UINT32 id; UINT32 id;
union { union
{
UINT32 modeInfoIdx; UINT32 modeInfoIdx;
struct { struct
{
UINT32 desktopModeInfoIdx :16; UINT32 desktopModeInfoIdx :16;
UINT32 targetModeInfoIdx :16; UINT32 targetModeInfoIdx :16;
} dummystructname; } dummystructname;
@ -204,7 +220,8 @@ typedef struct DISPLAYCONFIG_PATH_TARGET_INFO_CUSTOM {
UINT32 statusFlags; UINT32 statusFlags;
} DISPLAYCONFIG_PATH_TARGET_INFO_CUSTOM; } DISPLAYCONFIG_PATH_TARGET_INFO_CUSTOM;
typedef struct DISPLAYCONFIG_PATH_INFO_CUSTOM { typedef struct DISPLAYCONFIG_PATH_INFO_CUSTOM
{
DISPLAYCONFIG_PATH_SOURCE_INFO_CUSTOM sourceInfo; DISPLAYCONFIG_PATH_SOURCE_INFO_CUSTOM sourceInfo;
DISPLAYCONFIG_PATH_TARGET_INFO_CUSTOM targetInfo; DISPLAYCONFIG_PATH_TARGET_INFO_CUSTOM targetInfo;
UINT32 flags; UINT32 flags;
@ -301,7 +318,7 @@ bool win32_taskbar_is_created(void)
return taskbar_is_created; return taskbar_is_created;
} }
static INT_PTR_COMPAT CALLBACK PickCoreProc( static INT_PTR_COMPAT CALLBACK pick_core_proc(
HWND hDlg, UINT message, HWND hDlg, UINT message,
WPARAM wParam, LPARAM lParam) WPARAM wParam, LPARAM lParam)
{ {
@ -528,7 +545,7 @@ bool win32_load_content_from_gui(const char *szFilename)
/* Pick one core that could be compatible, ew */ /* Pick one core that could be compatible, ew */
if (DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_PICKCORE), if (DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_PICKCORE),
main_window.hwnd, PickCoreProc, (LPARAM)NULL) == IDOK) main_window.hwnd, pick_core_proc, (LPARAM)NULL) == IDOK)
{ {
task_push_load_content_with_current_core_from_companion_ui( task_push_load_content_with_current_core_from_companion_ui(
NULL, &content_info, CORE_TYPE_PLAIN, NULL, NULL); NULL, &content_info, CORE_TYPE_PLAIN, NULL, NULL);
@ -822,7 +839,8 @@ static LRESULT win32_menu_loop(HWND owner, WPARAM wparam)
return 0L; return 0L;
} }
static LRESULT CALLBACK WndProcCommon(bool *quit, HWND hwnd, UINT message, static LRESULT CALLBACK wnd_proc_common(
bool *quit, HWND hwnd, UINT message,
WPARAM wparam, LPARAM lparam) WPARAM wparam, LPARAM lparam)
{ {
bool keydown = true; bool keydown = true;
@ -1028,7 +1046,7 @@ LRESULT CALLBACK WndProcD3D(HWND hwnd, UINT message,
case WM_MOVE: case WM_MOVE:
case WM_SIZE: case WM_SIZE:
case WM_COMMAND: case WM_COMMAND:
ret = WndProcCommon(&quit, hwnd, message, wparam, lparam); ret = wnd_proc_common(&quit, hwnd, message, wparam, lparam);
if (quit) if (quit)
return ret; return ret;
#if _WIN32_WINNT >= 0x0500 /* 2K */ #if _WIN32_WINNT >= 0x0500 /* 2K */
@ -1092,8 +1110,7 @@ LRESULT CALLBACK WndProcWGL(HWND hwnd, UINT message,
case WM_MOVE: case WM_MOVE:
case WM_SIZE: case WM_SIZE:
case WM_COMMAND: case WM_COMMAND:
ret = WndProcCommon(&quit, ret = wnd_proc_common(&quit, hwnd, message, wparam, lparam);
hwnd, message, wparam, lparam);
if (quit) if (quit)
return ret; return ret;
#if _WIN32_WINNT >= 0x0500 /* 2K */ #if _WIN32_WINNT >= 0x0500 /* 2K */
@ -1195,7 +1212,7 @@ LRESULT CALLBACK WndProcGDI(HWND hwnd, UINT message,
case WM_MOVE: case WM_MOVE:
case WM_SIZE: case WM_SIZE:
case WM_COMMAND: case WM_COMMAND:
ret = WndProcCommon(&quit, hwnd, message, wparam, lparam); ret = wnd_proc_common(&quit, hwnd, message, wparam, lparam);
if (quit) if (quit)
return ret; return ret;
#if _WIN32_WINNT >= 0x0500 /* 2K */ #if _WIN32_WINNT >= 0x0500 /* 2K */
@ -1856,7 +1873,9 @@ bool win32_get_video_output(DEVMODE *dm, int mode, size_t len)
memset(dm, 0, len); memset(dm, 0, len);
dm->dmSize = len; dm->dmSize = len;
if (win32_internal_get_video_output((mode == -1) ? ENUM_CURRENT_SETTINGS : mode, if (win32_internal_get_video_output((mode == -1)
? ENUM_CURRENT_SETTINGS
: mode,
dm) == 0) dm) == 0)
return false; return false;
return true; return true;