diff --git a/src/cdrom/cdrom_image_backend.c b/src/cdrom/cdrom_image_backend.c index e94668d75..9b9775603 100644 --- a/src/cdrom/cdrom_image_backend.c +++ b/src/cdrom/cdrom_image_backend.c @@ -652,9 +652,7 @@ cdi_cue_get_buffer(char *str, char **line, int up) done = 1; break; } -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; default: if (up && islower((int) *s)) diff --git a/src/cdrom/cdrom_mitsumi.c b/src/cdrom/cdrom_mitsumi.c index 6c015fa9d..19e19a420 100644 --- a/src/cdrom/cdrom_mitsumi.c +++ b/src/cdrom/cdrom_mitsumi.c @@ -324,9 +324,7 @@ mitsumi_cdrom_out(uint16_t port, uint8_t val, void *priv) break; case 5: dev->readmsf = 0; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 4: case 3: dev->readmsf |= CD_DCB(val) << ((dev->cmdrd_count - 3) << 3); diff --git a/src/chipset/ali1621.c b/src/chipset/ali1621.c index ce3974a70..6194dce19 100644 --- a/src/chipset/ali1621.c +++ b/src/chipset/ali1621.c @@ -114,9 +114,7 @@ ali1621_smram_recalc(uint8_t val, ali1621_t *dev) switch (val & 0x30) { case 0x10: /* Open. */ access_normal = ACCESS_SMRAM_RX; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x30: /* Protect. */ access_smm |= ACCESS_SMRAM_R; break; @@ -129,9 +127,7 @@ ali1621_smram_recalc(uint8_t val, ali1621_t *dev) switch (val & 0x30) { case 0x10: /* Open. */ access_normal |= ACCESS_SMRAM_W; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x30: /* Protect. */ access_smm |= ACCESS_SMRAM_W; break; diff --git a/src/chipset/ali6117.c b/src/chipset/ali6117.c index 78705ee26..c7ada4bc6 100644 --- a/src/chipset/ali6117.c +++ b/src/chipset/ali6117.c @@ -234,9 +234,7 @@ ali6117_reg_write(uint16_t addr, uint8_t val, void *priv) case 0x12: val &= 0xf7; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x14: case 0x15: diff --git a/src/chipset/opti283.c b/src/chipset/opti283.c index 865ec6ff5..1fa59f2f0 100644 --- a/src/chipset/opti283.c +++ b/src/chipset/opti283.c @@ -229,9 +229,7 @@ opti283_write(uint16_t addr, uint8_t val, void *priv) case 0x14: reset_on_hlt = !!(val & 0x40); -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x11: case 0x12: case 0x13: diff --git a/src/chipset/via_pipc.c b/src/chipset/via_pipc.c index 58a981814..b284cb6b9 100644 --- a/src/chipset/via_pipc.c +++ b/src/chipset/via_pipc.c @@ -1477,9 +1477,7 @@ pipc_write(int func, int addr, uint8_t val, void *priv) case 0xd2: if (dev->local == VIA_PIPC_686B) smbus_piix4_setclock(dev->smbus, (val & 0x04) ? 65536 : 16384); -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x90: case 0x91: diff --git a/src/device/kbc_at.c b/src/device/kbc_at.c index e448469ff..472c71b0f 100644 --- a/src/device/kbc_at.c +++ b/src/device/kbc_at.c @@ -468,9 +468,7 @@ kbc_at_poll_at(atkbc_t *dev) case STATE_KBC_AMI_OUT: if (dev->status & STAT_OFULL) break; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case STATE_MAIN_IBF: default: at_main_ibf: @@ -593,9 +591,7 @@ kbc_at_poll_ps2(atkbc_t *dev) case STATE_KBC_AMI_OUT: if (dev->status & STAT_OFULL) break; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case STATE_MAIN_IBF: default: ps2_main_ibf: diff --git a/src/device/kbc_at_dev.c b/src/device/kbc_at_dev.c index 894b5f08a..1c1a0e91a 100644 --- a/src/device/kbc_at_dev.c +++ b/src/device/kbc_at_dev.c @@ -136,9 +136,7 @@ kbc_at_dev_poll(void *priv) dev->port->wantcmd = 0; break; } -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case DEV_STATE_MAIN_WANT_IN: /* Output command response and then return to main loop #2. */ if ((dev->port->out_new == -1) && (dev->cmd_queue_start != dev->cmd_queue_end)) { diff --git a/src/device/mouse_serial.c b/src/device/mouse_serial.c index 88df5219d..09df1e409 100644 --- a/src/device/mouse_serial.c +++ b/src/device/mouse_serial.c @@ -28,8 +28,6 @@ #include <86box/serial.h> #include <86box/mouse.h> #include <86box/plat.h> -#include <86box/plat_fallthrough.h> -#include <86box/plat_unused.h> #define SERMOUSE_PORT 0 /* attach to Serial0 */ @@ -672,9 +670,7 @@ ltsermouse_process_command(mouse_t *dev) case 0x41: /* Absolute Bit Pad One Packed Binary Format */ dev->abs_x = dev->abs_y = 0; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x42: /* Relative Bit Pad One Packed Binary Format */ case 0x53: /* MM Series Data Format */ case 0x54: /* Three Byte Packed Binary Format */ @@ -759,9 +755,7 @@ ltsermouse_process_data(mouse_t *dev) switch (dev->ib) { default: mouse_serial_log("Serial mouse: Invalid period %02X, using 1200 bps\n", data); -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x6e: dev->bps = 1200; break; @@ -870,14 +864,10 @@ ltsermouse_write(UNUSED(struct serial_s *serial), void *priv, uint8_t data) case STATE_TRANSMIT: case STATE_SKIP_REPORT: sermouse_set_period(dev, 0.0); -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; default: dev->state = STATE_COMMAND; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case STATE_DATA: sermouse_timer(dev); break; diff --git a/src/device/smbus_ali7101.c b/src/device/smbus_ali7101.c index 855f0c270..349de470d 100644 --- a/src/device/smbus_ali7101.c +++ b/src/device/smbus_ali7101.c @@ -193,10 +193,7 @@ smbus_ali7101_write(uint16_t addr, uint8_t val, void *priv) case 0x4: /* block R/W */ timer_bytes++; /* count the SMBus length byte now */ - -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; default: /* unknown */ dev->next_stat = 0x20; /* raise DEV_ERR */ diff --git a/src/device/smbus_piix4.c b/src/device/smbus_piix4.c index bad49b957..6f2b1632e 100644 --- a/src/device/smbus_piix4.c +++ b/src/device/smbus_piix4.c @@ -195,10 +195,7 @@ smbus_piix4_write(uint16_t addr, uint8_t val, void *priv) i2c_write(i2c_smbus, smbus_addr, dev->cmd); timer_bytes++; } - -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0xc: /* I2C process call */ if (!read) { /* word write (only when writing) */ @@ -216,10 +213,7 @@ smbus_piix4_write(uint16_t addr, uint8_t val, void *priv) case 0x5: /* block R/W */ timer_bytes++; /* count the SMBus length byte now */ - -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0xd: /* I2C block R/W */ i2c_write(i2c_smbus, smbus_addr, dev->cmd); @@ -251,10 +245,7 @@ smbus_piix4_write(uint16_t addr, uint8_t val, void *priv) /* command write */ i2c_write(i2c_smbus, smbus_addr, dev->cmd); timer_bytes++; - -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0xe: /* I2C with 7-bit address */ if (!read) { /* word write (only when writing) */ diff --git a/src/disk/hdc_esdi_at.c b/src/disk/hdc_esdi_at.c index 258ea9d0f..35f2db754 100644 --- a/src/disk/hdc_esdi_at.c +++ b/src/disk/hdc_esdi_at.c @@ -338,9 +338,7 @@ esdi_write(uint16_t port, uint8_t val, void *priv) esdi->command &= ~0x03; if (val & 0x02) fatal("Read with ECC\n"); -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0xa0: esdi->status = STAT_BUSY; @@ -399,9 +397,7 @@ esdi_write(uint16_t port, uint8_t val, void *priv) default: esdi_at_log("WD1007: bad command %02X\n", val); -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0xe8: /*???*/ esdi->status = STAT_BUSY; esdi_set_callback(esdi, 200 * HDC_TIME); diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c index ace646328..01d1d28bf 100644 --- a/src/disk/hdc_ide.c +++ b/src/disk/hdc_ide.c @@ -1655,9 +1655,7 @@ ide_writeb(uint16_t addr, uint8_t val, void *priv) disabled, the Read Multiple operation is rejected with an Aborted Com- mand error. */ ide->blockcount = 0; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case WIN_READ: case WIN_READ_NORETRY: @@ -1706,9 +1704,7 @@ ide_writeb(uint16_t addr, uint8_t val, void *priv) /* Turn on the activity indicator *here* so that it gets turned on less times. */ ui_sb_update_icon(SB_HDD | hdd[ide->hdd_num].bus, 1); -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case WIN_WRITE: case WIN_WRITE_NORETRY: diff --git a/src/disk/hdc_st506_xt.c b/src/disk/hdc_st506_xt.c index 766d70145..c924393e4 100644 --- a/src/disk/hdc_st506_xt.c +++ b/src/disk/hdc_st506_xt.c @@ -623,9 +623,7 @@ st506_callback(void *priv) st506_complete(dev); break; } -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case CMD_FORMAT_TRACK: case CMD_FORMAT_BAD_TRACK: @@ -1608,9 +1606,7 @@ st506_init(const device_t *info) case ST506_XT_TYPE_ST11R: /* Seagate ST-11R (RLL) */ dev->spt = RLL_SECTORS; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case ST506_XT_TYPE_ST11M: /* Seagate ST-11M (MFM) */ dev->nr_err = ERR_NOT_AVAILABLE; diff --git a/src/disk/hdc_xta.c b/src/disk/hdc_xta.c index b27648eca..9325c8f91 100644 --- a/src/disk/hdc_xta.c +++ b/src/disk/hdc_xta.c @@ -509,9 +509,7 @@ hdc_callback(void *priv) case CMD_READ_VERIFY: no_data = 1; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case CMD_READ_SECTORS: if (!drive->present) { @@ -536,9 +534,7 @@ hdc_callback(void *priv) dev->buf_len = 512; dev->state = STATE_SEND; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case STATE_SEND: /* Activate the status icon. */ @@ -646,9 +642,7 @@ do_send: dev->buf_len = 512; dev->state = STATE_RECV; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case STATE_RECV: /* Activate the status icon. */ diff --git a/src/disk/mo.c b/src/disk/mo.c index eef83ec3a..378661683 100644 --- a/src/disk/mo.c +++ b/src/disk/mo.c @@ -655,9 +655,8 @@ mo_update_request_length(mo_t *dev, int len, int block_len) break; } } -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; + default: dev->packet_len = len; break; @@ -1344,9 +1343,7 @@ mo_command(scsi_common_t *sc, uint8_t *cdb) mo_invalid_field(dev); return; } -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case GPCMD_SCSI_RESERVE: case GPCMD_SCSI_RELEASE: case GPCMD_TEST_UNIT_READY: diff --git a/src/disk/zip.c b/src/disk/zip.c index cd7359c05..4473feca1 100644 --- a/src/disk/zip.c +++ b/src/disk/zip.c @@ -821,9 +821,7 @@ zip_update_request_length(zip_t *dev, int len, int block_len) break; } } -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; default: dev->packet_len = len; @@ -1411,9 +1409,7 @@ zip_command(scsi_common_t *sc, uint8_t *cdb) zip_invalid_field(dev); return; } -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case GPCMD_SCSI_RESERVE: case GPCMD_SCSI_RELEASE: case GPCMD_TEST_UNIT_READY: @@ -1576,9 +1572,7 @@ zip_command(scsi_common_t *sc, uint8_t *cdb) zip_command_complete(dev); break; } -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case GPCMD_WRITE_6: case GPCMD_WRITE_10: case GPCMD_WRITE_AND_VERIFY_10: diff --git a/src/floppy/fdc.c b/src/floppy/fdc.c index 37e078b76..a163e5ca1 100644 --- a/src/floppy/fdc.c +++ b/src/floppy/fdc.c @@ -917,9 +917,7 @@ fdc_write(uint16_t addr, uint8_t val, void *priv) fdc_bad_command(fdc); break; } -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x07: /*Recalibrate*/ fdc->pnum = 0; fdc->ptot = 1; @@ -962,9 +960,7 @@ fdc_write(uint16_t addr, uint8_t val, void *priv) fdc_bad_command(fdc); break; } -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x10: /*Get version*/ case 0x14: /*Unlock*/ case 0x94: /*Lock*/ @@ -1086,9 +1082,7 @@ fdc_write(uint16_t addr, uint8_t val, void *priv) case 0x16: /* Verify */ if (fdc->params[0] & 0x80) fdc->sc = fdc->params[7]; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x06: /* Read data */ case 0x0c: /* Read deleted data */ fdc_io_command_phase1(fdc, 0); diff --git a/src/floppy/fdd_86f.c b/src/floppy/fdd_86f.c index 0e8085a71..4acb372d2 100644 --- a/src/floppy/fdd_86f.c +++ b/src/floppy/fdd_86f.c @@ -1951,9 +1951,7 @@ d86f_format_track(int drive, int side, int do_write) if (dev->datac == 3) fdc_stop_id_request(d86f_fdc); } -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case FMT_PRETRK_SYNC: case FMT_SECTOR_DATA_SYNC: @@ -2296,9 +2294,7 @@ d86f_turbo_poll(int drive, int side) case STATE_0D_SPIN_TO_INDEX: dev->sector_count = 0; dev->datac = 5; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case STATE_02_SPIN_TO_INDEX: dev->state++; @@ -2343,9 +2339,7 @@ d86f_turbo_poll(int drive, int side) dev->last_sector.id.r = dev->req_sector.id.r; dev->last_sector.id.n = dev->req_sector.id.n; d86f_handler[drive].set_sector(drive, side, dev->last_sector.id.c, dev->last_sector.id.h, dev->last_sector.id.r, dev->last_sector.id.n); -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case STATE_0A_FIND_ID: dev->turbo_pos = 0; diff --git a/src/include/86box/plat.h b/src/include/86box/plat.h index 2b0809c2e..582b453a7 100644 --- a/src/include/86box/plat.h +++ b/src/include/86box/plat.h @@ -55,8 +55,13 @@ extern int strnicmp(const char *s1, const char *s2, size_t n); # define off64_t off_t #endif -#if !defined (__APPLE__) && !defined(__clang__) -# define FALLTHROUGH_ANNOTATION +#if __has_attribute(fallthrough) +# define fallthrough __attribute__((fallthrough)) +#else +# if __has_attribute(__fallthrough__) +# define fallthrough __attribute__((__fallthrough__)) +# endif +# define fallthrough do {} while (0) /* fallthrough */ #endif #ifdef _MSC_VER diff --git a/src/include/86box/plat_fallthrough.h b/src/include/86box/plat_fallthrough.h index 212d662fe..8d3f4581b 100644 --- a/src/include/86box/plat_fallthrough.h +++ b/src/include/86box/plat_fallthrough.h @@ -18,8 +18,13 @@ #ifndef EMU_PLAT_FALLTHROUGH_H #define EMU_PLAT_FALLTHROUGH_H -#if !defined (__APPLE__) && !defined(__clang__) -# define FALLTHROUGH_ANNOTATION +#if __has_attribute(__fallthrough__) +# define fallthrough __attribute__((__fallthrough__)) +#else +# if __has_attribute(fallthrough) +# define fallthrough __attribute__((fallthrough)) +# endif +# define fallthrough do {} while (0) /* fallthrough */ #endif #endif /*EMU_PLAT_FALLTHROUGH_H*/ diff --git a/src/machine/m_elt.c b/src/machine/m_elt.c index 573095223..95ca52a3e 100644 --- a/src/machine/m_elt.c +++ b/src/machine/m_elt.c @@ -124,9 +124,7 @@ elt_vid_out(uint16_t addr, uint8_t val, void *priv) case 0x3d1: if (cga->crtcreg >= 32) return; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; default: cga->crtcreg &= 31; diff --git a/src/machine/m_ps1_hdc.c b/src/machine/m_ps1_hdc.c index 225ae04a5..2636812d4 100644 --- a/src/machine/m_ps1_hdc.c +++ b/src/machine/m_ps1_hdc.c @@ -699,9 +699,7 @@ do_fmt: /* Done with this track. */ dev->state = STATE_FDONE; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case STATE_FDONE: /* One more track done. */ if (++start_cyl == end_cyl) { diff --git a/src/network/net_ne2000.c b/src/network/net_ne2000.c index 2221fccf4..56f7facff 100644 --- a/src/network/net_ne2000.c +++ b/src/network/net_ne2000.c @@ -759,9 +759,7 @@ nic_pci_write(UNUSED(int func), int addr, uint8_t val, void *priv) case 0x10: /* PCI_BAR */ val &= 0xe0; /* 0xe0 acc to RTL DS */ val |= 0x01; /* re-enable IOIN bit */ -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x11: /* PCI_BAR */ case 0x12: /* PCI_BAR */ diff --git a/src/network/net_wd8003.c b/src/network/net_wd8003.c index 61c35986d..04b922aaf 100644 --- a/src/network/net_wd8003.c +++ b/src/network/net_wd8003.c @@ -735,9 +735,8 @@ wd_init(const device_t *info) /* Ethernet, MCA, 5x3 interface chip, RAM 16k */ case WD8003EA: dev->board_chip = WE_ID_SOFT_CONFIG; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; + /* Ethernet, MCA, no interface chip, RAM 16k */ case WD8003ETA: dev->board_chip |= WE_TYPE_WD8013EBT | WE_ID_BUS_MCA; diff --git a/src/pci_dummy.c b/src/pci_dummy.c index 3077b59a6..704f85d8c 100644 --- a/src/pci_dummy.c +++ b/src/pci_dummy.c @@ -218,9 +218,7 @@ pci_dummy_pci_write(int func, int addr, uint8_t val, void *priv) case 0x10: /* PCI_BAR */ val &= 0xe0; /* 0xe0 acc to RTL DS */ -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x11: /* PCI_BAR */ /* Remove old I/O. */ diff --git a/src/printer/prt_escp.c b/src/printer/prt_escp.c index 612a07cac..707590134 100644 --- a/src/printer/prt_escp.c +++ b/src/printer/prt_escp.c @@ -1462,9 +1462,7 @@ process_char(escp_t *dev, uint8_t ch) dev->curr_x = dev->left_margin; if (!dev->autofeed) return 1; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x0a: /* Line feed */ if (dev->font_style & STYLE_DOUBLEWIDTHONELINE) { diff --git a/src/printer/prt_text.c b/src/printer/prt_text.c index e1183f0c0..ddf9faf53 100644 --- a/src/printer/prt_text.c +++ b/src/printer/prt_text.c @@ -283,9 +283,7 @@ process_char(prnt_t *dev, uint8_t ch) dev->curr_x = 0; if (!dev->autofeed) return 1; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x0a: /* Line feed */ dev->curr_x = 0; diff --git a/src/scsi/scsi_buslogic.c b/src/scsi/scsi_buslogic.c index 2dcb9688a..93efeb354 100644 --- a/src/scsi/scsi_buslogic.c +++ b/src/scsi/scsi_buslogic.c @@ -1232,9 +1232,7 @@ BuslogicPCIWrite(UNUSED(int func), int addr, uint8_t val, void *priv) case 0x10: val &= 0xe0; val |= 1; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x11: case 0x12: @@ -1258,9 +1256,7 @@ BuslogicPCIWrite(UNUSED(int func), int addr, uint8_t val, void *priv) case 0x14: val &= 0xe0; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x15: case 0x16: diff --git a/src/scsi/scsi_cdrom.c b/src/scsi/scsi_cdrom.c index d192aec53..1fc1af81e 100644 --- a/src/scsi/scsi_cdrom.c +++ b/src/scsi/scsi_cdrom.c @@ -883,9 +883,7 @@ scsi_cdrom_update_request_length(scsi_cdrom_t *dev, int len, int block_len) break; } } -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; default: dev->packet_len = len; @@ -961,9 +959,7 @@ scsi_cdrom_command_common(scsi_cdrom_t *dev) scsi_cdrom_log("CD-ROM %i: Seek period: %" PRIu64 " us\n", dev->id, (uint64_t) period); dev->callback += period; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x25: case 0x42: case 0x43: @@ -1940,9 +1936,7 @@ begin: /* IMPORTANT: Convert the command to new read CD for pass through purposes. */ dev->current_cdb[0] = GPCMD_READ_CD; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case GPCMD_READ_6: case GPCMD_READ_10: diff --git a/src/scsi/scsi_disk.c b/src/scsi/scsi_disk.c index 2bd61313b..89db4a1f5 100644 --- a/src/scsi/scsi_disk.c +++ b/src/scsi/scsi_disk.c @@ -597,9 +597,7 @@ scsi_disk_command(scsi_common_t *sc, uint8_t *cdb) scsi_disk_invalid_field(dev); return; } -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case GPCMD_SCSI_RESERVE: case GPCMD_SCSI_RELEASE: case GPCMD_TEST_UNIT_READY: diff --git a/src/scsi/scsi_pcscsi.c b/src/scsi/scsi_pcscsi.c index 52ec0b56f..0a4297caa 100644 --- a/src/scsi/scsi_pcscsi.c +++ b/src/scsi/scsi_pcscsi.c @@ -1030,9 +1030,7 @@ esp_reg_write(esp_t *dev, uint32_t saddr, uint32_t val) switch (saddr) { case ESP_TCHI: dev->tchi_written = 1; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case ESP_TCLO: case ESP_TCMID: esp_log("Transfer count regs %02x = %i\n", saddr, val); diff --git a/src/scsi/scsi_x54x.c b/src/scsi/scsi_x54x.c index e2bfc178f..96088e200 100644 --- a/src/scsi/scsi_x54x.c +++ b/src/scsi/scsi_x54x.c @@ -490,9 +490,7 @@ x54x_bios_command(x54x_t *x54x, uint8_t max_id, BIOSCMD *cmd, int8_t islba) default: x54x_log("BIOS: Unimplemented command: %02X\n", cmd->command); -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x05: /* Format Track, invalid since SCSI has no tracks */ case 0x0a: /* ???? */ case 0x0b: /* ???? */ diff --git a/src/sound/snd_ac97_codec.c b/src/sound/snd_ac97_codec.c index 01fc17d02..d302db6ae 100644 --- a/src/sound/snd_ac97_codec.c +++ b/src/sound/snd_ac97_codec.c @@ -418,9 +418,7 @@ rate: /* Writable only if VRA/VRM is set. */ /* Get actual previous value. */ prev = dev->vendor_reg_pages[(i << 3) | ((reg & 0x0e) >> 1)]; } -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x5a ... 0x5e: /* Vendor Reserved */ case 0x70 ... 0x7a: diff --git a/src/sound/snd_ad1848.c b/src/sound/snd_ad1848.c index acc143636..d2a05fd6f 100644 --- a/src/sound/snd_ad1848.c +++ b/src/sound/snd_ad1848.c @@ -242,9 +242,7 @@ ad1848_write(uint16_t addr, uint8_t val, void *priv) case 10: if (ad1848->type < AD1848_TYPE_CS4235) break; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 8: updatefreq = 1; diff --git a/src/sound/snd_cmi8x38.c b/src/sound/snd_cmi8x38.c index f865b4d4d..359563b99 100644 --- a/src/sound/snd_cmi8x38.c +++ b/src/sound/snd_cmi8x38.c @@ -469,9 +469,7 @@ cmi8x38_sb_mixer_write(uint16_t addr, uint8_t val, void *priv) case 0xf8 ... 0xff: if (dev->type == CMEDIA_CMI8338) mixer->regs[mixer->index] = val; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0xf1 ... 0xf7: return; diff --git a/src/sound/snd_cs423x.c b/src/sound/snd_cs423x.c index fff716e28..5c6b019a4 100644 --- a/src/sound/snd_cs423x.c +++ b/src/sound/snd_cs423x.c @@ -300,9 +300,7 @@ cs423x_write(uint16_t addr, uint8_t val, void *priv) switch (val) { case 0x55: /* Disable PnP Key */ dev->pnp_enable = 0; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x5a: /* Update Hardware Configuration Data */ cs423x_pnp_enable(dev, 0, 1); diff --git a/src/sound/snd_gus.c b/src/sound/snd_gus.c index 7e3f51567..6d0416277 100644 --- a/src/sound/snd_gus.c +++ b/src/sound/snd_gus.c @@ -643,9 +643,7 @@ writegus(uint16_t addr, uint8_t val, void *priv) else if (gus->irq != -1) picint(1 << gus->irq); } -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x20d: gus->sb_2xc = val; break; diff --git a/src/sound/snd_sb_dsp.c b/src/sound/snd_sb_dsp.c index d4dcd5a79..72feaf19f 100644 --- a/src/sound/snd_sb_dsp.c +++ b/src/sound/snd_sb_dsp.c @@ -601,9 +601,7 @@ sb_exec_command(sb_dsp_t *dsp) case 0x75: /* 4-bit ADPCM output with reference */ dsp->sbref = dsp->dma_readb(dsp->dma_priv); dsp->sbstep = 0; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x74: /* 4-bit ADPCM output */ sb_start_dma(dsp, 1, 0, ADPCM_4, dsp->sb_data[0] + (dsp->sb_data[1] << 8)); dsp->sbdat2 = dsp->dma_readb(dsp->dma_priv); diff --git a/src/video/vid_8514a.c b/src/video/vid_8514a.c index b4719a539..8e55bcfb5 100644 --- a/src/video/vid_8514a.c +++ b/src/video/vid_8514a.c @@ -536,9 +536,7 @@ ibm8514_accel_out_fifo(svga_t *svga, uint16_t port, uint32_t val, int len) case 0x92e8: if (len != 1) dev->test = val; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0xd2e8: if (len == 1) dev->accel.err_term = (dev->accel.err_term & 0x3f00) | val; diff --git a/src/video/vid_ati_eeprom.c b/src/video/vid_ati_eeprom.c index 2f4746e86..054d83d36 100644 --- a/src/video/vid_ati_eeprom.c +++ b/src/video/vid_ati_eeprom.c @@ -94,9 +94,7 @@ ati_eeprom_write(ati_eeprom_t *eeprom, int ena, int clk, int dat) if (!dat) break; eeprom->state = EEPROM_OPCODE; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case EEPROM_OPCODE: eeprom->opcode = (eeprom->opcode << 1) | (dat ? 1 : 0); eeprom->count--; diff --git a/src/video/vid_ati_mach64.c b/src/video/vid_ati_mach64.c index 25b416a23..98dcfd14d 100644 --- a/src/video/vid_ati_mach64.c +++ b/src/video/vid_ati_mach64.c @@ -740,9 +740,7 @@ mach64_accel_write_fifo(mach64_t *mach64, uint32_t addr, uint8_t val) case 0x11e: case 0x11f: WRITE8(addr, mach64->dst_height_width, val); -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x113: if (((addr & 0x3ff) == 0x11b || (addr & 0x3ff) == 0x11f || (addr & 0x3ff) == 0x113) && !(val & 0x80)) { mach64_start_fill(mach64); @@ -965,9 +963,7 @@ mach64_accel_write_fifo(mach64_t *mach64, uint32_t addr, uint8_t val) case 0x2a4: case 0x2a5: addr += 2; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x2aa: case 0x2ab: WRITE8(addr, mach64->sc_left_right, val); @@ -982,9 +978,7 @@ mach64_accel_write_fifo(mach64_t *mach64, uint32_t addr, uint8_t val) case 0x2b0: case 0x2b1: addr += 2; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x2b6: case 0x2b7: WRITE8(addr, mach64->sc_top_bottom, val); diff --git a/src/video/vid_ati_mach8.c b/src/video/vid_ati_mach8.c index 23c0bf0f2..c31c0d237 100644 --- a/src/video/vid_ati_mach8.c +++ b/src/video/vid_ati_mach8.c @@ -2861,9 +2861,8 @@ mach_accel_out_fifo(mach_t *mach, svga_t *svga, ibm8514_t *dev, uint16_t port, u case 0x92e8: if (len != 1) dev->test = val; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; + case 0xd2e8: mach_log("92E8 = %04x\n", val); if (len == 1) diff --git a/src/video/vid_cl54xx.c b/src/video/vid_cl54xx.c index b46f98e3c..cf4ff402d 100644 --- a/src/video/vid_cl54xx.c +++ b/src/video/vid_cl54xx.c @@ -953,9 +953,7 @@ gd54xx_out(uint16_t addr, uint8_t val, void *priv) } svga->seqregs[2] &= 0x0f; } -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x09: case 0x0a: gd54xx_recalc_banking(gd54xx); @@ -2325,9 +2323,7 @@ gd54xx_readw_linear(uint32_t addr, void *priv) case 2: /* 0 -> 3, 1 -> 2, 2 -> 1, 3 -> 0 */ addr ^= 0x00000002; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 1: temp = svga_readb_linear(addr + 1, svga); temp |= (svga_readb_linear(addr, svga) << 8); @@ -2582,9 +2578,7 @@ gd54xx_writew_linear(uint32_t addr, uint16_t val, void *priv) return; case 2: addr ^= 0x00000002; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 1: svga_write_linear(addr + 1, val & 0xff, svga); svga_write_linear(addr, val >> 8, svga); diff --git a/src/video/vid_et4000.c b/src/video/vid_et4000.c index a97d65cdb..318efb3f4 100644 --- a/src/video/vid_et4000.c +++ b/src/video/vid_et4000.c @@ -433,9 +433,7 @@ et4000_kasan_out(uint16_t addr, uint8_t val, void *priv) case 5: et4000->kasan_cfg_regs[5] = val; et4000->svga.ksc5601_english_font_type = 0x100 | val; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 6: case 7: et4000->svga.ksc5601_udc_area_msb[et4000->kasan_cfg_index - 0xF6] = val; diff --git a/src/video/vid_ht216.c b/src/video/vid_ht216.c index bd09a9ede..cee95e3a6 100644 --- a/src/video/vid_ht216.c +++ b/src/video/vid_ht216.c @@ -321,9 +321,7 @@ ht216_out(uint16_t addr, uint8_t val, void *priv) svga->adv_flags &= ~FLAG_RAMDAC_SHIFT; if (val & 0x04) svga->adv_flags |= FLAG_RAMDAC_SHIFT; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; /*Bank registers*/ case 0xe8: case 0xe9: diff --git a/src/video/vid_mga.c b/src/video/vid_mga.c index b258f71b1..44a69d2fc 100644 --- a/src/video/vid_mga.c +++ b/src/video/vid_mga.c @@ -665,9 +665,7 @@ mystique_out(uint16_t addr, uint8_t val, void *priv) switch (addr) { case 0x3c8: mystique->xreg_idx = val; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 0x3c6: case 0x3c7: case 0x3c9: diff --git a/src/video/vid_s3_virge.c b/src/video/vid_s3_virge.c index 2e6cffd96..5dc29e5da 100644 --- a/src/video/vid_s3_virge.c +++ b/src/video/vid_s3_virge.c @@ -3516,9 +3516,7 @@ s3_virge_hwcursor_draw(svga_t *svga, int displine) bg = svga->pallook[virge->hwc_bg_col & 0xff]; break; } -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 15: if (virge->chip != S3_VIRGEGX2) { @@ -3526,9 +3524,7 @@ s3_virge_hwcursor_draw(svga_t *svga, int displine) bg = video_15to32[virge->hwc_bg_col & 0xffff]; break; } -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 16: if (virge->chip != S3_VIRGEGX2) { @@ -3536,9 +3532,7 @@ s3_virge_hwcursor_draw(svga_t *svga, int displine) bg = video_16to32[virge->hwc_bg_col & 0xffff]; break; } -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; case 24: case 32: @@ -4343,9 +4337,7 @@ s3_virge_init(const device_t *info) case S3_VIRGE_GX: virge->virge_rev = 0x01; -#ifdef FALLTHROUGH_ANNOTATION - [[fallthrough]]; -#endif + fallthrough; default: virge->fifo_slots_num = 8; diff --git a/src/video/vid_tvp3026_ramdac.c b/src/video/vid_tvp3026_ramdac.c index 745ccd568..15215c45d 100644 --- a/src/video/vid_tvp3026_ramdac.c +++ b/src/video/vid_tvp3026_ramdac.c @@ -109,9 +109,7 @@ tvp3026_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *priv, svg switch (rs) { case 0x00: /* Palette Write Index Register (RS value = 0000) */ ramdac->ind_idx = val; -#ifdef FALLTHROUGH_ANNOTATION; - [[fallthrough]]; -#endif + fallthrough; case 0x04: /* Ext Palette Write Index Register (RS value = 0100) */ case 0x03: case 0x07: /* Ext Palette Read Index Register (RS value = 0111) */ diff --git a/src/video/vid_voodoo_reg.c b/src/video/vid_voodoo_reg.c index b4b6bbb50..d2fa2e1a2 100644 --- a/src/video/vid_voodoo_reg.c +++ b/src/video/vid_voodoo_reg.c @@ -1121,7 +1121,7 @@ voodoo_reg_writel(uint32_t addr, uint32_t val, void *priv) } break; } - [[fallthrough]]; + fallthrough; case SST_nccTable0_I2: if (!(val & (1 << 31))) { if (chip & CHIP_TREX0) {