From 1c686ead41a2624d9340dd0fafa246b2b152d5a3 Mon Sep 17 00:00:00 2001 From: Enno Schnackenberg <41478036+Intubun@users.noreply.github.com> Date: Tue, 5 May 2026 13:37:23 +0200 Subject: [PATCH] Fix GCC 14 incompatible function pointer and const errors in cmwind --- cmwind/CMWmain.c | 19 ++++++++++--------- graphics/graphics.h | 2 +- windows/windows.h | 6 +++--- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/cmwind/CMWmain.c b/cmwind/CMWmain.c index c0e8105b..3eebcf61 100644 --- a/cmwind/CMWmain.c +++ b/cmwind/CMWmain.c @@ -409,11 +409,12 @@ CMWloadWindow( void CMWinit(void) { - CMWclientID = WindAddClient("color", CMWcreate, CMWdelete, - CMWredisplay, CMWcommand, - (void(*)()) NULL, - CMWCheckWritten, - CMWreposition, + CMWclientID = WindAddClient("color", + (bool (*)())CMWcreate, (bool (*)())CMWdelete, + (void (*)())CMWredisplay, (void (*)())CMWcommand, + (void (*)()) NULL, + (bool (*)())CMWCheckWritten, + (void (*)())CMWreposition, (GrGlyph *) NULL); CMWundoInit(); @@ -421,16 +422,16 @@ CMWinit(void) WindAddCommand(CMWclientID, "pushbutton button invoke a button press in the color window", - cmwPushbutton, FALSE); + (void (*)())cmwPushbutton, FALSE); WindAddCommand(CMWclientID, "color [color-#] specify color to edit, or print current intensities", - cmwColor, FALSE); + (void (*)())cmwColor, FALSE); WindAddCommand(CMWclientID, "load [techStyle displayStyle monitorType]\n\ load new color map techStyle.displayStyle.monitorType", - cmwLoad, FALSE); + (void (*)())cmwLoad, FALSE); WindAddCommand(CMWclientID, "save [techStyle displayStyle monitorType]\n\ save color map to techStyle.displayStyle.monitorType", - cmwSave, FALSE); + (void (*)())cmwSave, FALSE); } diff --git a/graphics/graphics.h b/graphics/graphics.h index 9df732dd..c3410654 100644 --- a/graphics/graphics.h +++ b/graphics/graphics.h @@ -56,7 +56,7 @@ extern bool GrHaveLock(); extern void GrClipTo(); extern void GrClipBox(Rect *, int); extern void GrClipLine(); -extern bool GrPutText(char *, int, Point *, int, int, bool, Rect *, Rect *); +extern bool GrPutText(const char *, int, Point *, int, int, bool, Rect *, Rect *); extern void GrFillPolygon(); extern void (*GrDrawGlyphPtr)(); extern void (*GrBitBltPtr)(); diff --git a/windows/windows.h b/windows/windows.h index eb48631e..514dcbae 100644 --- a/windows/windows.h +++ b/windows/windows.h @@ -241,7 +241,7 @@ extern WindClient WindGetClient(); extern WindClient WindNextClient(); extern WindClient WindAddClient(char *, bool (*)(), bool (*)(), void (*)(), void (*)(), void (*)(), bool (*)(), - void (*)(), void (*)()); + void (*)(), GrGlyph *); extern char *WindGetClientName(); extern void WindInit(); extern void WindUpdate(); @@ -265,7 +265,7 @@ extern MagWindow *WindSearchData(); /* procs for moving the surface inside of a window (changing the view) */ extern void WindZoom(); -extern void WindMove(MagWindow *, Rect *); +extern void WindMove(MagWindow *, const Rect *); extern void WindView(); extern void WindScroll(); @@ -280,7 +280,7 @@ extern void WindFullScreen(); /* procs to transform into and out of screen coordinates */ extern void WindScreenToSurface(); -extern void WindSurfaceToScreen(MagWindow *, Rect *, Rect *); +extern void WindSurfaceToScreen(MagWindow *, const Rect *, Rect *); extern void WindPointToSurface(); extern void WindPointToScreen(); extern void WindSurfaceToScreenNoClip(MagWindow *, Rect *, Rect *);