[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/14] mac_newworld: Turn CORE99_VIA_CONFIG defines into an enum
From: |
Mark Cave-Ayland |
Subject: |
[PULL 14/14] mac_newworld: Turn CORE99_VIA_CONFIG defines into an enum |
Date: |
Mon, 31 Oct 2022 20:14:35 +0000 |
From: BALATON Zoltan <balaton@eik.bme.hu>
This might allow the compiler to check values.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id:
<f9da172e486c1f57f8542c7c3cb0223cffa89b1f.1666957578.git.balaton@eik.bme.hu>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/ppc/mac_newworld.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 37123daa6b..601ea518f8 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -95,15 +95,17 @@ typedef struct Core99MachineState Core99MachineState;
DECLARE_INSTANCE_CHECKER(Core99MachineState, CORE99_MACHINE,
TYPE_CORE99_MACHINE)
-#define CORE99_VIA_CONFIG_CUDA 0x0
-#define CORE99_VIA_CONFIG_PMU 0x1
-#define CORE99_VIA_CONFIG_PMU_ADB 0x2
+typedef enum {
+ CORE99_VIA_CONFIG_CUDA = 0,
+ CORE99_VIA_CONFIG_PMU,
+ CORE99_VIA_CONFIG_PMU_ADB
+} Core99ViaConfig;
struct Core99MachineState {
/*< private >*/
MachineState parent;
- uint8_t via_config;
+ Core99ViaConfig via_config;
};
static void fw_cfg_boot_set(void *opaque, const char *boot_device,
--
2.30.2
- [PULL 02/14] mac_oldworld: Drop some more variables, (continued)
- [PULL 02/14] mac_oldworld: Drop some more variables, Mark Cave-Ayland, 2022/10/31
- [PULL 04/14] mac_{old|new}world: Avoid else branch by setting default value, Mark Cave-Ayland, 2022/10/31
- [PULL 05/14] mac_newworld: Clean up creation of Uninorth devices, Mark Cave-Ayland, 2022/10/31
- [PULL 03/14] mac_{old|new}world: Set tbfreq at declaration, Mark Cave-Ayland, 2022/10/31
- [PULL 06/14] mac_{old|new}world: Reduce number of QOM casts, Mark Cave-Ayland, 2022/10/31
- [PULL 07/14] hw/ppc/mac.h: Move newworld specific parts out from shared header, Mark Cave-Ayland, 2022/10/31
- [PULL 08/14] hw/ppc/mac.h: Move macio specific parts out from shared header, Mark Cave-Ayland, 2022/10/31
- [PULL 09/14] hw/ppc/mac.h: Move grackle-pcihost type declaration out to a header, Mark Cave-Ayland, 2022/10/31
- [PULL 10/14] hw/ppc/mac.h: Move PROM and KERNEL defines to board code, Mark Cave-Ayland, 2022/10/31
- [PULL 12/14] mac_nvram: Use NVRAM_SIZE constant, Mark Cave-Ayland, 2022/10/31
- [PULL 14/14] mac_newworld: Turn CORE99_VIA_CONFIG defines into an enum,
Mark Cave-Ayland <=
- [PULL 11/14] hw/ppc/mac.h: Rename to include/hw/nvram/mac_nvram.h, Mark Cave-Ayland, 2022/10/31
- [PULL 13/14] mac_{old|new}world: Code style fix adding missing braces to if-s, Mark Cave-Ayland, 2022/10/31