From 224f565dec708eb0f85964e2b74c31b87c3e1808 Mon Sep 17 00:00:00 2001 From: Connor Behan Date: Sun, 23 Jun 2024 22:24:44 -0300 Subject: Suppress majority of compiler warnings This applies some obvious changes to stop gcc from complaining about dead code, shadow declarations, differing signedness and sections that mix declarations with code. The warning about discarding const qualifiers is more annoying because we pass string literals to some functions which accept non-const pointers. Currently, this takes the following approach. If the function *needs* to accept non-const pointers, cast the string literal as char *. Otherwise, change the function to only accept a const pointer. To anticipate future use cases though, I could also leave function definitions as they are and just always cast string literals. Alternatively, if this is more trouble that it is worth, we could just put up with the warnings. Signed-off-by: Connor Behan --- src/cim/cim_vg.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'src/cim/cim_vg.c') diff --git a/src/cim/cim_vg.c b/src/cim/cim_vg.c index 46984b5..a8a875b 100644 --- a/src/cim/cim_vg.c +++ b/src/cim/cim_vg.c @@ -1381,8 +1381,6 @@ vg_get_current_display_mode(VG_DISPLAY_MODE * current_display, int *bpp) /* Cimarron when returning the current mode information. */ if (vg3_panel_enable) { - Q_WORD msr_value; - flags |= VG_MODEFLAG_PANELOUT; current_display->panel_width = vg3_panel_width; @@ -2736,7 +2734,7 @@ vg_save_state(VG_SAVE_RESTORE * vg_state) int vg_restore_state(VG_SAVE_RESTORE * vg_state) { - unsigned long irqfilt, i; + unsigned long irqfilt, j; unsigned long memoffset; /* TEMPORARILY UNLOCK ALL REGISTERS */ @@ -2801,27 +2799,27 @@ vg_restore_state(VG_SAVE_RESTORE * vg_state) /* RESTORE THE PALETTE */ WRITE_REG32(DC3_PAL_ADDRESS, 0); - for (i = 0; i < 261; i++) - WRITE_REG32(DC3_PAL_DATA, vg_state->palette[i]); + for (j = 0; j < 261; j++) + WRITE_REG32(DC3_PAL_DATA, vg_state->palette[j]); /* RESTORE THE HORIZONTAL FILTER COEFFICIENTS */ irqfilt = READ_REG32(DC3_IRQ_FILT_CTL); irqfilt |= DC3_IRQFILT_H_FILT_SEL; - for (i = 0; i < 256; i++) { - WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | i)); - WRITE_REG32(DC3_FILT_COEFF1, vg_state->h_coeff[(i << 1)]); - WRITE_REG32(DC3_FILT_COEFF2, vg_state->h_coeff[(i << 1) + 1]); + for (j = 0; j < 256; j++) { + WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | j)); + WRITE_REG32(DC3_FILT_COEFF1, vg_state->h_coeff[(j << 1)]); + WRITE_REG32(DC3_FILT_COEFF2, vg_state->h_coeff[(j << 1) + 1]); } /* RESTORE VERTICAL COEFFICIENTS */ irqfilt &= ~DC3_IRQFILT_H_FILT_SEL; - for (i = 0; i < 256; i++) { - WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | i)); - WRITE_REG32(DC3_FILT_COEFF1, vg_state->v_coeff[i]); + for (j = 0; j < 256; j++) { + WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | j)); + WRITE_REG32(DC3_FILT_COEFF1, vg_state->v_coeff[j]); } /* RESTORE THE CURSOR DATA */ -- cgit v1.2.3