From c4962c38a1ab470fbdc835c231567bd582eb5a5a Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Wed, 10 Apr 2024 07:15:40 -0700 Subject: [PATCH] msvc: fix warnings by using all enum values in case statements --- src/ftdi.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/src/ftdi.c b/src/ftdi.c index 534e3dd..b773303 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -2918,8 +2918,12 @@ static unsigned char type2bit(unsigned char type, enum ftdi_chip_type chip) } } case TYPE_230X: /* FT230X is only UART */ + case TYPE_AM: + case TYPE_BM: + case TYPE_4232H: default: return 0; } + /* fallback */ return 0; } @@ -4625,7 +4629,7 @@ int ftdi_write_eeprom_location(struct ftdi_context *ftdi, int eeprom_addr, switch (ftdi->type) { case TYPE_BM: - case TYPE_2232C: + case TYPE_2232C: chip_type_location = 0x14; break; case TYPE_2232H: @@ -4635,6 +4639,9 @@ int ftdi_write_eeprom_location(struct ftdi_context *ftdi, int eeprom_addr, case TYPE_232H: chip_type_location = 0x1e; break; + case TYPE_AM: + case TYPE_R: + case TYPE_230X: default: ftdi_error_return(-4, "Device can't access unprotected area"); } -- 1.7.1