Amiga: drop redundant 'either windowtype' guards

Six if(WINVERS_AMIV || WINVERS_AMII) sites are always true with
amitty.c gone.
This commit is contained in:
Ingo Paschke
2026-05-11 20:51:06 +02:00
parent 5d86dfccb5
commit c85a8cf607
3 changed files with 48 additions and 61 deletions
+14 -18
View File
@@ -360,10 +360,8 @@ DoMenuScroll(int win, int blocking, int how, menu_item **retmip)
} }
nw->Height = min(ysize, amiIDisplay->ypix - nw->TopEdge); nw->Height = min(ysize, amiIDisplay->ypix - nw->TopEdge);
if (WINVERS_AMIV || WINVERS_AMII) { /* Make sure we are using the correct hook structure */
/* Make sure we are using the correct hook structure */ nw->Extension = cw->wintags;
nw->Extension = cw->wintags;
}
/* Now, open the window */ /* Now, open the window */
w = cw->win = OpenShWindow((void *) nw); 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. * amii_cl_end if window shrinks and columns decrease.
*/ */
if (WINVERS_AMII || WINVERS_AMIV) { amii_setfillpens(w, cw->type);
amii_setfillpens(w, cw->type); SetDrMd(w->RPort, JAM2);
SetDrMd(w->RPort, JAM2); x2 = w->Width - w->BorderRight;
x2 = w->Width - w->BorderRight; y2 = w->Height - w->BorderBottom;
y2 = w->Height - w->BorderBottom; x1 = x2 - w->IFont->tf_XSize - w->IFont->tf_XSize;
x1 = x2 - w->IFont->tf_XSize - w->IFont->tf_XSize; y1 = w->BorderTop;
y1 = w->BorderTop; if (x1 < w->BorderLeft)
if (x1 < w->BorderLeft)
x1 = w->BorderLeft;
RectFill(w->RPort, x1, y1, x2, y2);
x1 = w->BorderLeft; x1 = w->BorderLeft;
y1 = y1 - w->IFont->tf_YSize; RectFill(w->RPort, x1, y1, x2, y2);
RectFill(w->RPort, x1, y1, x2, y2); x1 = w->BorderLeft;
RefreshWindowFrame(w); y1 = y1 - w->IFont->tf_YSize;
} RectFill(w->RPort, x1, y1, x2, y2);
RefreshWindowFrame(w);
/* Make the prop gadget the right size and place */ /* Make the prop gadget the right size and place */
+19 -22
View File
@@ -538,29 +538,26 @@ amii_create_nhwindow(int type)
wd = (struct amii_WinDesc *) alloc(sizeof(struct amii_WinDesc)); wd = (struct amii_WinDesc *) alloc(sizeof(struct amii_WinDesc));
memset(wd, 0, sizeof(struct amii_WinDesc)); memset(wd, 0, sizeof(struct amii_WinDesc));
/* Both, since user may have changed the pen settings so respect those */ /* Special backfill for these types of layers */
if (WINVERS_AMII || WINVERS_AMIV) { switch (type) {
/* Special backfill for these types of layers */ case NHW_MESSAGE:
switch (type) { case NHW_STATUS:
case NHW_MESSAGE: case NHW_TEXT:
case NHW_STATUS: case NHW_MENU:
case NHW_TEXT: case NHW_BASE:
case NHW_MENU: case NHW_OVER:
case NHW_BASE: case NHW_MAP:
case NHW_OVER: if (wd) {
case NHW_MAP: fillhook.h_Entry = (void *) &LayerFillHook;
if (wd) { fillhook.h_Data = (void *) type;
fillhook.h_Entry = (void *) &LayerFillHook; fillhook.h_SubEntry = 0;
fillhook.h_Data = (void *) type; wd->hook = alloc(sizeof(fillhook));
fillhook.h_SubEntry = 0; memcpy(wd->hook, &fillhook, sizeof(fillhook));
wd->hook = alloc(sizeof(fillhook)); memcpy(wd->wintags, wintags, sizeof(wd->wintags));
memcpy(wd->hook, &fillhook, sizeof(fillhook)); wd->wintags[0].ti_Data = (long) wd->hook;
memcpy(wd->wintags, wintags, sizeof(wd->wintags)); nw->Extension = (void *) wd->wintags;
wd->wintags[0].ti_Data = (long) wd->hook;
nw->Extension = (void *) wd->wintags;
}
break;
} }
break;
} }
/* Don't open MENU or TEXT windows yet */ /* Don't open MENU or TEXT windows yet */
+15 -21
View File
@@ -108,13 +108,11 @@ EditColor(void)
((struct PropInfo *) Col_RedPen.SpecialInfo)->Flags |= PROPNEWLOOK; ((struct PropInfo *) Col_RedPen.SpecialInfo)->Flags |= PROPNEWLOOK;
((struct PropInfo *) Col_GreenPen.SpecialInfo)->Flags |= PROPNEWLOOK; ((struct PropInfo *) Col_GreenPen.SpecialInfo)->Flags |= PROPNEWLOOK;
} }
if (WINVERS_AMIV || WINVERS_AMII) { Col_NewWindowStructure1.Extension = wintags;
Col_NewWindowStructure1.Extension = wintags; Col_NewWindowStructure1.Flags |= WFLG_NW_EXTENDED;
Col_NewWindowStructure1.Flags |= WFLG_NW_EXTENDED; fillhook.h_Entry = (void *) &LayerFillHook;
fillhook.h_Entry = (void *) &LayerFillHook; fillhook.h_Data = (void *) -2;
fillhook.h_Data = (void *) -2; fillhook.h_SubEntry = 0;
fillhook.h_SubEntry = 0;
}
nw = OpenWindow((void *) &Col_NewWindowStructure1); nw = OpenWindow((void *) &Col_NewWindowStructure1);
@@ -360,13 +358,11 @@ EditClipping(void)
((struct PropInfo *) ClipXCLIP.SpecialInfo)->Flags |= PROPNEWLOOK; ((struct PropInfo *) ClipXCLIP.SpecialInfo)->Flags |= PROPNEWLOOK;
((struct PropInfo *) ClipYCLIP.SpecialInfo)->Flags |= PROPNEWLOOK; ((struct PropInfo *) ClipYCLIP.SpecialInfo)->Flags |= PROPNEWLOOK;
} }
if (WINVERS_AMIV || WINVERS_AMII) { ClipNewWindowStructure1.Extension = wintags;
ClipNewWindowStructure1.Extension = wintags; ClipNewWindowStructure1.Flags |= WFLG_NW_EXTENDED;
ClipNewWindowStructure1.Flags |= WFLG_NW_EXTENDED; fillhook.h_Entry = (void *) &LayerFillHook;
fillhook.h_Entry = (void *) &LayerFillHook; fillhook.h_Data = (void *) -2;
fillhook.h_Data = (void *) -2; fillhook.h_SubEntry = 0;
fillhook.h_SubEntry = 0;
}
nw = OpenWindow((void *) &ClipNewWindowStructure1); nw = OpenWindow((void *) &ClipNewWindowStructure1);
@@ -807,13 +803,11 @@ getlind(const char *prompt, char *bufp, const char *dflt)
once = 1; once = 1;
} }
if (WINVERS_AMIV || WINVERS_AMII) { StrWindow.Extension = wintags;
StrWindow.Extension = wintags; StrWindow.Flags |= WFLG_NW_EXTENDED;
StrWindow.Flags |= WFLG_NW_EXTENDED; fillhook.h_Entry = (void *) &LayerFillHook;
fillhook.h_Entry = (void *) &LayerFillHook; fillhook.h_Data = (void *) -2;
fillhook.h_Data = (void *) -2; fillhook.h_SubEntry = 0;
fillhook.h_SubEntry = 0;
}
if ((cwin = OpenWindow((void *) &StrWindow)) == NULL) { if ((cwin = OpenWindow((void *) &StrWindow)) == NULL) {
return; return;