From 2a7d300078dff5fb2bb3fe52ba32acf27f4c73c4 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sat, 20 Jul 2024 20:05:00 -0400 Subject: [PATCH] Use a define for max HDC's --- src/disk/hdc.c | 2 +- src/include/86box/config.h | 2 +- src/include/86box/hdc.h | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/disk/hdc.c b/src/disk/hdc.c index 08a290aef..908cbce07 100644 --- a/src/disk/hdc.c +++ b/src/disk/hdc.c @@ -30,7 +30,7 @@ #include <86box/hdc_ide.h> #include <86box/hdd.h> -int hdc_current[2]; +int hdc_current[HDC_MAX] = { 0, 0 }; #ifdef ENABLE_HDC_LOG int hdc_do_log = ENABLE_HDC_LOG; diff --git a/src/include/86box/config.h b/src/include/86box/config.h index 4691686c7..a043fb22a 100644 --- a/src/include/86box/config.h +++ b/src/include/86box/config.h @@ -114,7 +114,7 @@ typedef struct config_t { /* Other peripherals category */ int fdc_current[FDC_MAX]; /* Floppy disk controller type */ - int hdc_current[2]; /* Hard disk controller type */ + int hdc_current[HDC_MAX]; /* Hard disk controller type */ int hdc; /* Hard disk controller */ int scsi_card; /* SCSI controller */ int ide_ter_enabled; /* Tertiary IDE controller enabled */ diff --git a/src/include/86box/hdc.h b/src/include/86box/hdc.h index 8e09119bf..48235bb1e 100644 --- a/src/include/86box/hdc.h +++ b/src/include/86box/hdc.h @@ -32,7 +32,9 @@ #define HDC_NONE 0 #define HDC_INTERNAL 1 -extern int hdc_current[2]; +#define HDC_MAX 2 + +extern int hdc_current[HDC_MAX]; extern const device_t st506_xt_xebec_device; /* st506_xt_xebec */ extern const device_t st506_xt_wdxt_gen_device; /* st506_xt_wdxt_gen */