diff --git a/src/device/CMakeLists.txt b/src/device/CMakeLists.txt index ae3fbf3f2..c9da627ef 100644 --- a/src/device/CMakeLists.txt +++ b/src/device/CMakeLists.txt @@ -57,7 +57,7 @@ add_library(dev OBJECT mouse_microtouch_touchscreen.c ) -if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") +if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT MSVC) target_link_libraries(86Box atomic) endif() diff --git a/src/device/serial_passthrough.c b/src/device/serial_passthrough.c index eec9fa62a..ed5abe618 100644 --- a/src/device/serial_passthrough.c +++ b/src/device/serial_passthrough.c @@ -282,8 +282,8 @@ static const device_config_t serial_passthrough_config[] = { .type = CONFIG_SERPORT, .default_string = "", .file_filter = NULL, - .spinner = {}, - .selection = {} + .spinner = { 0 }, + .selection = { { 0 } } }, #ifdef _WIN32 { @@ -292,8 +292,8 @@ static const device_config_t serial_passthrough_config[] = { .type = CONFIG_STRING, .default_string = "\\\\.\\pipe\\86Box\\test", .file_filter = NULL, - .spinner = {}, - .selection = {} + .spinner = { 0 }, + .selection = { { 0 } } }, #endif { diff --git a/src/device/unittester.c b/src/device/unittester.c index e52f3b56f..614438fcb 100644 --- a/src/device/unittester.c +++ b/src/device/unittester.c @@ -104,8 +104,8 @@ struct unittester_state { /* 0x04: Exit */ uint8_t exit_code; }; -static struct unittester_state unittester; -static const struct unittester_state unittester_defaults = { +static struct unittester_state unittester; +static struct unittester_state unittester_defaults = { .trigger_port = 0x0080, .iobase_port = 0xFFFF, .fsm1 = UT_FSM1_WAIT_8, @@ -589,7 +589,7 @@ unittester_trigger_write(UNUSED(uint16_t port), uint8_t val, UNUSED(void *priv)) static void * unittester_init(UNUSED(const device_t *info)) { - unittester = (struct unittester_state) unittester_defaults; + unittester = unittester_defaults; unittester_exit_enabled = !!device_get_config_int("exit_enabled"); diff --git a/src/disk/hdc_xta.c b/src/disk/hdc_xta.c index a4ef45c43..a65ab5c69 100644 --- a/src/disk/hdc_xta.c +++ b/src/disk/hdc_xta.c @@ -1114,7 +1114,7 @@ static const device_config_t wdxt150_config[] = { .default_string = "", .default_int = 0x0320, .file_filter = "", - .spinner = { 0 }, /*W2*/ + .spinner = { 0 }, .selection = { { .description = "320H", .value = 0x0320 }, { .description = "324H", .value = 0x0324 }, @@ -1128,7 +1128,7 @@ static const device_config_t wdxt150_config[] = { .default_string = "", .default_int = 5, .file_filter = "", - .spinner = { 0 }, /*W3*/ + .spinner = { 0 }, .selection = { { .description = "IRQ 5", .value = 5 }, { .description = "IRQ 4", .value = 4 }, @@ -1142,7 +1142,7 @@ static const device_config_t wdxt150_config[] = { .default_string = "", .default_int = 0xc8000, .file_filter = "", - .spinner = { 0 }, /*W1*/ + .spinner = { 0 }, .selection = { { .description = "C800H", .value = 0xc8000 }, { .description = "CA00H", .value = 0xca000 }, @@ -1156,7 +1156,7 @@ static const device_config_t wdxt150_config[] = { .default_string = "rev_1", .default_int = 0, .file_filter = "", - .spinner = { 0 }, /*W1*/ + .spinner = { 0 }, .bios = { { .name = "Revision 1.0", .internal_name = "rev_1", .bios_type = BIOS_NORMAL, .files_no = 1, .local = 0, .size = 8192, .files = { WD_REV_1_BIOS_FILE, "" } }, diff --git a/src/disk/hdc_xtide.c b/src/disk/hdc_xtide.c index 9899e2a0f..b324b4d32 100644 --- a/src/disk/hdc_xtide.c +++ b/src/disk/hdc_xtide.c @@ -238,7 +238,7 @@ static const device_config_t xtide_config[] = { .default_string = "xt", .default_int = 0, .file_filter = "", - .spinner = { 0 }, /*W1*/ + .spinner = { 0 }, .bios = { { .name = "Regular XT", .internal_name = "xt", .bios_type = BIOS_NORMAL, .files_no = 1, .local = 0, .size = 8192, .files = { ROM_PATH_XT, "" } }, @@ -260,7 +260,7 @@ static const device_config_t xtide_at_config[] = { .default_string = "at", .default_int = 0, .file_filter = "", - .spinner = { 0 }, /*W1*/ + .spinner = { 0 }, .bios = { { .name = "Regular AT", .internal_name = "at", .bios_type = BIOS_NORMAL, .files_no = 1, .local = 0, .size = 8192, .files = { ROM_PATH_AT, "" } }, diff --git a/src/floppy/fdd_pcjs.c b/src/floppy/fdd_pcjs.c index b7b3cc69d..76f8ca7dc 100644 --- a/src/floppy/fdd_pcjs.c +++ b/src/floppy/fdd_pcjs.c @@ -20,7 +20,11 @@ #include #include #include +#ifndef _MSC_VER #include +#else +#include +#endif #define HAVE_STDARG_H #include <86box/86box.h> #include <86box/timer.h> diff --git a/src/include/86box/86box.h b/src/include/86box/86box.h index ffa670b7e..503518a2b 100644 --- a/src/include/86box/86box.h +++ b/src/include/86box/86box.h @@ -191,8 +191,13 @@ extern void pclog_ex(const char *fmt, va_list); extern void fatal_ex(const char *fmt, va_list); #endif extern void pclog_toggle_suppr(void); +#ifdef _MSC_VER +extern void pclog(const char *fmt, ...); +extern void fatal(const char *fmt, ...); +#else extern void pclog(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); extern void fatal(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); +#endif extern void set_screen_size(int x, int y); extern void set_screen_size_monitor(int x, int y, int monitor_index); extern void reset_screen_size(void); diff --git a/src/machine/m_at_286_386sx.c b/src/machine/m_at_286_386sx.c index ead31c21c..c3dc5c772 100644 --- a/src/machine/m_at_286_386sx.c +++ b/src/machine/m_at_286_386sx.c @@ -222,10 +222,6 @@ machine_at_ataripc4_init(const machine_t *model) ret = bios_load_interleaved("roms/machines/ataripc4/AMI_PC4X_1.7_EVEN.BIN", "roms/machines/ataripc4/AMI_PC4X_1.7_ODD.BIN", -#if 0 - ret = bios_load_interleaved("roms/machines/ataripc4/ami_pc4x_1.7_even.bin", - "roms/machines/ataripc4/ami_pc4x_1.7_odd.bin", -#endif 0x000f0000, 65536, 0); if (bios_only || !ret) diff --git a/src/machine/m_ps1.c b/src/machine/m_ps1.c index 42bc49de2..3c9f1819f 100644 --- a/src/machine/m_ps1.c +++ b/src/machine/m_ps1.c @@ -252,7 +252,7 @@ static const device_config_t ps1_2011_config[] = { .default_string = "english_us", .default_int = 0, .file_filter = "", - .spinner = { 0 }, /*W1*/ + .spinner = { 0 }, .bios = { { .name = "English (US)", .internal_name = "english_us", .bios_type = BIOS_NORMAL, .files_no = 1, .local = 0, .size = 262144, .files = { "roms/machines/ibmps1es/FC0000_US.BIN", "" } }, diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index 0d42cbd8d..71f41f059 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -41,7 +41,10 @@ pkg_check_modules(SLIRP REQUIRED IMPORTED_TARGET slirp) target_link_libraries(86Box PkgConfig::SLIRP) if(WIN32) - target_link_libraries(PkgConfig::SLIRP INTERFACE wsock32 ws2_32 iphlpapi iconv) + target_link_libraries(PkgConfig::SLIRP INTERFACE wsock32 ws2_32 iphlpapi) + if (NOT MSVC) + target_link_libraries(PkgConfig::SLIRP INTERFACE iconv) + endif() if(STATIC_BUILD) add_compile_definitions(LIBSLIRP_STATIC) endif() diff --git a/src/network/net_rtl8139.c b/src/network/net_rtl8139.c index f04f9b7a3..0dac29a8c 100644 --- a/src/network/net_rtl8139.c +++ b/src/network/net_rtl8139.c @@ -28,6 +28,9 @@ #include #include #include +#ifdef _MVC_VER +#include +#endif #include #define HAVE_STDARG_H #include <86box/86box.h> @@ -531,14 +534,14 @@ rtl8139_write_buffer(RTL8139State *s, const void *buf, int size) if (size > wrapped) { dma_bm_write(s->RxBuf + s->RxBufAddr, - buf, size - wrapped, 1); + (uint8_t *) buf, size - wrapped, 1); } /* reset buffer pointer */ s->RxBufAddr = 0; dma_bm_write(s->RxBuf + s->RxBufAddr, - buf + (size - wrapped), wrapped, 1); + (uint8_t *) buf + (size - wrapped), wrapped, 1); s->RxBufAddr = wrapped; diff --git a/src/network/network.c b/src/network/network.c index e60f50eb1..f4b03ee79 100644 --- a/src/network/network.c +++ b/src/network/network.c @@ -54,7 +54,9 @@ #include #include #include +#ifndef _MSC_VER #include +#endif #include #define HAVE_STDARG_H #include <86box/86box.h> diff --git a/src/qt/qt_harddiskdialog.cpp b/src/qt/qt_harddiskdialog.cpp index f2326ef8b..2acaaeacc 100644 --- a/src/qt/qt_harddiskdialog.cpp +++ b/src/qt/qt_harddiskdialog.cpp @@ -230,7 +230,11 @@ static HarddiskDialog *callbackPtr = nullptr; static MVHDGeom create_drive_vhd_fixed(const QString &fileName, HarddiskDialog *p, uint16_t cyl, uint8_t heads, uint8_t spt) { - MVHDGeom _86box_geometry = { .cyl = cyl, .heads = heads, .spt = spt }; + MVHDGeom _86box_geometry = { + .cyl = cyl, + .heads = heads, + .spt = spt + }; MVHDGeom vhd_geometry; adjust_86box_geometry_for_vhd(&_86box_geometry, &vhd_geometry); @@ -256,7 +260,11 @@ create_drive_vhd_fixed(const QString &fileName, HarddiskDialog *p, uint16_t cyl, static MVHDGeom create_drive_vhd_dynamic(const QString &fileName, uint16_t cyl, uint8_t heads, uint8_t spt, int blocksize) { - MVHDGeom _86box_geometry = { .cyl = cyl, .heads = heads, .spt = spt }; + MVHDGeom _86box_geometry = { + .cyl = cyl, + .heads = heads, + .spt = spt + }; MVHDGeom vhd_geometry; adjust_86box_geometry_for_vhd(&_86box_geometry, &vhd_geometry); int vhd_error = 0; diff --git a/src/qt/qt_vulkanrenderer.cpp b/src/qt/qt_vulkanrenderer.cpp index 9227cdcb3..13728b82e 100644 --- a/src/qt/qt_vulkanrenderer.cpp +++ b/src/qt/qt_vulkanrenderer.cpp @@ -30,10 +30,11 @@ ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ****************************************************************************/ +#include "qt_vulkanrenderer.hpp" #include #include -#include "qt_vulkanrenderer.hpp" + #if QT_CONFIG(vulkan) # include @@ -676,7 +677,7 @@ VulkanRenderer2::initResources() v_texcoord = texcoord; gl_Position = ubuf.mvp * position; } -#endif +#endif /* 0 */ VkShaderModule vertShaderModule = createShader(QStringLiteral(":/texture_vert.spv")); #if 0 #version 440 @@ -691,7 +692,7 @@ VulkanRenderer2::initResources() { fragColor = texture(tex, v_texcoord); } -#endif +#endif /* 0 */ VkShaderModule fragShaderModule = createShader(QStringLiteral(":/texture_frag.spv")); // Graphics pipeline @@ -1009,4 +1010,4 @@ VulkanRenderer2::startNextFrame() m_window->frameReady(); m_window->requestUpdate(); // render continuously, throttled by the presentation rate } -#endif +#endif /* QT_CONFIG(vulkan) */ diff --git a/src/qt/qt_vulkanrenderer.hpp b/src/qt/qt_vulkanrenderer.hpp index d4580d848..2c131e5d7 100644 --- a/src/qt/qt_vulkanrenderer.hpp +++ b/src/qt/qt_vulkanrenderer.hpp @@ -31,6 +31,8 @@ ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ****************************************************************************/ +#ifndef VULKANRENDERER_HPP +#define VULKANRENDERER_HPP #include #include @@ -90,4 +92,6 @@ private: QMatrix4x4 m_proj; }; -#endif +#endif // QT_CONFIG(vulkan) + +#endif // VULKANRENDERER_HPP diff --git a/src/qt/qt_vulkanwindowrenderer.cpp b/src/qt/qt_vulkanwindowrenderer.cpp index 60ad5be96..ab46b5961 100644 --- a/src/qt/qt_vulkanwindowrenderer.cpp +++ b/src/qt/qt_vulkanwindowrenderer.cpp @@ -1,3 +1,35 @@ +/**************************************************************************** +** +** Copyright (C) 2022 Cacodemon345 +** Copyright (C) 2017 The Qt Company Ltd. +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +****************************************************************************/ #include "qt_vulkanwindowrenderer.hpp" #include @@ -697,7 +729,7 @@ public: # if VK_HEADER_VERSION >= 135 && VK_HEADER_VERSION < 162 case VK_ERROR_INCOMPATIBLE_VERSION_KHR: return "VK_ERROR_INCOMPATIBLE_VERSION_KHR"; -# endif +# endif /* VK_HEADER_VERSION >= 135 && VK_HEADER_VERSION < 162 */ case VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT: return "VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT"; case VK_ERROR_NOT_PERMITTED_EXT: @@ -788,7 +820,7 @@ public: m_devFuncs->vkDeviceWaitIdle(m_window->device()); } }; -# endif +# endif /* 0*/ VulkanWindowRenderer::VulkanWindowRenderer(QWidget *parent) : QVulkanWindow(parent->windowHandle()) @@ -851,4 +883,4 @@ VulkanWindowRenderer::getBuffers() { return std::vector { std::make_tuple((uint8_t *) renderer->mappedPtr, &this->buf_usage[0]) }; } -#endif +#endif /* QT_CONFIG(vulkan) */ diff --git a/src/qt/qt_vulkanwindowrenderer.hpp b/src/qt/qt_vulkanwindowrenderer.hpp index 828d091e6..de9f46b6f 100644 --- a/src/qt/qt_vulkanwindowrenderer.hpp +++ b/src/qt/qt_vulkanwindowrenderer.hpp @@ -35,6 +35,6 @@ private: VulkanRenderer2 *renderer; }; -#endif +#endif // QT_CONFIG(vulkan) #endif // VULKANWINDOWRENDERER_HPP diff --git a/src/qt/qt_winrawinputfilter.cpp b/src/qt/qt_winrawinputfilter.cpp index a1da0af61..73e8a2995 100644 --- a/src/qt/qt_winrawinputfilter.cpp +++ b/src/qt/qt_winrawinputfilter.cpp @@ -56,14 +56,18 @@ std::unique_ptr WindowsRawInputFilter::Register(MainWindow *window) { RAWINPUTDEVICE rid[2] = { - {.usUsagePage = 0x01, - .usUsage = 0x06, - .dwFlags = RIDEV_NOHOTKEYS, - .hwndTarget = nullptr}, - { .usUsagePage = 0x01, - .usUsage = 0x02, - .dwFlags = 0, - .hwndTarget = nullptr} + { + .usUsagePage = 0x01, + .usUsage = 0x06, + .dwFlags = RIDEV_NOHOTKEYS, + .hwndTarget = nullptr + }, + { + .usUsagePage = 0x01, + .usUsage = 0x02, + .dwFlags = 0, + .hwndTarget = nullptr + } }; if (hook_enabled && (RegisterRawInputDevices(&(rid[1]), 1, sizeof(rid[0])) == FALSE)) @@ -89,14 +93,18 @@ WindowsRawInputFilter::WindowsRawInputFilter(MainWindow *window) WindowsRawInputFilter::~WindowsRawInputFilter() { RAWINPUTDEVICE rid[2] = { - {.usUsagePage = 0x01, - .usUsage = 0x06, - .dwFlags = RIDEV_REMOVE, - .hwndTarget = NULL}, - { .usUsagePage = 0x01, - .usUsage = 0x02, - .dwFlags = RIDEV_REMOVE, - .hwndTarget = NULL} + { + .usUsagePage = 0x01, + .usUsage = 0x06, + .dwFlags = RIDEV_REMOVE, + .hwndTarget = NULL + }, + { + .usUsagePage = 0x01, + .usUsage = 0x02, + .dwFlags = RIDEV_REMOVE, + .hwndTarget = NULL + } }; if (hook_enabled) diff --git a/src/qt/win_serial_passthrough.c b/src/qt/win_serial_passthrough.c index 2b77bd219..c1802ce73 100644 --- a/src/qt/win_serial_passthrough.c +++ b/src/qt/win_serial_passthrough.c @@ -88,7 +88,7 @@ plat_serpt_set_params(void *priv) const serial_passthrough_t *dev = (serial_passthrough_t *) priv; if (dev->mode == SERPT_MODE_HOSTSER) { - DCB serialattr = {}; + DCB serialattr = { 0 }; GetCommState((HANDLE) dev->master_fd, &serialattr); #define BAUDRATE_RANGE(baud_rate, min, max) \ if (baud_rate >= min && baud_rate < max) { \ diff --git a/src/scsi/scsi_aha154x.c b/src/scsi/scsi_aha154x.c index 58779e7ac..937213b85 100644 --- a/src/scsi/scsi_aha154x.c +++ b/src/scsi/scsi_aha154x.c @@ -1421,7 +1421,7 @@ static const device_config_t aha_154xcp_config[] = { .default_string = "v1_02_en", .default_int = 0, .file_filter = "", - .spinner = { 0 }, /*W1*/ + .spinner = { 0 }, .bios = { { .name = "Version 1.02 (English)", .internal_name = "v1_02_en", .bios_type = BIOS_NORMAL, .files_no = 2, .local = 0, .size = 32768, .files = { "roms/scsi/adaptec/aha1542cp102.bin", diff --git a/src/scsi/scsi_ncr53c400.c b/src/scsi/scsi_ncr53c400.c index bea918660..6622ec59a 100644 --- a/src/scsi/scsi_ncr53c400.c +++ b/src/scsi/scsi_ncr53c400.c @@ -841,7 +841,7 @@ static const device_config_t rt1000b_config[] = { .default_string = "v8_10r", .default_int = 0, .file_filter = "", - .spinner = { 0 }, /*W1*/ + .spinner = { 0 }, .bios = { { .name = "Version 8.10R", .internal_name = "v8_10r", .bios_type = BIOS_NORMAL, .files_no = 1, .local = 0, .size = 8192, .files = { RT1000B_810R_ROM, "" } }, diff --git a/src/sound/midi_fluidsynth.c b/src/sound/midi_fluidsynth.c index ccedb8c41..51383bdcf 100644 --- a/src/sound/midi_fluidsynth.c +++ b/src/sound/midi_fluidsynth.c @@ -330,8 +330,7 @@ static const device_config_t fluidsynth_config[] = { .name = "output_gain", .description = "Output Gain", .type = CONFIG_SPINNER, - .spinner = - { + .spinner = { .min = 0, .max = 100 }, @@ -347,8 +346,7 @@ static const device_config_t fluidsynth_config[] = { .name = "chorus_voices", .description = "Chorus Voices", .type = CONFIG_SPINNER, - .spinner = - { + .spinner = { .min = 0, .max = 99 }, @@ -358,8 +356,7 @@ static const device_config_t fluidsynth_config[] = { .name = "chorus_level", .description = "Chorus Level", .type = CONFIG_SPINNER, - .spinner = - { + .spinner = { .min = 0, .max = 100 }, @@ -369,8 +366,7 @@ static const device_config_t fluidsynth_config[] = { .name = "chorus_speed", .description = "Chorus Speed", .type = CONFIG_SPINNER, - .spinner = - { + .spinner = { .min = 10, .max = 500 }, @@ -380,8 +376,7 @@ static const device_config_t fluidsynth_config[] = { .name = "chorus_depth", .description = "Chorus Depth", .type = CONFIG_SPINNER, - .spinner = - { + .spinner = { .min = 0, .max = 2560 }, @@ -391,8 +386,7 @@ static const device_config_t fluidsynth_config[] = { .name = "chorus_waveform", .description = "Chorus Waveform", .type = CONFIG_SELECTION, - .selection = - { + .selection = { { .description = "Sine", .value = 0 @@ -414,8 +408,7 @@ static const device_config_t fluidsynth_config[] = { .name = "reverb_room_size", .description = "Reverb Room Size", .type = CONFIG_SPINNER, - .spinner = - { + .spinner = { .min = 0, .max = 100 }, @@ -425,8 +418,7 @@ static const device_config_t fluidsynth_config[] = { .name = "reverb_damping", .description = "Reverb Damping", .type = CONFIG_SPINNER, - .spinner = - { + .spinner = { .min = 0, .max = 100 }, @@ -436,8 +428,7 @@ static const device_config_t fluidsynth_config[] = { .name = "reverb_width", .description = "Reverb Width", .type = CONFIG_SPINNER, - .spinner = - { + .spinner = { .min = 0, .max = 1000 }, @@ -447,8 +438,7 @@ static const device_config_t fluidsynth_config[] = { .name = "reverb_level", .description = "Reverb Level", .type = CONFIG_SPINNER, - .spinner = - { + .spinner = { .min = 0, .max = 100 }, @@ -458,8 +448,7 @@ static const device_config_t fluidsynth_config[] = { .name = "interpolation", .description = "Interpolation Method", .type = CONFIG_SELECTION, - .selection = - { + .selection = { { .description = "None", .value = 0 diff --git a/src/sound/resid-fp/siddefs-fp.h b/src/sound/resid-fp/siddefs-fp.h index 9411b1694..22e40f4fb 100644 --- a/src/sound/resid-fp/siddefs-fp.h +++ b/src/sound/resid-fp/siddefs-fp.h @@ -24,7 +24,11 @@ #define RESID_BRANCH_HINTS true // Compiler specifics. +#ifndef _MSC_VER #define HAVE_BUILTIN_EXPECT true +#else +#define HAVE_BUILTIN_EXPECT false +#endif // Branch prediction macros, lifted off the Linux kernel. #if RESID_BRANCH_HINTS && HAVE_BUILTIN_EXPECT diff --git a/src/sound/snd_opl2board.c b/src/sound/snd_opl2board.c index dea7752d0..f1bda3398 100644 --- a/src/sound/snd_opl2board.c +++ b/src/sound/snd_opl2board.c @@ -173,8 +173,8 @@ static const device_config_t opl2board_config[] = { .type = CONFIG_SERPORT, .default_string = "", .file_filter = NULL, - .spinner = {}, - .selection = {} + .spinner = { 0 }, + .selection = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; diff --git a/src/sound/snd_pas16.c b/src/sound/snd_pas16.c index fab2a6a75..ed82afebf 100644 --- a/src/sound/snd_pas16.c +++ b/src/sound/snd_pas16.c @@ -86,6 +86,7 @@ * Copyright 2008-2024 Sarah Walker. * Copyright 2024 Miran Grca. */ +#define _USE_MATH_DEFINES #include #include #include diff --git a/src/video/vid_et3000.c b/src/video/vid_et3000.c index a7d2a749f..45a2fc199 100644 --- a/src/video/vid_et3000.c +++ b/src/video/vid_et3000.c @@ -548,17 +548,20 @@ et3000_available(void) } static const device_config_t et3000_config[] = { - { .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 512, - .selection = { - { .description = "256 KB", - .value = 256 }, - { .description = "512 KB", - .value = 512 }, - { .description = "" } } }, + // clang-format off + { + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 512, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "" } + } + }, { .type = CONFIG_END } + // clang-format on }; const device_t et3000_isa_device = { diff --git a/src/video/vid_et4000.c b/src/video/vid_et4000.c index caf8d03c7..ad8cf5c46 100644 --- a/src/video/vid_et4000.c +++ b/src/video/vid_et4000.c @@ -972,7 +972,7 @@ static const device_config_t et4000_tc6058af_config[] = { .default_string = "v1_10", .default_int = 0, .file_filter = "", - .spinner = { 0 }, /*W1*/ + .spinner = { 0 }, .bios = { { .name = "Version 1.10", .internal_name = "v1_10", .bios_type = BIOS_NORMAL, .files_no = 1, .local = 0, .size = 32768, .files = { TC6058AF_BIOS_ROM_PATH, "" } }, @@ -1019,7 +1019,7 @@ static const device_config_t et4000_bios_config[] = { .default_string = "v8_01", .default_int = 0, .file_filter = "", - .spinner = { 0 }, /*W1*/ + .spinner = { 0 }, .bios = { { .name = "Version 8.01", .internal_name = "v8_01", .bios_type = BIOS_NORMAL, .files_no = 1, .local = 0, .size = 32768, .files = { BIOS_ROM_PATH, "" } }, diff --git a/src/video/vid_ht216.c b/src/video/vid_ht216.c index c1f5cbeaf..a249631ee 100644 --- a/src/video/vid_ht216.c +++ b/src/video/vid_ht216.c @@ -1701,52 +1701,37 @@ ht216_force_redraw(void *priv) ht216->svga.fullchange = changeframecount; } +// clang-format off static const device_config_t v7_vga_1024i_config[] = { - { .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 512, - .selection = { - { .description = "256 KB", - .value = 256 }, - { .description = "512 KB", - .value = 512 }, - { .description = "" } } }, + { + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 512, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "" } + } + }, { .type = CONFIG_END } }; -// clang-format off static const device_config_t ht216_32_standalone_config[] = { { - .name = "monitor_type", + .name = "monitor_type", .description = "Monitor type", - .type = CONFIG_SELECTION, + .type = CONFIG_SELECTION, .default_int = 0x18, - .selection = { - { - .description = "Mono Interlaced", - .value = 0x00 - }, - { - .description = "Mono Non-Interlaced", - .value = 0x08 - }, - { - .description = "Color Interlaced", - .value = 0x10 - }, - { - .description = "Color Non-Interlaced", - .value = 0x18 - }, - { - .description = "" - } + .selection = { + { .description = "Mono Interlaced", .value = 0x00 }, + { .description = "Mono Non-Interlaced", .value = 0x08 }, + { .description = "Color Interlaced", .value = 0x10 }, + { .description = "Color Non-Interlaced", .value = 0x18 }, + { .description = "" } } }, - { - .type = CONFIG_END - } + { .type = CONFIG_END } }; // clang-format on diff --git a/src/video/vid_mga.c b/src/video/vid_mga.c index 1bdbecdf6..2b9e63af4 100644 --- a/src/video/vid_mga.c +++ b/src/video/vid_mga.c @@ -6851,8 +6851,7 @@ static const device_config_t mystique_config[] = { .name = "memory", .description = "Memory size", .type = CONFIG_SELECTION, - .selection = - { + .selection = { { .description = "2 MB", .value = 2 @@ -6865,15 +6864,11 @@ static const device_config_t mystique_config[] = { .description = "8 MB", .value = 8 }, - { - .description = "" - } + { .description = "" } }, .default_int = 8 }, - { - .type = CONFIG_END - } + { .type = CONFIG_END } // clang-format on }; @@ -6883,8 +6878,7 @@ static const device_config_t millennium_ii_config[] = { .name = "memory", .description = "Memory size", .type = CONFIG_SELECTION, - .selection = - { + .selection = { { .description = "4 MB", .value = 4 @@ -6897,15 +6891,11 @@ static const device_config_t millennium_ii_config[] = { .description = "16 MB", .value = 16 }, - { - .description = "" - } + { .description = "" } }, .default_int = 8 }, - { - .type = CONFIG_END - } + { .type = CONFIG_END } // clang-format on };