From c85a8cf60731b0e45b4a6a17a5a00b80ae195e38 Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 17:07:28 +0200 Subject: [PATCH] Amiga: drop redundant 'either windowtype' guards Six if(WINVERS_AMIV || WINVERS_AMII) sites are always true with amitty.c gone. --- sys/amiga/winamenu.c | 32 ++++++++++++++------------------ sys/amiga/winfuncs.c | 41 +++++++++++++++++++---------------------- sys/amiga/winreq.c | 36 +++++++++++++++--------------------- 3 files changed, 48 insertions(+), 61 deletions(-) diff --git a/sys/amiga/winamenu.c b/sys/amiga/winamenu.c index 2c53563b8..828ccb4b7 100644 --- a/sys/amiga/winamenu.c +++ b/sys/amiga/winamenu.c @@ -360,10 +360,8 @@ DoMenuScroll(int win, int blocking, int how, menu_item **retmip) } nw->Height = min(ysize, amiIDisplay->ypix - nw->TopEdge); - if (WINVERS_AMIV || WINVERS_AMII) { - /* Make sure we are using the correct hook structure */ - nw->Extension = cw->wintags; - } + /* Make sure we are using the correct hook structure */ + nw->Extension = cw->wintags; /* Now, open the window */ w = cw->win = OpenShWindow((void *) nw); @@ -535,21 +533,19 @@ DoMenuScroll(int win, int blocking, int how, menu_item **retmip) * amii_cl_end if window shrinks and columns decrease. */ - if (WINVERS_AMII || WINVERS_AMIV) { - amii_setfillpens(w, cw->type); - SetDrMd(w->RPort, JAM2); - x2 = w->Width - w->BorderRight; - y2 = w->Height - w->BorderBottom; - x1 = x2 - w->IFont->tf_XSize - w->IFont->tf_XSize; - y1 = w->BorderTop; - if (x1 < w->BorderLeft) - x1 = w->BorderLeft; - RectFill(w->RPort, x1, y1, x2, y2); + amii_setfillpens(w, cw->type); + SetDrMd(w->RPort, JAM2); + x2 = w->Width - w->BorderRight; + y2 = w->Height - w->BorderBottom; + x1 = x2 - w->IFont->tf_XSize - w->IFont->tf_XSize; + y1 = w->BorderTop; + if (x1 < w->BorderLeft) x1 = w->BorderLeft; - y1 = y1 - w->IFont->tf_YSize; - RectFill(w->RPort, x1, y1, x2, y2); - RefreshWindowFrame(w); - } + RectFill(w->RPort, x1, y1, x2, y2); + x1 = w->BorderLeft; + y1 = y1 - w->IFont->tf_YSize; + RectFill(w->RPort, x1, y1, x2, y2); + RefreshWindowFrame(w); /* Make the prop gadget the right size and place */ diff --git a/sys/amiga/winfuncs.c b/sys/amiga/winfuncs.c index 5ccb16313..d22b95c53 100644 --- a/sys/amiga/winfuncs.c +++ b/sys/amiga/winfuncs.c @@ -538,29 +538,26 @@ amii_create_nhwindow(int type) wd = (struct amii_WinDesc *) alloc(sizeof(struct amii_WinDesc)); memset(wd, 0, sizeof(struct amii_WinDesc)); - /* Both, since user may have changed the pen settings so respect those */ - if (WINVERS_AMII || WINVERS_AMIV) { - /* Special backfill for these types of layers */ - switch (type) { - case NHW_MESSAGE: - case NHW_STATUS: - case NHW_TEXT: - case NHW_MENU: - case NHW_BASE: - case NHW_OVER: - case NHW_MAP: - if (wd) { - fillhook.h_Entry = (void *) &LayerFillHook; - fillhook.h_Data = (void *) type; - fillhook.h_SubEntry = 0; - wd->hook = alloc(sizeof(fillhook)); - memcpy(wd->hook, &fillhook, sizeof(fillhook)); - memcpy(wd->wintags, wintags, sizeof(wd->wintags)); - wd->wintags[0].ti_Data = (long) wd->hook; - nw->Extension = (void *) wd->wintags; - } - break; + /* Special backfill for these types of layers */ + switch (type) { + case NHW_MESSAGE: + case NHW_STATUS: + case NHW_TEXT: + case NHW_MENU: + case NHW_BASE: + case NHW_OVER: + case NHW_MAP: + if (wd) { + fillhook.h_Entry = (void *) &LayerFillHook; + fillhook.h_Data = (void *) type; + fillhook.h_SubEntry = 0; + wd->hook = alloc(sizeof(fillhook)); + memcpy(wd->hook, &fillhook, sizeof(fillhook)); + memcpy(wd->wintags, wintags, sizeof(wd->wintags)); + wd->wintags[0].ti_Data = (long) wd->hook; + nw->Extension = (void *) wd->wintags; } + break; } /* Don't open MENU or TEXT windows yet */ diff --git a/sys/amiga/winreq.c b/sys/amiga/winreq.c index 76f6c1ec2..d4a1bc362 100644 --- a/sys/amiga/winreq.c +++ b/sys/amiga/winreq.c @@ -108,13 +108,11 @@ EditColor(void) ((struct PropInfo *) Col_RedPen.SpecialInfo)->Flags |= PROPNEWLOOK; ((struct PropInfo *) Col_GreenPen.SpecialInfo)->Flags |= PROPNEWLOOK; } - if (WINVERS_AMIV || WINVERS_AMII) { - Col_NewWindowStructure1.Extension = wintags; - Col_NewWindowStructure1.Flags |= WFLG_NW_EXTENDED; - fillhook.h_Entry = (void *) &LayerFillHook; - fillhook.h_Data = (void *) -2; - fillhook.h_SubEntry = 0; - } + Col_NewWindowStructure1.Extension = wintags; + Col_NewWindowStructure1.Flags |= WFLG_NW_EXTENDED; + fillhook.h_Entry = (void *) &LayerFillHook; + fillhook.h_Data = (void *) -2; + fillhook.h_SubEntry = 0; nw = OpenWindow((void *) &Col_NewWindowStructure1); @@ -360,13 +358,11 @@ EditClipping(void) ((struct PropInfo *) ClipXCLIP.SpecialInfo)->Flags |= PROPNEWLOOK; ((struct PropInfo *) ClipYCLIP.SpecialInfo)->Flags |= PROPNEWLOOK; } - if (WINVERS_AMIV || WINVERS_AMII) { - ClipNewWindowStructure1.Extension = wintags; - ClipNewWindowStructure1.Flags |= WFLG_NW_EXTENDED; - fillhook.h_Entry = (void *) &LayerFillHook; - fillhook.h_Data = (void *) -2; - fillhook.h_SubEntry = 0; - } + ClipNewWindowStructure1.Extension = wintags; + ClipNewWindowStructure1.Flags |= WFLG_NW_EXTENDED; + fillhook.h_Entry = (void *) &LayerFillHook; + fillhook.h_Data = (void *) -2; + fillhook.h_SubEntry = 0; nw = OpenWindow((void *) &ClipNewWindowStructure1); @@ -807,13 +803,11 @@ getlind(const char *prompt, char *bufp, const char *dflt) once = 1; } - if (WINVERS_AMIV || WINVERS_AMII) { - StrWindow.Extension = wintags; - StrWindow.Flags |= WFLG_NW_EXTENDED; - fillhook.h_Entry = (void *) &LayerFillHook; - fillhook.h_Data = (void *) -2; - fillhook.h_SubEntry = 0; - } + StrWindow.Extension = wintags; + StrWindow.Flags |= WFLG_NW_EXTENDED; + fillhook.h_Entry = (void *) &LayerFillHook; + fillhook.h_Data = (void *) -2; + fillhook.h_SubEntry = 0; if ((cwin = OpenWindow((void *) &StrWindow)) == NULL) { return;