rem: gadtextattr=TextAttr;
add: gadtextattr=(struct TextAttr *)TextAttr;
context: static BOOL LayOutReq (struct AHIAudioModeRequesterExt *req, struct TextAttr *TextAttr){  struct Gadget *gad;  struct NewGadget ng;  struct TextAttr *gadtextattr;  struct TextFont *font;  LONG   fontwidth,buttonheight,buttonwidth,pixels;  struct IntuiText intuitext = {1,0,JAM1,0,0,NULL,NULL,NULL};  LONG  sliderlevels,sliderlevel;  LONG  selected;  selected=GetSelected(req);  GetSliderAttrs(req,&sliderlevels,&sliderlevel);// Calculate gadget area  req->gx=req->Window->BorderLeft+4;  req->gy=req->Window->BorderTop+2;  req->gw=req->Window->Width-req->gx-(req->Window->BorderRight+4);  req->gh=req->Window->Height-req->gy-(req->Window->BorderBottom+2);  if(req->Gadgets)  {    RemoveGList(req->Window,req->Gadgets,-1);    FreeGadgets(req->Gadgets);    SetAPen(req->Window->RPort,0);    SetDrMd(req->Window->RPort,JAM1);    EraseRect(req->Window->RPort, req->Window->BorderLeft, req->Window->BorderTop,        req->Window->Width-req->Window->BorderRight-1,req->Window->Height-req->Window->BorderBottom-1);    RefreshWindowFrame(req->Window);  }  req->Gadgets=NULL;  if((gad=CreateContext(&req->Gadgets)))  {    if(TextAttr)      gadtextattr=TextAttr;    else      gadtextattr=req->Window->WScreen->Font;    if((font=OpenFont(gadtextattr)))    {      fontwidth=font->tf_XSize;      CloseFont(font);    }    else      return FALSE;    buttonheight=gadtextattr->ta_YSize+6;    intuitext.ITextFont=gadtextattr;    intuitext.IText=req->PositiveText;    buttonwidth=IntuiTextLength(&intuitext);    intuitext.IText=req->NegativeText;    pixels=IntuiTextLength(&intuitext);    buttonwidth=max(pixels,buttonwidth);    buttonwidth+=4+fontwidth;// Create gadgets and check if they fit    // Do the two buttons fit?    if(2*buttonwidth > req->gw)      return FALSE;    ng.ng_TextAttr=gadtextattr;    ng.ng_VisualInfo=req->vi;    ng.ng_UserData=req;// OK button    ng.ng_LeftEdge=req->gx;    ng.ng_TopEdge=req->gy+req->gh-buttonheight;    ng.ng_Width=buttonwidth;    ng.ng_Height=buttonheight;    ng.ng_GadgetText=req->PositiveText;    ng.ng_GadgetID=OKBUTTON;    ng.ng_Flags=PLACETEXT_IN;    gad=CreateGadget(BUTTON_KIND,gad,&ng,TAG_END);// Cancel button    ng.ng_LeftEdge=req->gx+req->gw-ng.ng_Width;    ng.ng_GadgetText=req->NegativeText;    ng.ng_GadgetID=CANCELBUTTON;    gad=CreateGadget(BUTTON_KIND,gad,&ng,TAG_END);// Frequency    if(req->Flags & freqgad)    {      intuitext.IText = GetString(msgReqFrequency, req->Catalog);      pixels=IntuiTextLength(&intuitext)+INTERWIDTH;      if(pixels+MINSLIDERWIDTH+INTERWIDTH+FREQLEN2*fontwidth > req->gw)        return FALSE;      ng.ng_Width=req->gw-pixels-INTERWIDTH-FREQLEN2*fontwidth;      ng.ng_LeftEdge=req->gx+pixels;      ng.ng_TopEdge-=2+buttonheight;      ng.ng_GadgetText = GetString(msgReqFrequency, req->Catalog);      ng.ng_GadgetID=FREQSLIDER;      ng.ng_Flags=PLACETEXT_LEFT;      gad=CreateGadget(SLIDER_KIND,gad,&ng,          GTSL_Min,0,          GTSL_Max,sliderlevels-1,          GTSL_Level,sliderlevel,          GTSL_LevelFormat, (ULONG) FREQTEXT2,          GTSL_MaxLevelLen,FREQLEN2,          GTSL_LevelPlace,PLACETEXT_RIGHT,          GTSL_DispFunc, (ULONG) m68k_IndexToFrequency,          GA_RelVerify,TRUE,          GA_Disabled,!sliderlevels || (req->tempAudioID == AHI_DEFAULT_ID),          TAG_DONE);      req->slidergadget=gad;   // Save for HadleReq()...    }// ListView    if((ng.ng_Height=ng.ng_TopEdge-2-req->gy) < buttonheight)      return FALSE;    ng.ng_LeftEdge=req->gx;    ng.ng_TopEdge=req->gy;    ng.ng_Width=req->gw;    ng.ng_GadgetText=NULL,    ng.ng_GadgetID=LISTVIEW;    ng.ng_Flags=PLACETEXT_ABOVE;    gad=CreateGadget(LISTVIEW_KIND,gad,&ng,        GTLV_ScrollWidth,(fontwidth>8 ? fontwidth*2 : 18),        GTLV_Labels, (ULONG) req->list,        GTLV_ShowSelected,0,        ((selected == ~0) || (GadToolsBase->lib_Version >= 39) ? TAG_IGNORE : GTLV_Top),selected,        (selected == ~0 ? TAG_IGNORE : GTLV_MakeVisible),selected,        GTLV_Selected,selected,        TAG_DONE);    req->listviewgadget=gad;   // Save for HadleReq()...    if(!gad)      return FALSE;  }  else    return FALSE;  AddGList(req->Window,req->Gadgets,~0,-1,NULL);  RefreshGList(req->Gadgets,req->Window,NULL,-1);  GT_RefreshWindow(req->Window,NULL);  return TRUE;}