diff options
author | Connor Behan <connor.behan@gmail.com> | 2024-06-23 22:24:44 -0300 |
---|---|---|
committer | Martin-Éric RACINE <martin-eric.racine@iki.fi> | 2024-06-24 19:42:15 +0300 |
commit | 224f565dec708eb0f85964e2b74c31b87c3e1808 (patch) | |
tree | ada80a96d6251b6082a41cb460bfd4a6d533036b /src/cim/cim_gp.c | |
parent | 9fbd276f1de0f695f2b884d0778db7a0e12bdc56 (diff) |
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 <connor.behan@gmail.com>
Diffstat (limited to 'src/cim/cim_gp.c')
-rw-r--r-- | src/cim/cim_gp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cim/cim_gp.c b/src/cim/cim_gp.c index 2085d4f..4ab909f 100644 --- a/src/cim/cim_gp.c +++ b/src/cim/cim_gp.c @@ -2642,7 +2642,7 @@ gp_masked_blt(unsigned long dstoffset, unsigned long width, unsigned long total_dwords, size_dwords; unsigned long dword_count, byte_count; unsigned long srcoffset, size; - unsigned long i, ch3_offset, base; + unsigned long j, ch3_offset, base; unsigned long flags = 0; if (gp3_blt_flags & CIMGP_BLTFLAGS_INVERTMONO) @@ -2688,7 +2688,7 @@ gp_masked_blt(unsigned long dstoffset, unsigned long width, WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; - for (i = 0; i < height; i++) { + for (j = 0; j < height; j++) { /* UPDATE THE COMMAND POINTER * The WRITE_COMMANDXX macros use a pointer to the current buffer * space. This is created by adding gp3_cmd_current to the base @@ -2880,7 +2880,7 @@ gp_screen_to_screen_masked(unsigned long dstoffset, unsigned long srcoffset, unsigned long total_dwords, size_dwords; unsigned long dword_count, byte_count; unsigned long srcoff, size; - unsigned long i, base; + unsigned long j, base; unsigned long flags = 0; if (gp3_blt_flags & CIMGP_BLTFLAGS_INVERTMONO) @@ -2926,7 +2926,7 @@ gp_screen_to_screen_masked(unsigned long dstoffset, unsigned long srcoffset, WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; - for (i = 0; i < height; i++) { + for (j = 0; j < height; j++) { /* UPDATE THE COMMAND POINTER * The WRITE_COMMANDXX macros use a pointer to the current buffer * space. This is created by adding gp3_cmd_current to the base |