1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-02-07 16:51:21 +00:00

Correct -Wformat-pedantic warnings

Many of the warnings were newly visible after the DBPRINT macro
was modified, but the pedantic warnings also caught existing printf
family usage which was not strictly correct.

Mostly replacing 0x%x with %p for pointers, adding (void *) for
those and other pointers, %td for ptrdiff_t, but also changing
some function parameters from UNSIGNED (uintptr_t) to int
where that was the more appropriate type.
This commit is contained in:
Nick Briggs
2022-08-11 14:12:51 -07:00
parent e72dd332a3
commit d91de66322
21 changed files with 56 additions and 58 deletions

View File

@@ -189,7 +189,7 @@ void init_display2(DLword *display_addr, int display_max)
init_cursor();
DisplayByteSize = ((displaywidth * displayheight / 8 + (getpagesize() - 1)) & -getpagesize());
DBPRINT(("Display address: 0x%x\n", DisplayRegion68k));
DBPRINT(("Display address: %p\n", (void *)DisplayRegion68k));
DBPRINT((" length : 0x%x\n", DisplayByteSize));
DBPRINT((" pg size: 0x%x\n", getpagesize()));
@@ -327,13 +327,13 @@ void byte_swapped_displayregion(int x, int y, int w, int h)
/* */
/************************************************************************/
void flush_display_lineregion(UNSIGNED x, DLword *ybase, UNSIGNED w, UNSIGNED h)
void flush_display_lineregion(UNSIGNED x, DLword *ybase, int w, int h)
{
int y;
y = ((DLword *)ybase - DisplayRegion68k) / DLWORD_PERLINE;
#if (defined(XWINDOW) || defined(DOS))
TPRINT(("Enter flush_display_lineregion x=%d, y=%d, w=%d, h=%d\n", x, y, w, h));
TPRINT(("Enter flush_display_lineregion x=%p, y=%d, w=%d, h=%d\n", (void *)x, y, w, h));
(currentdsp->bitblt_to_screen)(currentdsp, DisplayRegion68k, x, y, w, h);
TPRINT(("Exit flush_display_lineregion\n"));
#endif /* DOS */
@@ -356,7 +356,7 @@ void flush_display_lineregion(UNSIGNED x, DLword *ybase, UNSIGNED w, UNSIGNED h)
#define BITSPERWORD 16
void flush_display_ptrregion(DLword *ybase, UNSIGNED bitoffset, UNSIGNED w, UNSIGNED h)
void flush_display_ptrregion(DLword *ybase, UNSIGNED bitoffset, int w, int h)
{
int y, x, baseoffset;
baseoffset = (((DLword *)ybase) - DisplayRegion68k);