From 6957c65ce3967723b77e1a6501ee30a92d4d09a7 Mon Sep 17 00:00:00 2001 From: NicJA Date: Mon, 14 Mar 2016 17:22:38 +0000 Subject: [PATCH] more 64bit fixes (incomplete). Adapt menu loading code to differentiate between ondisk and inmemory structures on 64bit platforms. git-svn-id: https://svn.aros.org/svn/aros/trunk/contrib@51943 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- scalos/include/scalos/menu.h | 38 +++++++++- scalos/include/scalos/scalos.h | 6 +- scalos/main/GadgetBarClass.c | 39 +++++----- scalos/main/GadgetBarImageClass.c | 26 +++---- scalos/main/GadgetBarTextClass.c | 38 +++++----- scalos/main/GaugeGadgetClass.c | 14 ++-- scalos/main/HistoryGadgetClass.c | 52 ++++++------- scalos/main/IconImageClass.c | 12 +-- scalos/main/IconWindowClass.c | 150 ++++++++++++++++++------------------- scalos/main/IconWindow_MouseMove.c | 8 +- scalos/main/IconifyClass.c | 12 +-- scalos/main/InputHandler.c | 2 +- scalos/main/MainWait.c | 2 +- scalos/main/Menu.c | 122 ++++++++++++++++++------------ scalos/main/MenuCommand.c | 64 ++++++++-------- scalos/main/Messages.c | 8 +- scalos/main/OpenDrawerByName.c | 14 ++-- scalos/main/Patches.c | 20 ++--- scalos/main/Patches.h | 2 +- scalos/main/Pattern.c | 22 +++--- scalos/main/PopupMenus.c | 56 +++++++------- scalos/main/Prefs.c | 6 +- scalos/main/Request.c | 4 +- scalos/main/RootClass.c | 46 ++++++------ scalos/main/ScaLibrary.c | 42 ++++++----- scalos/main/filetypes.c | 32 ++++---- scalos/main/functions.h | 11 ++- scalos/main/idcmp.c | 8 +- scalos/main/mmakefile.src | 3 +- scalos/main/scalos_structures.h | 3 +- 30 files changed, 467 insertions(+), 395 deletions(-) diff --git a/scalos/include/scalos/menu.h b/scalos/include/scalos/menu.h index 7ac2a66fe..b4510c3dc 100755 --- a/scalos/include/scalos/menu.h +++ b/scalos/include/scalos/menu.h @@ -28,12 +28,40 @@ #pragma pack(2) #endif /* __GNUC__ */ -// This is the exact structure that stores menu information in menu preferences files +// This is the disk structure that stores menu information in menu preferences files +// Do not use pointers since the values _must_ remain 32bit even on 64bit platforms. // !!! BE VERY CAREFUL TO KEEP PREFS COMPATIBLE IF YOU EVER CHANGE THIS STRUCTURE !!! struct ScalosMenuTree { - struct ScalosMenuTree *mtre_Next; - struct ScalosMenuTree *mtre_tree; + ULONG mtre_Next; + ULONG mtre_tree; + UBYTE mtre_type; + UBYTE mtre_flags; + union { + struct { + char mtre_hotkey[2]; + ULONG mtre_name; + ULONG mtre_iconnames; // only valid if MTREFLGF_IconNames + // points to 2 strings with menu icon path names + // for empty path names, it points to two '\0' + } MenuTree; + struct { + UBYTE mcom_flags; + UBYTE mcom_type; // enum ScalosMenuCommandType + ULONG mcom_stack; + ULONG mcom_name; + BYTE mcom_pri; // priority for command process + // only valid if MCOMFLGF_Priority set + } MenuCommand; + } MenuCombo; + } __attribute__((packed)) ; + +// SCALOS_MENUTREE represents the memory structure that stores menu information +#if defined(__AROS__) && __WORDSIZE==64 +struct ScalosMenuTreeFull + { + struct ScalosMenuTreeFull *mtre_Next; + struct ScalosMenuTreeFull *mtre_tree; UBYTE mtre_type; UBYTE mtre_flags; union { @@ -54,6 +82,10 @@ struct ScalosMenuTree } MenuCommand; } MenuCombo; }; +#define SCALOS_MENUTREE ScalosMenuTreeFull +#else +#define SCALOS_MENUTREE ScalosMenuTree +#endif enum ScalosMenuType { diff --git a/scalos/include/scalos/scalos.h b/scalos/include/scalos/scalos.h index ceeb42a71..7e63b01e9 100755 --- a/scalos/include/scalos/scalos.h +++ b/scalos/include/scalos/scalos.h @@ -73,6 +73,10 @@ #include #endif +#ifndef PREFS_SCA_MENU_H +#include +#endif + #ifndef SCALOS_UNDO_H #include #endif @@ -606,7 +610,7 @@ struct SM_MenuCmd struct SM_RunMenuCmd { struct ScalosMessage ScalosMessage; - struct ScalosMenuTree *smrm_MenuItem; + struct SCALOS_MENUTREE *smrm_MenuItem; struct ScaIconNode *smrm_IconNode; ULONG smrm_Flags; }; diff --git a/scalos/main/GadgetBarClass.c b/scalos/main/GadgetBarClass.c index 48d029f15..52c45420c 100755 --- a/scalos/main/GadgetBarClass.c +++ b/scalos/main/GadgetBarClass.c @@ -104,8 +104,8 @@ struct GadgetBarClassInst // local functions -static SAVEDS(ULONG) INTERRUPT GadgetBarClassDispatcher(Class *cl, Object *o, Msg msg); -static ULONG GadgetBar_New(Class *cl, Object *o, Msg msg); +static SAVEDS(IPTR) INTERRUPT GadgetBarClassDispatcher(Class *cl, Object *o, Msg msg); +static IPTR GadgetBar_New(Class *cl, Object *o, Msg msg); static ULONG GadgetBar_Dispose(Class *cl, Object *o, Msg msg); static ULONG GadgetBar_Set(Class *cl, Object *o, Msg msg); static ULONG GadgetBar_Get(Class *cl, Object *o, Msg msg); @@ -153,11 +153,11 @@ struct ScalosClass *initGadgetBarClass(const struct PluginClass *plug) //---------------------------------------------------------------------------- -static SAVEDS(ULONG) INTERRUPT GadgetBarClassDispatcher(Class *cl, Object *o, Msg msg) +static SAVEDS(IPTR) INTERRUPT GadgetBarClassDispatcher(Class *cl, Object *o, Msg msg) { struct GadgetBarMember *Member; struct GadgetBarClassInst *inst; - ULONG Result; + IPTR Result; d1(KPrintF("%s/%s/%ld: o=%08lx MethodID=%08lx\n", __FILE__, __FUNC__, __LINE__, o, msg->MethodID)); @@ -232,7 +232,7 @@ static SAVEDS(ULONG) INTERRUPT GadgetBarClassDispatcher(Class *cl, Object *o, Ms //---------------------------------------------------------------------------- -static ULONG GadgetBar_New(Class *cl, Object *o, Msg msg) +static IPTR GadgetBar_New(Class *cl, Object *o, Msg msg) { struct opSet *ops = (struct opSet *) msg; struct GadgetBarClassInst *inst; @@ -248,7 +248,7 @@ static ULONG GadgetBar_New(Class *cl, Object *o, Msg msg) NewList(&inst->gbcl_MemberList); - inst->gbcl_WindowTask = (struct internalScaWindowTask *) GetTagData(GBDTA_WindowTask, (ULONG)NULL, ops->ops_AttrList); + inst->gbcl_WindowTask = (struct internalScaWindowTask *) GetTagData(GBDTA_WindowTask, (IPTR)NULL, ops->ops_AttrList); if (NULL == inst->gbcl_WindowTask) { @@ -266,7 +266,7 @@ static ULONG GadgetBar_New(Class *cl, Object *o, Msg msg) inst->gbcl_LeftSpace = GetTagData(GBDTA_LeftSpace, 2, ops->ops_AttrList); inst->gbcl_BetweenSpace = GetTagData(GBDTA_BetweenSpace, 5, ops->ops_AttrList); - inst->gbcl_Background = CreateDatatypesImage((CONST_STRPTR) GetTagData(GBDTA_BackgroundImageName, (ULONG) "", ops->ops_AttrList), 0); + inst->gbcl_Background = CreateDatatypesImage((CONST_STRPTR) GetTagData(GBDTA_BackgroundImageName, (IPTR) "", ops->ops_AttrList), 0); gg->Height = gg->BoundsHeight = 0; inst->gbcl_WindowLeftBorder = 0; @@ -277,7 +277,7 @@ static ULONG GadgetBar_New(Class *cl, Object *o, Msg msg) SETHOOKFUNC(inst->gbcl_BackFillHook, GadgetBar_BackFillFunc); inst->gbcl_BackFillHook.h_Data = inst; - return (ULONG) o; + return (IPTR) o; } //---------------------------------------------------------------------------- @@ -319,8 +319,10 @@ static ULONG GadgetBar_Set(Class *cl, Object *o, Msg msg) { struct GadgetBarClassInst *inst = INST_DATA(cl, o); struct opSet *ops = (struct opSet *) msg; - static const ULONG packTable[] = + + static ULONG packTable[] = { +#if !defined(__AROS__) || __WORDSIZE != 64 PACK_STARTTABLE(DTA_Dummy), PACK_ENTRY(DTA_Dummy, GBDTA_BGPen, GadgetBarClassInst, gbcl_BGPen, PKCTRL_UWORD | PKCTRL_PACKUNPACK), PACK_ENTRY(DTA_Dummy, GBDTA_TopSpace, GadgetBarClassInst, gbcl_TopSpace, PKCTRL_WORD | PKCTRL_PACKUNPACK), @@ -329,6 +331,9 @@ static ULONG GadgetBar_Set(Class *cl, Object *o, Msg msg) PACK_ENTRY(DTA_Dummy, GBDTA_LeftSpace, GadgetBarClassInst, gbcl_LeftSpace, PKCTRL_WORD | PKCTRL_PACKUNPACK), PACK_ENTRY(DTA_Dummy, GBDTA_BetweenSpace, GadgetBarClassInst, gbcl_BetweenSpace, PKCTRL_WORD | PKCTRL_PACKUNPACK), PACK_ENDTABLE +#else + // FIXME!! +#endif }; DoSuperMethodA(cl, o, msg); @@ -345,7 +350,7 @@ static ULONG GadgetBar_Set(Class *cl, Object *o, Msg msg) if (FindTagItem(GBDTA_BackgroundImageName, ops->ops_AttrList)) { DisposeDatatypesImage(&inst->gbcl_Background); - inst->gbcl_Background = CreateDatatypesImage((CONST_STRPTR) GetTagData(GBDTA_BackgroundImageName, (ULONG) "", ops->ops_AttrList), 0); + inst->gbcl_Background = CreateDatatypesImage((CONST_STRPTR) GetTagData(GBDTA_BackgroundImageName, (IPTR) "", ops->ops_AttrList), 0); } return 0; @@ -472,7 +477,7 @@ static ULONG GadgetBar_Layout(Class *cl, Object *o, Msg msg) Member != (struct GadgetBarMember *) &inst->gbcl_MemberList.lh_Tail; Member = (struct GadgetBarMember *) Member->gbm_Node.ln_Succ) { - ULONG MemberHeight = 0; + IPTR MemberHeight = 0; ULONG TotalHeight; Member->gbm_Flags &= ~GBMFLAGF_Skipped; @@ -522,7 +527,7 @@ static ULONG GadgetBar_Layout(Class *cl, Object *o, Msg msg) Member != (struct GadgetBarMember *) &inst->gbcl_MemberList.lh_Tail; Member = (struct GadgetBarMember *) Member->gbm_Node.ln_Succ) { - ULONG imgWidth = 0; + IPTR imgWidth = 0; GetAttr(GA_Width, Member->gbm_Object, &imgWidth); @@ -546,7 +551,7 @@ static ULONG GadgetBar_Layout(Class *cl, Object *o, Msg msg) { if (GB_FIXED_WIDTH == Member->gbm_Weight) { - ULONG imgWidth = 0; + IPTR imgWidth = 0; GetAttr(GA_Width, Member->gbm_Object, &imgWidth); @@ -592,8 +597,8 @@ static ULONG GadgetBar_Layout(Class *cl, Object *o, Msg msg) { if (!(Member->gbm_Flags & GBMFLAGF_Skipped)) { - ULONG imgWidth = 0; - ULONG imgHeight = 0; + IPTR imgWidth = 0; + IPTR imgHeight = 0; GetAttr(GA_Height, Member->gbm_Object, &imgHeight); GetAttr(GA_Width, Member->gbm_Object, &imgWidth); @@ -674,7 +679,7 @@ static ULONG GadgetBar_Layout(Class *cl, Object *o, Msg msg) { if (!(Member->gbm_Flags & GBMFLAGF_Skipped)) { - ULONG imgWidth = 0, imgHeight = 0; + IPTR imgWidth = 0, imgHeight = 0; GetAttr(GA_Height, Member->gbm_Object, &imgHeight); GetAttr(GA_Width, Member->gbm_Object, &imgWidth); @@ -1152,7 +1157,7 @@ static ULONG GadgetBar_HandleMouseWheel(Class *cl, Object *o, Msg msg) static BOOL GadgetBar_PointInGadget(struct ExtGadget *Parent, struct ExtGadget *gg, WORD x, WORD y) { - ULONG Left, Top, Width, Height; + IPTR Left, Top, Width, Height; GetAttr(GA_Left, (Object *) Parent, &Left); GetAttr(GA_Top, (Object *) Parent, &Top); diff --git a/scalos/main/GadgetBarImageClass.c b/scalos/main/GadgetBarImageClass.c index 3a3df3780..b2023e787 100644 --- a/scalos/main/GadgetBarImageClass.c +++ b/scalos/main/GadgetBarImageClass.c @@ -70,8 +70,8 @@ struct GadgetBarImageClassInst // local functions -static SAVEDS(ULONG) INTERRUPT GadgetBarImageClassDispatcher(Class *cl, Object *o, Msg msg); -static ULONG GadgetBarImage_New(Class *cl, Object *o, Msg msg); +static SAVEDS(IPTR) INTERRUPT GadgetBarImageClassDispatcher(Class *cl, Object *o, Msg msg); +static IPTR GadgetBarImage_New(Class *cl, Object *o, Msg msg); static ULONG GadgetBarImage_Dispose(Class *cl, Object *o, Msg msg); static ULONG GadgetBarImage_Set(Class *cl, Object *o, Msg msg); static ULONG GadgetBarImage_Get(Class *cl, Object *o, Msg msg); @@ -108,9 +108,9 @@ struct ScalosClass *initGadgetBarImageClass(const struct PluginClass *plug) //---------------------------------------------------------------------------- -static SAVEDS(ULONG) INTERRUPT GadgetBarImageClassDispatcher(Class *cl, Object *o, Msg msg) +static SAVEDS(IPTR) INTERRUPT GadgetBarImageClassDispatcher(Class *cl, Object *o, Msg msg) { - ULONG Result; + IPTR Result; d1(kprintf("%s/%s/%ld: MethodID=%08lx\n", __FILE__, __FUNC__, __LINE__, msg->MethodID)); @@ -157,7 +157,7 @@ static SAVEDS(ULONG) INTERRUPT GadgetBarImageClassDispatcher(Class *cl, Object * //---------------------------------------------------------------------------- -static ULONG GadgetBarImage_New(Class *cl, Object *o, Msg msg) +static IPTR GadgetBarImage_New(Class *cl, Object *o, Msg msg) { struct opSet *ops = (struct opSet *) msg; struct GadgetBarImageClassInst *inst; @@ -173,9 +173,9 @@ static ULONG GadgetBarImage_New(Class *cl, Object *o, Msg msg) inst->gbicl_LayoutOk = FALSE; - inst->gbicl_iwt = (struct internalScaWindowTask *) GetTagData(GBIDTA_WindowTask, (ULONG)NULL, ops->ops_AttrList); + inst->gbicl_iwt = (struct internalScaWindowTask *) GetTagData(GBIDTA_WindowTask, (IPTR)NULL, ops->ops_AttrList); - inst->gbicl_DtImage = CreateDatatypesImage((STRPTR) GetTagData(DTA_Name, (ULONG)NULL, ops->ops_AttrList), 0); + inst->gbicl_DtImage = CreateDatatypesImage((STRPTR) GetTagData(DTA_Name, (IPTR)NULL, ops->ops_AttrList), 0); d1(KPrintF("%s/%s/%ld: gbicl_DtImage=%08lx\n", __FILE__, __FUNC__, __LINE__, inst->gbicl_DtImage)); @@ -214,13 +214,13 @@ static ULONG GadgetBarImage_New(Class *cl, Object *o, Msg msg) } if (inst->gbicl_AnimDTObject) { - ULONG Width = 0, Height = 0; + IPTR Width = 0, Height = 0; DoDTMethod(inst->gbicl_AnimDTObject, NULL, NULL, DTM_PROCLAYOUT, NULL, TRUE); GetDTAttrs(inst->gbicl_AnimDTObject, - ADTA_Width, (ULONG) &Width, - ADTA_Height, (ULONG) &Height, + ADTA_Width, (IPTR) &Width, + ADTA_Height, (IPTR) &Height, TAG_END); gg->Width = gg->BoundsWidth = Width; @@ -229,7 +229,7 @@ static ULONG GadgetBarImage_New(Class *cl, Object *o, Msg msg) d1(kprintf("%s/%s/%ld: Width=%ld Height=%ld\n", __FILE__, __FUNC__, __LINE__, gg->Width, gg->Height)); - return (ULONG) o; + return (IPTR) o; } //---------------------------------------------------------------------------- @@ -385,7 +385,7 @@ static ULONG GadgetBarImage_Render(Class *cl, Object *o, Msg msg) { DoDTMethod(inst->gbicl_AnimDTObject, gpr->gpr_GInfo->gi_Window, NULL, GM_LAYOUT, - (ULONG) gpr->gpr_GInfo, + (IPTR) gpr->gpr_GInfo, FALSE); inst->gbicl_LayoutOk = TRUE; } @@ -453,7 +453,7 @@ static ULONG GadgetBarImage_HelpTest(Class *cl, Object *o, Msg msg) static BOOL GadgetBarImage_PointInGadget(Object *o, WORD x, WORD y) { - ULONG Width, Height; + IPTR Width, Height; GetAttr(GA_Width, o, &Width); GetAttr(GA_Height, o, &Height); diff --git a/scalos/main/GadgetBarTextClass.c b/scalos/main/GadgetBarTextClass.c index cf7d7aa9f..298f98838 100644 --- a/scalos/main/GadgetBarTextClass.c +++ b/scalos/main/GadgetBarTextClass.c @@ -77,8 +77,8 @@ struct GadgetBarTextClassInst // local functions -static SAVEDS(ULONG) INTERRUPT GadgetBarTextClassDispatcher(Class *cl, Object *o, Msg msg); -static ULONG GadgetBarText_New(Class *cl, Object *o, Msg msg); +static SAVEDS(IPTR) INTERRUPT GadgetBarTextClassDispatcher(Class *cl, Object *o, Msg msg); +static IPTR GadgetBarText_New(Class *cl, Object *o, Msg msg); static ULONG GadgetBarText_Dispose(Class *cl, Object *o, Msg msg); static ULONG GadgetBarText_Set(Class *cl, Object *o, Msg msg); static ULONG GadgetBarText_Get(Class *cl, Object *o, Msg msg); @@ -113,9 +113,9 @@ struct ScalosClass *initGadgetBarTextClass(const struct PluginClass *plug) //---------------------------------------------------------------------------- -static SAVEDS(ULONG) INTERRUPT GadgetBarTextClassDispatcher(Class *cl, Object *o, Msg msg) +static SAVEDS(IPTR) INTERRUPT GadgetBarTextClassDispatcher(Class *cl, Object *o, Msg msg) { - ULONG Result; + IPTR Result; switch (msg->MethodID) { @@ -154,7 +154,7 @@ static SAVEDS(ULONG) INTERRUPT GadgetBarTextClassDispatcher(Class *cl, Object *o //---------------------------------------------------------------------------- -static ULONG GadgetBarText_New(Class *cl, Object *o, Msg msg) +static IPTR GadgetBarText_New(Class *cl, Object *o, Msg msg) { struct opSet *ops = (struct opSet *) msg; struct GadgetBarTextClassInst *inst; @@ -177,9 +177,9 @@ static ULONG GadgetBarText_New(Class *cl, Object *o, Msg msg) inst->gbtcl_NeedLayout = TRUE; - inst->gbtcl_Text = (STRPTR) GetTagData(GBTDTA_Text, (ULONG) "", ops->ops_AttrList); - inst->gbtcl_Font = (struct TextFont *) GetTagData(GBTDTA_TextFont, (ULONG) iInfos.xii_iinfos.ii_Screen->RastPort.Font, ops->ops_AttrList); - inst->gbtcl_TTFont = (struct TTFontFamily *) GetTagData(GBTDTA_TTFont, (ULONG) &ScreenTTFont, ops->ops_AttrList); + inst->gbtcl_Text = (STRPTR) GetTagData(GBTDTA_Text, (IPTR) "", ops->ops_AttrList); + inst->gbtcl_Font = (struct TextFont *) GetTagData(GBTDTA_TextFont, (IPTR) iInfos.xii_iinfos.ii_Screen->RastPort.Font, ops->ops_AttrList); + inst->gbtcl_TTFont = (struct TTFontFamily *) GetTagData(GBTDTA_TTFont, (IPTR) &ScreenTTFont, ops->ops_AttrList); inst->gbtcl_TextPen = GetTagData(GBTDTA_TextPen, PalettePrefs.pal_driPens[TEXTPEN], ops->ops_AttrList); inst->gbtcl_BGPen = GetTagData(GBTDTA_BgPen, PalettePrefs.pal_driPens[BACKGROUNDPEN], ops->ops_AttrList); inst->gbtcl_DrawMode = GetTagData(GBTDTA_DrawMode, JAM1, ops->ops_AttrList); @@ -212,7 +212,7 @@ static ULONG GadgetBarText_New(Class *cl, Object *o, Msg msg) d1(kprintf("%s/%s/%ld: gg=%08lx Width=%ld Height=%ld\n", __FILE__, __FUNC__, __LINE__, gg, gg->Width, gg->Height)); } - return (ULONG) o; + return (IPTR) o; } //---------------------------------------------------------------------------- @@ -241,22 +241,22 @@ static ULONG GadgetBarText_Get(Class *cl, Object *o, Msg msg) switch (opg->opg_AttrID) { case GA_Left: // required since gadgetclass attribute is [IS] - no support for [G] - *(opg->opg_Storage) = (ULONG) gg->LeftEdge; + *(opg->opg_Storage) = (IPTR) gg->LeftEdge; break; case GA_Top: // required since gadgetclass attribute is [IS] - no support for [G] - *(opg->opg_Storage) = (ULONG) gg->TopEdge; + *(opg->opg_Storage) = (IPTR) gg->TopEdge; break; case GA_Width: // required since gadgetclass attribute is [IS] - no support for [G] - *(opg->opg_Storage) = (ULONG) gg->Width; + *(opg->opg_Storage) = (IPTR) gg->Width; break; case GA_Height: // required since gadgetclass attribute is [IS] - no support for [G] - *(opg->opg_Storage) = (ULONG) gg->Height; + *(opg->opg_Storage) = (IPTR) gg->Height; break; case GBTDTA_Text: - *(opg->opg_Storage) = (ULONG) inst->gbtcl_Text; + *(opg->opg_Storage) = (IPTR) inst->gbtcl_Text; break; case GBTDTA_TextFont: - *(opg->opg_Storage) = (ULONG) inst->gbtcl_Font; + *(opg->opg_Storage) = (IPTR) inst->gbtcl_Font; break; case GBTDTA_TextPen: *(opg->opg_Storage) = inst->gbtcl_TextPen; @@ -291,7 +291,7 @@ static ULONG GadgetBarText_Set(Class *cl, Object *o, Msg msg) if (FindTagItem(GBTDTA_Text, ops->ops_AttrList)) { - STRPTR NewText = (STRPTR) GetTagData(GBTDTA_Text, (ULONG) inst->gbtcl_Text, ops->ops_AttrList); + STRPTR NewText = (STRPTR) GetTagData(GBTDTA_Text, (IPTR) inst->gbtcl_Text, ops->ops_AttrList); if (inst->gbtcl_Text) FreeCopyString(inst->gbtcl_Text); @@ -300,8 +300,8 @@ static ULONG GadgetBarText_Set(Class *cl, Object *o, Msg msg) inst->gbtcl_NeedLayout = TRUE; } - inst->gbtcl_Font = (struct TextFont *) GetTagData(GBTDTA_TextFont, (ULONG) inst->gbtcl_Font, ops->ops_AttrList); - inst->gbtcl_TTFont = (struct TTFontFamily *) GetTagData(GBTDTA_TTFont, (ULONG) inst->gbtcl_TTFont, ops->ops_AttrList); + inst->gbtcl_Font = (struct TextFont *) GetTagData(GBTDTA_TextFont, (IPTR) inst->gbtcl_Font, ops->ops_AttrList); + inst->gbtcl_TTFont = (struct TTFontFamily *) GetTagData(GBTDTA_TTFont, (IPTR) inst->gbtcl_TTFont, ops->ops_AttrList); inst->gbtcl_TextPen = GetTagData(GBTDTA_TextPen, inst->gbtcl_TextPen, ops->ops_AttrList); inst->gbtcl_BGPen = GetTagData(GBTDTA_BgPen, inst->gbtcl_BGPen, ops->ops_AttrList); inst->gbtcl_DrawMode = GetTagData(GBTDTA_DrawMode, inst->gbtcl_DrawMode, ops->ops_AttrList); @@ -415,7 +415,7 @@ static ULONG GadgetBarText_Render(Class *cl, Object *o, Msg msg) if (inst->gbtcl_NeedLayout) { DoMethod(o, GM_LAYOUT, - (ULONG) gpr->gpr_GInfo, + (IPTR) gpr->gpr_GInfo, TRUE); } diff --git a/scalos/main/GaugeGadgetClass.c b/scalos/main/GaugeGadgetClass.c index 7f6f5709f..d71f8193b 100644 --- a/scalos/main/GaugeGadgetClass.c +++ b/scalos/main/GaugeGadgetClass.c @@ -88,7 +88,7 @@ struct GaugeINST // local functions -static SAVEDS(ULONG) INTERRUPT GaugeGadgetClassDispatcher(Class *cl, Object *o, Msg msg); +static SAVEDS(IPTR) INTERRUPT GaugeGadgetClassDispatcher(Class *cl, Object *o, Msg msg); static ULONG RenderGauge(Class *, struct Gadget *, struct gpRender *); static ULONG INTERRUPT UpdateGauge(Class *cl, struct Gadget *g, struct opSet *msg); static short GetGaugeWidth(struct GaugeINST *inst, struct Gadget *g); @@ -124,7 +124,7 @@ struct ScalosClass *initGaugeGadgetClass(const struct PluginClass *plug) /***********************************************************/ /********** The Gauge class dispatcher *********/ /***********************************************************/ -static SAVEDS(ULONG) INTERRUPT GaugeGadgetClassDispatcher(Class *cl, Object *o, Msg msg) +static SAVEDS(IPTR) INTERRUPT GaugeGadgetClassDispatcher(Class *cl, Object *o, Msg msg) { struct GaugeINST *inst; ULONG retval = FALSE; @@ -154,10 +154,10 @@ static SAVEDS(ULONG) INTERRUPT GaugeGadgetClassDispatcher(Class *cl, Object *o, inst->BarPen = GetTagData(SCAGAUGE_BarPen, FILLPEN, ops->ops_AttrList); inst->TextPen = GetTagData(SCAGAUGE_TextPen, TEXTPEN, ops->ops_AttrList); - PBTextAttr = (struct TextAttr *) GetTagData(SCAGAUGE_TextFont, (ULONG) NULL, ops->ops_AttrList); - PBTTTextDesc = (CONST_STRPTR) GetTagData(SCAGAUGE_TTFont, (ULONG) NULL, ops->ops_AttrList); + PBTextAttr = (struct TextAttr *) GetTagData(SCAGAUGE_TextFont, (IPTR) NULL, ops->ops_AttrList); + PBTTTextDesc = (CONST_STRPTR) GetTagData(SCAGAUGE_TTFont, (IPTR) NULL, ops->ops_AttrList); - stccpy(inst->NumFormat, (char *) GetTagData(SCAGAUGE_NumFormat, (ULONG) "%3d%%", ops->ops_AttrList), + stccpy(inst->NumFormat, (char *) GetTagData(SCAGAUGE_NumFormat, (IPTR) "%3d%%", ops->ops_AttrList), sizeof(inst->NumText)); if (PBTTTextDesc) @@ -167,7 +167,7 @@ static SAVEDS(ULONG) INTERRUPT GaugeGadgetClassDispatcher(Class *cl, Object *o, ScaleValue(inst); - retval = (ULONG)object; + retval = (IPTR)object; } break; @@ -253,7 +253,7 @@ static ULONG INTERRUPT RenderGauge(Class *cl, struct Gadget *g, struct gpRender DrawBevelBox(msg->gpr_RPort, g->LeftEdge, g->TopEdge, g->Width, g->Height, GTBB_FrameType, BBFT_BUTTON, GTBB_Recessed, TRUE, - GT_VisualInfo, (ULONG) inst->vi, + GT_VisualInfo, (IPTR) inst->vi, TAG_END ); } diff --git a/scalos/main/HistoryGadgetClass.c b/scalos/main/HistoryGadgetClass.c index 33b21e495..6946d7da0 100644 --- a/scalos/main/HistoryGadgetClass.c +++ b/scalos/main/HistoryGadgetClass.c @@ -115,8 +115,8 @@ struct HistoryGadgetInstance // The functions in this module -static SAVEDS(ULONG) INTERRUPT dispatchHistoryGadgetClass(Class *cl, Object *o, Msg msg); -static ULONG HistoryGadgetNew(Class *cl, Object *o, Msg msg); +static SAVEDS(IPTR) INTERRUPT dispatchHistoryGadgetClass(Class *cl, Object *o, Msg msg); +static IPTR HistoryGadgetNew(Class *cl, Object *o, Msg msg); static ULONG HistoryGadgetDispose(Class *cl, Object *o, Msg msg); static ULONG HistoryGadgetSet(Class *cl, Object *o, Msg msg); static ULONG HistoryGadgetGet(Class *cl, Object *o, Msg msg); @@ -170,9 +170,9 @@ struct ScalosClass *initHistoryGadgetClass(const struct PluginClass *plug) /**************************************************************************/ /********** The HistoryGadgetCLASS class dispatcher *********/ /**************************************************************************/ -static SAVEDS(ULONG) INTERRUPT dispatchHistoryGadgetClass(Class *cl, Object *o, Msg msg) +static SAVEDS(IPTR) INTERRUPT dispatchHistoryGadgetClass(Class *cl, Object *o, Msg msg) { - ULONG Result; + IPTR Result; d1(kprintf("%s/%s/%ld: Class=%08lx SuperClass=%08lx Method=%08lx\n", __FILE__, __FUNC__, __LINE__, cl, cl->cl_Super, msg->MethodID)); @@ -224,7 +224,7 @@ static SAVEDS(ULONG) INTERRUPT dispatchHistoryGadgetClass(Class *cl, Object *o, //---------------------------------------------------------------------------- -static ULONG HistoryGadgetNew(Class *cl, Object *o, Msg msg) +static IPTR HistoryGadgetNew(Class *cl, Object *o, Msg msg) { BOOL Success = FALSE; @@ -241,8 +241,8 @@ static ULONG HistoryGadgetNew(Class *cl, Object *o, Msg msg) inst = INST_DATA(cl, o); memset(inst, 0, sizeof(struct HistoryGadgetInstance)); - inst->hgi_Active = (struct Node *) GetTagData(SCAHISTORY_Active, (ULONG) ACTIVE_NONE, ops->ops_AttrList); - inst->hgi_Entries = (struct List *) GetTagData(SCAHISTORY_Labels, (ULONG) NULL, ops->ops_AttrList); + inst->hgi_Active = (struct Node *) GetTagData(SCAHISTORY_Active, (IPTR) ACTIVE_NONE, ops->ops_AttrList); + inst->hgi_Entries = (struct List *) GetTagData(SCAHISTORY_Labels, (IPTR) NULL, ops->ops_AttrList); inst->hgi_Hidden = GetTagData(GBDTA_Hidden, FALSE, ops->ops_AttrList); HistoryGadgetCountEntries(inst); @@ -266,8 +266,8 @@ static ULONG HistoryGadgetNew(Class *cl, Object *o, Msg msg) // hgi_HistoryImage is optional inst->hgi_HistoryImage = NewObject(DtImageClass, NULL, - DTIMG_ImageName, (ULONG) "THEME:Window/ControlBar/HistoryNormal", - DTIMG_SelImageName, (ULONG) "THEME:Window/ControlBar/HistorySelected", + DTIMG_ImageName, (IPTR) "THEME:Window/ControlBar/HistoryNormal", + DTIMG_SelImageName, (IPTR) "THEME:Window/ControlBar/HistorySelected", TAG_END); d1(KPrintF("%s/%s/%ld: o=%08lx hgi_HistoryImage=%08lx\n", __FILE__, __FUNC__, __LINE__, o, inst->hgi_HistoryImage)); @@ -283,9 +283,9 @@ static ULONG HistoryGadgetNew(Class *cl, Object *o, Msg msg) d1(KPrintF("%s/%s/%ld: gg->Width=%ld gg->Height=%ld\n", __FILE__, __FUNC__, __LINE__, ((struct Gadget *) o)->Width, ((struct Gadget *) o)->Height)); inst->hgi_PopupFont = (struct TextFont *) GetTagData(GBTDTA_TextFont, - (ULONG) iInfos.xii_iinfos.ii_Screen->RastPort.Font, ops->ops_AttrList); + (IPTR) iInfos.xii_iinfos.ii_Screen->RastPort.Font, ops->ops_AttrList); inst->hgi_PopupTTFont = (struct TTFontFamily *) GetTagData(GBTDTA_TTFont, - CurrentPrefs.pref_UseScreenTTFont ? (ULONG) &ScreenTTFont : 0, ops->ops_AttrList); + CurrentPrefs.pref_UseScreenTTFont ? (IPTR) &ScreenTTFont : 0, ops->ops_AttrList); Success = TRUE; } while (0); @@ -296,7 +296,7 @@ static ULONG HistoryGadgetNew(Class *cl, Object *o, Msg msg) o = NULL; } - return (ULONG) o; + return (IPTR) o; } //---------------------------------------------------------------------------- @@ -403,25 +403,25 @@ static ULONG HistoryGadgetGet(Class *cl, Object *o, Msg msg) switch (opg->opg_AttrID) { case GA_Left: // required since gadgetclass attribute is [IS] - no support for [G] - *(opg->opg_Storage) = (ULONG) gg->LeftEdge; + *(opg->opg_Storage) = (IPTR) gg->LeftEdge; break; case GA_Top: // required since gadgetclass attribute is [IS] - no support for [G] - *(opg->opg_Storage) = (ULONG) gg->TopEdge; + *(opg->opg_Storage) = (IPTR) gg->TopEdge; break; case GA_Width: // required since gadgetclass attribute is [IS] - no support for [G] - *(opg->opg_Storage) = (ULONG) gg->Width; + *(opg->opg_Storage) = (IPTR) gg->Width; break; case GA_Height: // required since gadgetclass attribute is [IS] - no support for [G] - *(opg->opg_Storage) = (ULONG) gg->Height; + *(opg->opg_Storage) = (IPTR) gg->Height; break; case SCAHISTORY_Active: - *(opg->opg_Storage) = (ULONG) inst->hgi_Active; + *(opg->opg_Storage) = (IPTR) inst->hgi_Active; break; case SCAHISTORY_Labels: - *(opg->opg_Storage) = (ULONG) inst->hgi_Entries; + *(opg->opg_Storage) = (IPTR) inst->hgi_Entries; break; case GBDTA_Hidden: - *(opg->opg_Storage) = (ULONG) inst->hgi_Hidden; + *(opg->opg_Storage) = (IPTR) inst->hgi_Hidden; break; default: Result = DoSuperMethodA(cl, o, msg); @@ -480,7 +480,7 @@ static ULONG HistoryGadgetLayout(Class *cl, Object *o, Msg msg) // get dimensions of History popup image(s) if (inst->hgi_HistoryImage) { - ULONG Width = 0, Height = 0; + IPTR Width = 0, Height = 0; GetAttr(IA_Width, inst->hgi_HistoryImage, &Width); GetAttr(IA_Height, inst->hgi_HistoryImage, &Height); @@ -622,7 +622,7 @@ static ULONG HistoryGadgetHelpTest(Class *cl, Object *o, Msg msg) // x, y are already relative to the Gadget position (0,0) is top left corner! static BOOL HistoryGadgetPointInGadget(Object *o, WORD x, WORD y) { - ULONG Width, Height; + IPTR Width, Height; GetAttr(GA_Width, o, &Width); GetAttr(GA_Height, o, &Height); @@ -726,7 +726,7 @@ static ULONG HistoryGadgetHandleInput(Class *cl, Object *o, Msg msg) d1(KPrintF("%s/%s/%ld: hgi_Active=%ld\n", __FILE__, __FUNC__, __LINE__, inst->hgi_Active)); - *gpi->gpi_Termination = (ULONG) inst->hgi_Active; + *gpi->gpi_Termination = (IPTR) inst->hgi_Active; Result = GMR_NOREUSE | GMR_VERIFY; } else @@ -978,8 +978,8 @@ static void HistoryGadgetOpenPopupWindow(struct ScaWindowTask *wt, APTR arg) struct HistoryGadgetInstance *inst = INST_DATA(cl, o); ULONG Left, Top; ULONG Width, Height; - ULONG GadgetLeft, GadgetTop, GadgetHeight; - ULONG checkWidth = 0, checkHeight = 0; + IPTR GadgetLeft, GadgetTop, GadgetHeight; + IPTR checkWidth = 0, checkHeight = 0; struct Node *ln; struct RastPort rp; @@ -1181,7 +1181,7 @@ static void HistoryGadgetPopupDrawWindowLine(struct ScaWindowTask *wt, APTR arg) size_t EntryLength; LONG x, y; struct Rectangle LineRect; - ULONG checkWidth; + IPTR checkWidth; ULONG Width; GetAttr(IA_Width, inst->hgi_CheckImage, &checkWidth); @@ -1247,7 +1247,7 @@ static void HistoryGadgetPopupDrawWindowLine(struct ScaWindowTask *wt, APTR arg) if (ln == inst->hgi_Active) { // for currently active line, draw checkmark - ULONG checkHeight; + IPTR checkHeight; GetAttr(IA_Height, inst->hgi_CheckImage, &checkHeight); diff --git a/scalos/main/IconImageClass.c b/scalos/main/IconImageClass.c index 4bf71425b..0b0ef447c 100644 --- a/scalos/main/IconImageClass.c +++ b/scalos/main/IconImageClass.c @@ -59,7 +59,7 @@ struct IconImageINST //---------------------------------------------------------------------------- // The functions in this module -static SAVEDS(ULONG) INTERRUPT dispatchIconImageClass(Class *cl, Object *o, Msg msg); +static SAVEDS(IPTR) INTERRUPT dispatchIconImageClass(Class *cl, Object *o, Msg msg); static BOOL InitIconImage(struct IconImageINST *inst, const struct opSet *ops, const struct Image *NewImage); static void DisposeIconImage(struct IconImageINST *inst); static void DrawIconImage(struct IconImageINST *inst, struct impDraw *Msg, struct Image *myImage); @@ -111,10 +111,10 @@ BOOL freeIconImageClass( Class *cl ) /**************************************************************************/ /********** The IconImageCLASS class dispatcher *********/ /**************************************************************************/ -static SAVEDS(ULONG) INTERRUPT dispatchIconImageClass(Class *cl, Object *o, Msg msg) +static SAVEDS(IPTR) INTERRUPT dispatchIconImageClass(Class *cl, Object *o, Msg msg) { struct IconImageINST *inst; - ULONG retval = 0l; + IPTR retval = 0l; Object *object; d1(kprintf("%s/%s/%ld: Class=%l08x SuperClass=%08lx Method=%08lx\n", __FILE__, __FUNC__, __LINE__, cl, cl->cl_Super, msg->MethodID)); @@ -138,7 +138,7 @@ static SAVEDS(ULONG) INTERRUPT dispatchIconImageClass(Class *cl, Object *o, Msg object = NULL; } - retval = (ULONG) object; + retval = (IPTR) object; d1(kprintf("OM_NEW: object=%08lx inst=%08lx\n", object, inst)); } break; @@ -177,9 +177,9 @@ static SAVEDS(ULONG) INTERRUPT dispatchIconImageClass(Class *cl, Object *o, Msg static BOOL InitIconImage(struct IconImageINST *inst, const struct opSet *ops, const struct Image *NewImage) { - memset(inst, 0, sizeof(inst)); + memset(inst, 0, sizeof(struct IconImageINST)); - inst->sii_IconObject = (APTR) GetTagData(ICI_IconObj, (ULONG) NULL, ops->ops_AttrList); + inst->sii_IconObject = (APTR) GetTagData(ICI_IconObj, (IPTR) NULL, ops->ops_AttrList); if (NULL == inst->sii_IconObject) return FALSE; diff --git a/scalos/main/IconWindowClass.c b/scalos/main/IconWindowClass.c index 6b50bec0f..bedfa5052 100755 --- a/scalos/main/IconWindowClass.c +++ b/scalos/main/IconWindowClass.c @@ -83,7 +83,7 @@ struct IconListNode static SAVEDS(ULONG) IconWindowClass_Dispatcher(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_ReadIconList(Class *cl, Object *o, Msg msg); -static ULONG IconWindowClass_ReadIcon(Class *cl, Object *o, Msg msg); +static IPTR IconWindowClass_ReadIcon(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_Message(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_ScheduleUpdate(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_ShowIconToolTip(Class *cl, Object *o, Msg msg); @@ -95,12 +95,12 @@ static ULONG IconWindowClass_DragLeave(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_DragDrop(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_Set(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_Get(Class *cl, Object *o, Msg msg); -static ULONG IconWindowClass_New(Class *cl, Object *o, Msg msg); +static IPTR IconWindowClass_New(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_Dispose(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_Open(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_UpdateIcon(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_UpdateIconTags(Class *cl, Object *o, Msg msg); -static ULONG IconWindowClass_AddIcon(Class *cl, Object *o, Msg msg); +static IPTR IconWindowClass_AddIcon(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_RemIcon(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_MakeWbArg(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_CountWbArg(Class *cl, Object *o, Msg msg); @@ -112,9 +112,9 @@ static ULONG IconWindowClass_DrawIcon(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_LayoutIcon(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_Ping(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_RawKey(Class *cl, Object *o, Msg msg); -static ULONG IconWindowClass_GetDefIcon(Class *cl, Object *o, Msg msg); +static IPTR IconWindowClass_GetDefIcon(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_MenuCommand(Class *cl, Object *o, Msg msg); -static ULONG IconWindowClass_NewViewMode(Class *cl, Object *o, Msg msg); +static IPTR IconWindowClass_NewViewMode(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_DeltaMove(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_UnCleanup(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_UnCleanupRegion(Class *cl, Object *o, Msg msg); @@ -152,7 +152,7 @@ static ULONG IconWindowClass_Browse(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_StartPopOpenTimer(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_StopPopOpenTimer(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_AddUndoEvent(Class *cl, Object *o, Msg msg); -static ULONG IconWindowClass_BeginUndoStep(Class *cl, Object *o, Msg msg); +static IPTR IconWindowClass_BeginUndoStep(Class *cl, Object *o, Msg msg); static ULONG IconWindowClass_EndUndoStep(Class *cl, Object *o, Msg msg); static SAVEDS(ULONG) IconWinBrowseProc(APTR aptr, struct SM_RunProcess *msg); @@ -554,14 +554,14 @@ static ULONG IconWindowClass_ReadIconList(Class *cl, Object *o, Msg msg) } -static ULONG IconWindowClass_ReadIcon(Class *cl, Object *o, Msg msg) +static IPTR IconWindowClass_ReadIcon(Class *cl, Object *o, Msg msg) { struct internalScaWindowTask *iwt = (struct internalScaWindowTask *) ((struct ScaRootList *) o)->rl_WindowTask; struct msg_ReadIcon *mri = (struct msg_ReadIcon *) msg; d1(kprintf("%s/%s/%ld: wt_Window=%08lx\n", __FILE__, __FUNC__, __LINE__, iwt->iwt_WindowTask.wt_Window)); - return (ULONG) IconWindowReadIcon(iwt, mri->mri_Name, mri->mri_ria); + return (IPTR) IconWindowReadIcon(iwt, mri->mri_Name, mri->mri_ria); } @@ -848,7 +848,7 @@ static ULONG IconWindowClass_RawKey(Class *cl, Object *o, Msg msg) if (Actual > 0) { - ULONG fTyping = FALSE; + IPTR fTyping = FALSE; KeyBuffer[Actual] = '\0'; @@ -1012,8 +1012,8 @@ static ULONG IconWindowClass_Set(Class *cl, Object *o, Msg msg) if (NULL == iwt->iwt_StatusBarMembers[STATUSBARGADGET_Reading]) { iwt->iwt_StatusBarMembers[STATUSBARGADGET_Reading] = (struct Gadget *) SCA_NewScalosObjectTags("GadgetBarImage.sca", - DTA_Name, (ULONG) "THEME:Window/StatusBar/Reading", - GBIDTA_WindowTask, (ULONG) iwt, + DTA_Name, (IPTR) "THEME:Window/StatusBar/Reading", + GBIDTA_WindowTask, (IPTR) iwt, GA_ID, SBAR_GadgetID_Reading, TAG_END); @@ -1050,8 +1050,8 @@ static ULONG IconWindowClass_Set(Class *cl, Object *o, Msg msg) if (NULL == iwt->iwt_StatusBarMembers[STATUSBARGADGET_Typing]) { iwt->iwt_StatusBarMembers[STATUSBARGADGET_Typing] = (struct Gadget *) SCA_NewScalosObjectTags("GadgetBarImage.sca", - DTA_Name, (ULONG) "THEME:Window/StatusBar/Typing", - GBIDTA_WindowTask, (ULONG) iwt, + DTA_Name, (IPTR) "THEME:Window/StatusBar/Typing", + GBIDTA_WindowTask, (IPTR) iwt, GA_ID, SBAR_GadgetID_Typing, TAG_END); @@ -1145,7 +1145,7 @@ static ULONG IconWindowClass_Get(Class *cl, Object *o, Msg msg) switch (opg->opg_AttrID) { case SCCA_IconWin_IconSizeConstraints: - *opg->opg_Storage = (ULONG) &iwt->iwt_WindowTask.mt_WindowStruct->ws_IconSizeConstraints; + *opg->opg_Storage = (IPTR) &iwt->iwt_WindowTask.mt_WindowStruct->ws_IconSizeConstraints; break; case SCCA_IconWin_IconScaleFactor: @@ -1197,23 +1197,23 @@ static ULONG IconWindowClass_Get(Class *cl, Object *o, Msg msg) break; case SCCA_IconWin_IconFont: - *opg->opg_Storage = (ULONG) iwt->iwt_IconFont; + *opg->opg_Storage = (IPTR) iwt->iwt_IconFont; break; case SCCA_IconWin_LayersLocked: - *opg->opg_Storage = (ULONG) iwt->iwt_LockFlag; + *opg->opg_Storage = (IPTR) iwt->iwt_LockFlag; break; case SCCA_IconWin_ThumbnailView: - *opg->opg_Storage = (ULONG) iwt->iwt_ThumbnailMode; + *opg->opg_Storage = (IPTR) iwt->iwt_ThumbnailMode; break; case SCCA_IconWin_ThumbnailsGenerating: - *opg->opg_Storage = (ULONG) iwt->iwt_ThumbnailGenerationPending; + *opg->opg_Storage = (IPTR) iwt->iwt_ThumbnailGenerationPending; break; case SCCA_IconWin_ControlBar: - *opg->opg_Storage = (ULONG) !(iwt->iwt_WindowTask.mt_WindowStruct->ws_MoreFlags & WSV_MoreFlagF_NoControlBar); + *opg->opg_Storage = (IPTR) !(iwt->iwt_WindowTask.mt_WindowStruct->ws_MoreFlags & WSV_MoreFlagF_NoControlBar); break; default: @@ -1226,7 +1226,7 @@ static ULONG IconWindowClass_Get(Class *cl, Object *o, Msg msg) //---------------------------------------------------------------------------- -static ULONG IconWindowClass_New(Class *cl, Object *o, Msg msg) +static IPTR IconWindowClass_New(Class *cl, Object *o, Msg msg) { struct internalScaWindowTask *iwt; @@ -1262,7 +1262,7 @@ static ULONG IconWindowClass_New(Class *cl, Object *o, Msg msg) DoMethod(o, SCCM_IconWin_StartNotify); } - return (ULONG) o; + return (IPTR) o; } //---------------------------------------------------------------------------- @@ -1375,7 +1375,7 @@ static ULONG IconWindowClass_UpdateIconTags(Class *cl, Object *o, Msg msg) //---------------------------------------------------------------------------- -static ULONG IconWindowClass_AddIcon(Class *cl, Object *o, Msg msg) +static IPTR IconWindowClass_AddIcon(Class *cl, Object *o, Msg msg) { //struct internalScaWindowTask *iwt = (struct internalScaWindowTask *) ((struct ScaRootList *) o)->rl_WindowTask; struct msg_AddIcon *mai = (struct msg_AddIcon *) msg; @@ -1404,7 +1404,7 @@ static ULONG IconWindowClass_AddIcon(Class *cl, Object *o, Msg msg) CurrentDir(oldDir); - return (ULONG) in; + return (IPTR) in; } //---------------------------------------------------------------------------- @@ -1499,7 +1499,7 @@ static ULONG IconWindowClass_MakeWbArg(Class *cl, Object *o, Msg msg) if (mwa->mwa_Icon) { - ULONG IconType; + IPTR IconType; GetAttr(IDTA_Type, mwa->mwa_Icon->in_Icon, &IconType); @@ -1616,7 +1616,7 @@ static ULONG IconWindowClass_CountWbArg(Class *cl, Object *o, Msg msg) if (mca->mca_Icon) { - ULONG IconType; + IPTR IconType; GetAttr(IDTA_Type, mca->mca_Icon->in_Icon, &IconType); @@ -1956,7 +1956,7 @@ static ULONG IconWindowClass_Ping(Class *cl, Object *o, Msg msg) //---------------------------------------------------------------------------- -static ULONG IconWindowClass_GetDefIcon(Class *cl, Object *o, Msg msg) +static IPTR IconWindowClass_GetDefIcon(Class *cl, Object *o, Msg msg) { struct internalScaWindowTask *iwt = (struct internalScaWindowTask *) ((struct ScaRootList *) o)->rl_WindowTask; struct msg_GetDefIcon *mgd = (struct msg_GetDefIcon *) msg; @@ -1970,15 +1970,15 @@ static ULONG IconWindowClass_GetDefIcon(Class *cl, Object *o, Msg msg) IconObj = SCA_GetDefIconObjectTags(iwt->iwt_WindowTask.mt_WindowStruct->ws_Lock, mgd->mgd_Name, - IDTA_Text, (ULONG) mgd->mgd_Name, -// DTA_Name, (ULONG) mgd->mgd_Name, + IDTA_Text, (IPTR) mgd->mgd_Name, +// DTA_Name, (IPTR) mgd->mgd_Name, IDTA_Type, mgd->mgd_IconType, IDTA_HalfShinePen, PalettePrefs.pal_PensList[PENIDX_HSHINEPEN], IDTA_HalfShadowPen, PalettePrefs.pal_PensList[PENIDX_HSHADOWPEN], IDTA_FrameTypeSel, CurrentPrefs.pref_FrameTypeSel, IDTA_FrameType, CurrentPrefs.pref_FrameType, IDTA_TextSkip, CurrentPrefs.pref_TextSkip, - IDTA_MultiLineText, (ULONG) CurrentPrefs.pref_IconTextMuliLine, + IDTA_MultiLineText, (IPTR) CurrentPrefs.pref_IconTextMuliLine, IDTA_TextPen, PalettePrefs.pal_PensList[PENIDX_ICONTEXTPEN], IDTA_TextPenSel, PalettePrefs.pal_PensList[PENIDX_ICONTEXTPENSEL], IDTA_TextPenShadow, PalettePrefs.pal_PensList[PENIDX_ICONTEXTSHADOWPEN], @@ -1992,10 +1992,10 @@ static ULONG IconWindowClass_GetDefIcon(Class *cl, Object *o, Msg msg) IDTA_TextDrawMode, FontPrefs.fprf_TextDrawMode, IDTA_TextBackPen, FontPrefs.fprf_FontBackPen, IDTA_TextStyle, FS_NORMAL, - IDTA_Font, (ULONG) iwt->iwt_IconFont, - IDTA_Fonthandle, (ULONG) &iwt->iwt_IconTTFont, - IDTA_FontHook, (ULONG) (TTEngineBase ? &ScalosFontHook : NULL), - IDTA_SizeConstraints, (ULONG) &iwt->iwt_WindowTask.mt_WindowStruct->ws_IconSizeConstraints, + IDTA_Font, (IPTR) iwt->iwt_IconFont, + IDTA_Fonthandle, (IPTR) &iwt->iwt_IconTTFont, + IDTA_FontHook, (IPTR) (TTEngineBase ? &ScalosFontHook : NULL), + IDTA_SizeConstraints, (IPTR) &iwt->iwt_WindowTask.mt_WindowStruct->ws_IconSizeConstraints, IDTA_ScalePercentage, iwt->iwt_WindowTask.mt_WindowStruct->ws_IconScaleFactor, TAG_END); @@ -2010,13 +2010,13 @@ static ULONG IconWindowClass_GetDefIcon(Class *cl, Object *o, Msg msg) // otherwise the taglist contains DTA_Name twice, first with deficon name, // and second with mgd->mgd_Name ! SetAttrs(IconObj, - DTA_Name, (ULONG) mgd->mgd_Name, + DTA_Name, (IPTR) mgd->mgd_Name, TAG_END); gg->LeftEdge = gg->TopEdge = NO_ICON_POSITION_SHORT; } - return (ULONG) IconObj; + return (IPTR) IconObj; } //---------------------------------------------------------------------------- @@ -2092,12 +2092,12 @@ static ULONG IconWindowClass_MenuCommand(Class *cl, Object *o, Msg msg) //---------------------------------------------------------------------------- -static ULONG IconWindowClass_NewViewMode(Class *cl, Object *o, Msg msg) +static IPTR IconWindowClass_NewViewMode(Class *cl, Object *o, Msg msg) { struct internalScaWindowTask *iwt = (struct internalScaWindowTask *) ((struct ScaRootList *) o)->rl_WindowTask; struct msg_NewViewMode *mnv = (struct msg_NewViewMode *) msg; struct ScaWindowStruct *ws = iwt->iwt_WindowTask.mt_WindowStruct; - ULONG Result = 0; + IPTR Result = 0; d1(KPrintF("%s/%s/%ld: iwt=%08lx <%s>\n", __FILE__, __FUNC__, __LINE__, iwt, iwt->iwt_WinTitle)); @@ -2115,8 +2115,8 @@ static ULONG IconWindowClass_NewViewMode(Class *cl, Object *o, Msg msg) else ws->ms_ClassName = (STRPTR) "TextWindow.sca"; - Result = (ULONG) SCA_NewScalosObjectTags(ws->ms_ClassName, - SCCA_WindowTask, (ULONG) iwt, + Result = (IPTR) SCA_NewScalosObjectTags(ws->ms_ClassName, + SCCA_WindowTask, (IPTR) iwt, TAG_END); ScalosReleaseSemaphore(&iwt->iwt_UpdateSemaphore); @@ -2475,8 +2475,8 @@ static ULONG IconWindowClass_AddToStatusBar(Class *cl, Object *o, Msg msg) DoGadgetMethod(iwt->iwt_StatusBar, iwt->iwt_WindowTask.wt_Window, NULL, OM_ADDMEMBER, NULL, - (ULONG) mab->mab_NewMember, - (ULONG) mab->mab_TagList); + (IPTR) mab->mab_NewMember, + (IPTR) mab->mab_TagList); if (iwt->iwt_WindowTask.wt_Window) RefreshGList(iwt->iwt_StatusBar, iwt->iwt_WindowTask.wt_Window, NULL, 1); @@ -2499,7 +2499,7 @@ static ULONG IconWindowClass_RemFromStatusBar(Class *cl, Object *o, Msg msg) DoGadgetMethod(iwt->iwt_StatusBar, iwt->iwt_WindowTask.wt_Window, NULL, OM_REMMEMBER, NULL, - (ULONG) mrb->mrb_OldMember); + (IPTR) mrb->mrb_OldMember); if (iwt->iwt_WindowTask.wt_Window) RefreshGList(iwt->iwt_StatusBar, iwt->iwt_WindowTask.wt_Window, NULL, 1); @@ -2526,7 +2526,7 @@ static ULONG IconWindowClass_UpdateStatusBar(Class *cl, Object *o, Msg msg) iwt->iwt_WindowTask.wt_Window, NULL, GBCL_UPDATEMEMBER, NULL, // GadgetInfo gets filled in here by DoGadgetMethod() - (ULONG) mub->mub_Member, + (IPTR) mub->mub_Member, NULL); } @@ -2547,8 +2547,8 @@ static ULONG IconWindowClass_AddToControlBar(Class *cl, Object *o, Msg msg) DoGadgetMethod(iwt->iwt_ControlBar, iwt->iwt_WindowTask.wt_Window, NULL, OM_ADDMEMBER, NULL, - (ULONG) mab->mab_NewMember, - (ULONG) mab->mab_TagList); + (IPTR) mab->mab_NewMember, + (IPTR) mab->mab_TagList); if (iwt->iwt_WindowTask.wt_Window) RefreshGList(iwt->iwt_ControlBar, iwt->iwt_WindowTask.wt_Window, NULL, 1); @@ -2571,7 +2571,7 @@ static ULONG IconWindowClass_RemFromControlBar(Class *cl, Object *o, Msg msg) DoGadgetMethod(iwt->iwt_ControlBar, iwt->iwt_WindowTask.wt_Window, NULL, OM_REMMEMBER, NULL, - (ULONG) mrb->mrb_OldMember); + (IPTR) mrb->mrb_OldMember); if (iwt->iwt_WindowTask.wt_Window) RefreshGList(iwt->iwt_ControlBar, iwt->iwt_WindowTask.wt_Window, NULL, 1); @@ -2598,7 +2598,7 @@ static ULONG IconWindowClass_UpdateControlBar(Class *cl, Object *o, Msg msg) iwt->iwt_WindowTask.wt_Window, NULL, GBCL_UPDATEMEMBER, NULL, // GadgetInfo gets filled in here by DoGadgetMethod() - (ULONG) mub->mub_Member, + (IPTR) mub->mub_Member, NULL); } @@ -2784,10 +2784,10 @@ static ULONG IconWindowClass_GetIconFileType(Class *cl, Object *o, Msg msg) if (!IS_TYPENODE(mft->mft_IconNode->in_FileType)) { - if (mft->mft_IconNode->in_Flags & INF_TextIcon) - GetAttr(TIDTA_TypeNode, mft->mft_IconNode->in_Icon, (ULONG *) &mft->mft_IconNode->in_FileType); - else - GetAttr(IDTA_Type, mft->mft_IconNode->in_Icon, (ULONG *) &mft->mft_IconNode->in_FileType); + if (mft->mft_IconNode->in_Flags & INF_TextIcon) + GetAttr(TIDTA_TypeNode, mft->mft_IconNode->in_Icon, (IPTR *)&mft->mft_IconNode->in_FileType); + else + GetAttr(IDTA_Type, mft->mft_IconNode->in_Icon, (IPTR *)&mft->mft_IconNode->in_FileType); } d1(KPrintF("%s/%s/%ld: in_FileType=%08lx in_Lock=%08lx\n", __FILE__, __FUNC__, __LINE__, mft->mft_IconNode->in_FileType, mft->mft_IconNode->in_Lock)); @@ -2818,7 +2818,7 @@ static ULONG IconWindowClass_GetIconFileType(Class *cl, Object *o, Msg msg) d1(KPrintF("%s/%s/%ld: in_FileType=%08lx\n", __FILE__, __FUNC__, __LINE__, mft->mft_IconNode->in_FileType)); - switch ((ULONG) mft->mft_IconNode->in_FileType) + switch ((IPTR)mft->mft_IconNode->in_FileType) { case WBDRAWER: case WB_TEXTICON_DRAWER: @@ -2883,9 +2883,9 @@ static ULONG IconWindowClass_ClearIconFileTypes(Class *cl, Object *o, Msg msg) for (in = iwt->iwt_WindowTask.wt_IconList; in; in = (struct ScaIconNode *) in->in_Node.mln_Succ) { - ULONG IconType; + IPTR IconType; - switch ((ULONG) in->in_FileType) + switch ((IPTR) in->in_FileType) { case WBTOOL: case WBPROJECT: @@ -2901,9 +2901,9 @@ static ULONG IconWindowClass_ClearIconFileTypes(Class *cl, Object *o, Msg msg) } for (in = iwt->iwt_WindowTask.wt_LateIconList; in; in = (struct ScaIconNode *) in->in_Node.mln_Succ) { - ULONG IconType; + IPTR IconType; - switch ((ULONG) in->in_FileType) + switch ((IPTR) in->in_FileType) { case WBTOOL: case WBPROJECT: @@ -3213,7 +3213,7 @@ static ULONG IconWindowClass_NewPath(Class *cl, Object *o, Msg msg) d1(KPrintF("%s/%s/%ld: isRootWindow=%ld ws_Flags=%08lx\n", __FILE__, __FUNC__, __LINE__, isRootWindow, ws->ws_Flags)); SetAttrs(iwt->iwt_TitleObject, - SCCA_Title_Format, (ULONG) (ws->ws_Title ? ws->ws_Title : (STRPTR) "Scalos"), + SCCA_Title_Format, (IPTR) (ws->ws_Title ? ws->ws_Title : (STRPTR) "Scalos"), TAG_END); iwt->iwt_WinTitle = (STRPTR) DoMethod(iwt->iwt_TitleObject, SCCM_Title_Generate); DoMethod(iwt->iwt_WindowTask.mt_WindowObject, SCCM_Window_SetTitle, iwt->iwt_WinTitle); @@ -3224,7 +3224,7 @@ static ULONG IconWindowClass_NewPath(Class *cl, Object *o, Msg msg) iwpNew.iwp_ShowAll = GetTagData(SCA_ShowAllMode, iwpNew.iwp_ShowAll, (struct TagItem *) npa->npa_TagList); iwpNew.iwp_OpacityActive = GetTagData(SCA_TransparencyActive, iwpNew.iwp_OpacityActive, (struct TagItem *) npa->npa_TagList); iwpNew.iwp_OpacityInactive = GetTagData(SCA_TransparencyInactive, iwpNew.iwp_OpacityInactive, (struct TagItem *) npa->npa_TagList); - newIconList = (struct ScaIconNode *) GetTagData(SCA_IconList, (ULONG) newIconList, (struct TagItem *) npa->npa_TagList); + newIconList = (struct ScaIconNode *) GetTagData(SCA_IconList, (IPTR) newIconList, (struct TagItem *) npa->npa_TagList); d1(KPrintF("%s/%s/%ld: newIconList=%08lx\n", __FILE__, __FUNC__, __LINE__, newIconList)); @@ -3473,7 +3473,7 @@ static ULONG IconWindowClass_StartNotify(Class *cl, Object *o, Msg msg) inst->ici_NotifyReq->nr_stuff.nr_Msg.nr_Port = iwt->iwt_WindowTask.wt_IconPort; inst->ici_NotifyReq->nr_Flags = NRF_SEND_MESSAGE; - inst->ici_NotifyReq->nr_UserData = (ULONG)NULL; + inst->ici_NotifyReq->nr_UserData = (IPTR)NULL; if (!StartNotify(inst->ici_NotifyReq)) break; @@ -3566,9 +3566,9 @@ static ULONG IconWindowClass_AddUndoEvent(Class *cl, Object *o, Msg msg) //---------------------------------------------------------------------------- -static ULONG IconWindowClass_BeginUndoStep(Class *cl, Object *o, Msg msg) +static IPTR IconWindowClass_BeginUndoStep(Class *cl, Object *o, Msg msg) { - return (ULONG) UndoBeginStep(); + return (IPTR) UndoBeginStep(); } //---------------------------------------------------------------------------- @@ -3886,11 +3886,11 @@ static void ReLayoutIcons(struct internalScaWindowTask *iwt, struct ScaIconNode IDTA_TextMode, CurrentPrefs.pref_TextMode, IDTA_TextDrawMode, FontPrefs.fprf_TextDrawMode, IDTA_TextBackPen, FontPrefs.fprf_FontBackPen, - IDTA_Font, (ULONG) iwt->iwt_IconFont, - IDTA_Fonthandle, (ULONG) &iwt->iwt_IconTTFont, - IDTA_FontHook, (ULONG) (TTEngineBase ? &ScalosFontHook : NULL), - TIDTA_Font, (ULONG) iwt->iwt_IconFont, - TIDTA_TTFont, (ULONG) &iwt->iwt_IconTTFont, + IDTA_Font, (IPTR) iwt->iwt_IconFont, + IDTA_Fonthandle, (IPTR) &iwt->iwt_IconTTFont, + IDTA_FontHook, (IPTR) (TTEngineBase ? &ScalosFontHook : NULL), + TIDTA_Font, (IPTR) iwt->iwt_IconFont, + TIDTA_TTFont, (IPTR) &iwt->iwt_IconTTFont, TAG_END); DoMethod(in->in_Icon, IDTM_Layout, @@ -4400,8 +4400,8 @@ static void SetShowType(struct internalScaWindowTask *iwt, ULONG newShowType) if (NULL == iwt->iwt_StatusBarMembers[STATUSBARGADGET_ShowAll]) { iwt->iwt_StatusBarMembers[STATUSBARGADGET_ShowAll] = (struct Gadget *) SCA_NewScalosObjectTags("GadgetBarImage.sca", - DTA_Name, (ULONG) "THEME:Window/StatusBar/ShowAll", - GBIDTA_WindowTask, (ULONG) iwt, + DTA_Name, (IPTR) "THEME:Window/StatusBar/ShowAll", + GBIDTA_WindowTask, (IPTR) iwt, GA_ID, SBAR_GadgetID_ShowAll, TAG_END); @@ -4482,7 +4482,7 @@ static void SetShowType(struct internalScaWindowTask *iwt, ULONG newShowType) // but keep all thumbnail icons for (in=iwt->iwt_WindowTask.wt_IconList; in; in=inNext) { - ULONG IconUserFlags; + IPTR IconUserFlags; inNext = (struct ScaIconNode *) in->in_Node.mln_Succ; @@ -4669,7 +4669,7 @@ static SAVEDS(LONG) IconSortBySizeFunc(struct Hook *hook, struct ScaIconNode *in static SAVEDS(LONG) IconSortByTypeFunc(struct Hook *hook, struct ScaIconNode *in2, struct ScaIconNode *in1) { - ULONG Type1, Type2; + IPTR Type1, Type2; d1(kprintf("%s/%s/%ld: in1=%08lx in2=%08lx\n", __FILE__, __FUNC__, __LINE__, in1, in2)); @@ -4750,8 +4750,8 @@ static void SetThumbnailView(struct internalScaWindowTask *iwt, ULONG NewThumbna if (GadgetName) { iwt->iwt_StatusBarMembers[STATUSBARGADGET_Thumbnails] = (struct Gadget *) SCA_NewScalosObjectTags("GadgetBarImage.sca", - DTA_Name, (ULONG) GadgetName, - GBIDTA_WindowTask, (ULONG) iwt, + DTA_Name, (IPTR) GadgetName, + GBIDTA_WindowTask, (IPTR) iwt, GA_ID, GadgetID, TAG_END); @@ -4779,8 +4779,8 @@ static void SetThumbnailsGenerating(struct internalScaWindowTask *iwt, BOOL Thum if (NULL == iwt->iwt_StatusBarMembers[STATUSBARGADGET_ThumbnailsGenerate]) { iwt->iwt_StatusBarMembers[STATUSBARGADGET_ThumbnailsGenerate] = (struct Gadget *) SCA_NewScalosObjectTags("GadgetBarImage.sca", - DTA_Name, (ULONG) "THEME:Window/StatusBar/ThumbnailsGenerate", - GBIDTA_WindowTask, (ULONG) iwt, + DTA_Name, (IPTR) "THEME:Window/StatusBar/ThumbnailsGenerate", + GBIDTA_WindowTask, (IPTR) iwt, GA_ID, SBAR_GadgetID_ThumbnailsGenerate, TAG_END); @@ -4816,7 +4816,7 @@ static void GetIconsTotalBoundingBox(struct internalScaWindowTask *iwt) ScalosLockIconListShared(iwt); - iwt->iwt_IconBBox.MinX = iwt->iwt_IconBBox.MinY = LONG_MAX; + iwt->iwt_IconBBox.MinX = iwt->iwt_IconBBox.MinY = INT_MAX; iwt->iwt_IconBBox.MaxX = iwt->iwt_IconBBox.MaxY = 0; for (in = iwt->iwt_WindowTask.wt_IconList; in; in = (const struct ScaIconNode *) in->in_Node.mln_Succ) diff --git a/scalos/main/IconWindow_MouseMove.c b/scalos/main/IconWindow_MouseMove.c index 559828d5a..61f74e205 100644 --- a/scalos/main/IconWindow_MouseMove.c +++ b/scalos/main/IconWindow_MouseMove.c @@ -351,7 +351,7 @@ void IDCMPDragMouseMove(struct internalScaWindowTask *iwt, struct IntuiMessage * case OUM_Icon: if (iwt->iwt_DragMayDrop && iwt->iwt_IconUnderPtr) { - ULONG IconType; + IPTR IconType; GetAttr(IDTA_Type, iwt->iwt_IconUnderPtr->in_Icon, &IconType); @@ -483,7 +483,7 @@ static LONG GetSourceDestScaSameLock(struct internalScaWindowTask *iwt) if (iwt->iwt_IconUnderPtr) { - ULONG IconType; + IPTR IconType; GetAttr(IDTA_Type, iwt->iwt_IconUnderPtr->in_Icon, &IconType); @@ -523,7 +523,7 @@ static LONG GetSourceDestScaSameLock(struct internalScaWindowTask *iwt) static BPTR GetIconLock(struct internalScaWindowTask *iwt, struct ScaIconNode *in) { BPTR iLock; - ULONG IconType; + IPTR IconType; GetAttr(IDTA_Type, in->in_Icon, &IconType); @@ -587,7 +587,7 @@ static ULONG DragMayCopy(struct internalScaWindowTask *iwt, ULONG Qualifier) { struct DragNode *dn; ULONG DrawDragFlags = 0l; - ULONG IconType; + IPTR IconType; BOOL isBackDropIcon = FALSE; DrawDragFlags &= ~(SCAF_Drag_IndicateCopy | SCAF_Drag_IndicateMakeLink | SCAF_Drag_ForceMove); diff --git a/scalos/main/IconifyClass.c b/scalos/main/IconifyClass.c index c17c985c1..a26b232fb 100755 --- a/scalos/main/IconifyClass.c +++ b/scalos/main/IconifyClass.c @@ -55,8 +55,8 @@ struct IconifyClassInst // local functions -static SAVEDS(ULONG) INTERRUPT IconifyClassDispatcher(Class *cl, Object *o, Msg msg); -static ULONG Iconify_New(Class *cl, Object *o, Msg msg); +static SAVEDS(IPTR) INTERRUPT IconifyClassDispatcher(Class *cl, Object *o, Msg msg); +static IPTR Iconify_New(Class *cl, Object *o, Msg msg); static ULONG Iconify_Draw(Class *cl, Object *o, Msg msg); static LONG RenderYPos(const struct Image *img, LONG MinY, LONG y); @@ -88,9 +88,9 @@ Class * initIconifyClass(void) } -static SAVEDS(ULONG) INTERRUPT IconifyClassDispatcher(Class *cl, Object *o, Msg msg) +static SAVEDS(IPTR) INTERRUPT IconifyClassDispatcher(Class *cl, Object *o, Msg msg) { - ULONG Result; + IPTR Result; switch (msg->MethodID) { @@ -111,7 +111,7 @@ static SAVEDS(ULONG) INTERRUPT IconifyClassDispatcher(Class *cl, Object *o, Msg } -static ULONG Iconify_New(Class *cl, Object *o, Msg msg) +static IPTR Iconify_New(Class *cl, Object *o, Msg msg) { o = (Object *) DoSuperMethodA(cl, o, msg); @@ -123,7 +123,7 @@ static ULONG Iconify_New(Class *cl, Object *o, Msg msg) img->Width = 25; } - return (ULONG) o; + return (IPTR) o; } diff --git a/scalos/main/InputHandler.c b/scalos/main/InputHandler.c index 706970acc..a9dc87b97 100644 --- a/scalos/main/InputHandler.c +++ b/scalos/main/InputHandler.c @@ -226,7 +226,7 @@ static BOOL PretestPopupMenu(const struct InputEvent *ie) if (inUnderPointer) { // Pointer is over icon - ULONG IconType; + IPTR IconType; GetAttr(IDTA_Type, inUnderPointer->in_Icon, &IconType); diff --git a/scalos/main/MainWait.c b/scalos/main/MainWait.c index 6b2842f87..53883b0ca 100755 --- a/scalos/main/MainWait.c +++ b/scalos/main/MainWait.c @@ -580,7 +580,7 @@ struct NotifyNode *AddToMainNotifyList(struct NotifyTab *nft, ULONG Flags) if (NULL == non) break; - non->non_NotifyRequest.nr_UserData = (ULONG) nft; + non->non_NotifyRequest.nr_UserData = (IPTR) nft; non->non_NotifyRequest.nr_Name = (STRPTR) nft->nft_FileName; non->non_NotifyRequest.nr_stuff.nr_Msg.nr_Port = iInfos.xii_iinfos.ii_MainMsgPort; non->non_NotifyRequest.nr_Flags = NRF_SEND_MESSAGE | Flags; diff --git a/scalos/main/Menu.c b/scalos/main/Menu.c index f60a7468c..58bc59041 100644 --- a/scalos/main/Menu.c +++ b/scalos/main/Menu.c @@ -63,7 +63,7 @@ struct ScalosMenuTreeX { - struct ScalosMenuTree *mtrx_Next; + struct SCALOS_MENUTREE *mtrx_Next; APTR mtrx_tree; UBYTE mtrx_TreeType; UBYTE mtrx_TreeFlags; @@ -205,11 +205,11 @@ static void SetIconMenuOnOff(struct internalScaWindowTask *iwt); static void SetWindowMenuOnOff(struct internalScaWindowTask *iwt); static void internalSetMenuOnOff(struct internalScaWindowTask *iwt, struct MenuInfo *mInfo, struct IconMenuSupports *MenuTable, ULONG MenuFlags); -static void GenerateMainMenu(struct ScalosMenuTree *mTree, struct NewMenu **nm, LONG Level); -static struct PopupMenu *GeneratePopupMenu(struct ScalosMenuChunk *MenuChunk, LONG Level); -static struct PopupMenu *BuildPopupMenu(struct ScalosMenuTree *mTree, LONG Level); -static struct PopupMenu *MakePopupMenuItem(struct ScalosMenuTree *mTree); -static void AddAddresses(struct ScalosMenuTree *MenuTree, const UBYTE *BaseAddr); +static void GenerateMainMenu(struct SCALOS_MENUTREE *mTree, struct NewMenu **nm, LONG Level); +static struct PopupMenu *GeneratePopupMenu(struct ScalosMenuChunk *MenuChunk, struct SCALOS_MENUTREE *AdjustedMenu, LONG Level); +static struct PopupMenu *BuildPopupMenu(struct SCALOS_MENUTREE *mTree, LONG Level); +static struct PopupMenu *MakePopupMenuItem(struct SCALOS_MENUTREE *mTree); +static void AddAddresses(struct ScalosMenuTree *srcTree, struct SCALOS_MENUTREE *MenuTree, const UBYTE *BaseAddr); static void ParseMenuItem(struct MenuItem *theItem, ULONG *MenuNumber, ULONG MenuNumIncrement); static void MenuFunc_ViewByIcon(struct internalScaWindowTask *iwt, struct MenuInfo *mInfo); static void MenuFunc_ViewByText(struct internalScaWindowTask *iwt, struct MenuInfo *mInfo); @@ -443,11 +443,11 @@ static void internalSetMenuOnOff(struct internalScaWindowTask *iwt, { if (ScalosAttemptSemaphoreShared(&MenuSema)) { - struct ScalosMenuTree *mTree; + struct SCALOS_MENUTREE *mTree; d1(kprintf("%s/%s/%ld: mItem=%08lx minf_type=%08lx\n", __FILE__, __FUNC__, __LINE__, mInfo->minf_item, mInfo->minf_type)); - mTree = (struct ScalosMenuTree *) GTMENUITEM_USERDATA(mInfo->minf_item); + mTree = (struct SCALOS_MENUTREE *) GTMENUITEM_USERDATA(mInfo->minf_item); d1(kprintf("%s/%s/%ld: mTree=%08lx\n", __FILE__, __FUNC__, __LINE__, mTree)); @@ -534,6 +534,9 @@ ULONG ReadMenuPrefs(void) ULONG Error; BOOL iffOpened = FALSE; struct ScalosMenuChunk *MenuChunk = NULL; +#if defined(__AROS__) && __WORDSIZE==64 + struct SCALOS_MENUTREE *AdjustedMenu = NULL; +#endif d1(KPrintF("\n" "%s/%s/%ld: Start\n", __FILE__, __FUNC__, __LINE__)); @@ -589,7 +592,8 @@ ULONG ReadMenuPrefs(void) if (MAKE_ID('M','E','N','U') != cn->cn_ID) continue; - MenuChunk = ScalosAlloc(cn->cn_Size); + MenuChunk = ScalosAlloc(cn->cn_Size); + if (NULL == MenuChunk) { Error = ERROR_NO_FREE_STORE; @@ -605,7 +609,19 @@ ULONG ReadMenuPrefs(void) MenuChunk->smch_MenuID = SCA_BE2WORD(MenuChunk->smch_MenuID); MenuChunk->smch_Entries = SCA_BE2WORD(MenuChunk->smch_Entries); - AddAddresses(MenuChunk->smch_Menu, (UBYTE *) MenuChunk); +#if defined(__AROS__) && __WORDSIZE==64 + AdjustedMenu = ScalosAlloc((cn->cn_Size << 1)); + if (NULL == AdjustedMenu) + { + ScalosFree(MenuChunk); + MenuChunk = NULL; + Error = ERROR_NO_FREE_STORE; + break; + } +#else +#define AdjustedMenu = MenuChunk->smch_Menu; +#endif + AddAddresses(MenuChunk->smch_Menu, AdjustedMenu, (UBYTE *) MenuChunk); switch (MenuChunk->smch_MenuID) { @@ -633,7 +649,7 @@ ULONG ReadMenuPrefs(void) break; } memset(MainNewMenu, 0, length); - GenerateMainMenu(MenuChunk->smch_Menu, &nm, 1); + GenerateMainMenu(AdjustedMenu, &nm, 1); if (GenerateList_ViewByIcon.smmx_NewMenu) { @@ -722,7 +738,7 @@ ULONG ReadMenuPrefs(void) case SCMID_Popup_Desktop: d1(KPrintF("%s/%s/%ld: smch_MenuID=%lu\n", __FILE__, __FUNC__, __LINE__, MenuChunk->smch_MenuID)); PopupMenuBuffer[MenuChunk->smch_MenuID] = MenuChunk; - PopupMenus[MenuChunk->smch_MenuID - 1] = GeneratePopupMenu(MenuChunk, MenuChunk->smch_MenuID - 1); + PopupMenus[MenuChunk->smch_MenuID - 1] = GeneratePopupMenu(MenuChunk, AdjustedMenu, MenuChunk->smch_MenuID - 1); MenuChunk = NULL; break; } @@ -730,6 +746,13 @@ ULONG ReadMenuPrefs(void) if (RETURN_OK != Error) break; +#if defined(__AROS__) && __WORDSIZE==64 + if (AdjustedMenu) + { + ScalosFree(AdjustedMenu); + AdjustedMenu = NULL; + } +#endif if (MenuChunk) { ScalosFree(MenuChunk); @@ -739,6 +762,10 @@ ULONG ReadMenuPrefs(void) } while (0); +#if defined(__AROS__) && __WORDSIZE==64 + if (AdjustedMenu) + ScalosFree(AdjustedMenu); +#endif if (MenuChunk) ScalosFree(MenuChunk); if (iffHandle) @@ -797,7 +824,7 @@ void FreeMenuPrefs(void) } -static void GenerateMainMenu(struct ScalosMenuTree *mTree, struct NewMenu **nm, LONG Level) +static void GenerateMainMenu(struct SCALOS_MENUTREE *mTree, struct NewMenu **nm, LONG Level) { ULONG Mask = 1; @@ -808,7 +835,7 @@ static void GenerateMainMenu(struct ScalosMenuTree *mTree, struct NewMenu **nm, { ULONG Flags; ULONG MutualExclude; - struct ScalosMenuTree *mTreeChild; + struct SCALOS_MENUTREE *mTreeChild; d1(kprintf("%s/%s/%ld: mTree=%08lx Type=%ld\n", __FILE__, __FUNC__, __LINE__, mTree, mTree->mtre_type)); @@ -976,7 +1003,7 @@ static void GenerateMainMenu(struct ScalosMenuTree *mTree, struct NewMenu **nm, } -static struct PopupMenu *GeneratePopupMenu(struct ScalosMenuChunk *MenuChunk, LONG Level) +static struct PopupMenu *GeneratePopupMenu(struct ScalosMenuChunk *MenuChunk, struct SCALOS_MENUTREE *AdjustedMenu, LONG Level) { d1(KPrintF("%s/%s/%ld: MenuChunk=%08lx Level=%ld\n", __FILE__, __FUNC__, __LINE__, MenuChunk, Level)); @@ -989,11 +1016,11 @@ static struct PopupMenu *GeneratePopupMenu(struct ScalosMenuChunk *MenuChunk, LO PopupMenuFlag = TRUE; - return BuildPopupMenu(MenuChunk->smch_Menu, Level); + return BuildPopupMenu(AdjustedMenu, Level); } -static struct PopupMenu *BuildPopupMenu(struct ScalosMenuTree *mTree, LONG Level) +static struct PopupMenu *BuildPopupMenu(struct SCALOS_MENUTREE *mTree, LONG Level) { struct TagItem *TagBuffer, *tbAlloc; struct PopupMenu *pm = NULL; @@ -1011,8 +1038,8 @@ static struct PopupMenu *BuildPopupMenu(struct ScalosMenuTree *mTree, LONG Level d1(KPrintF("%s/%s/%ld: Level >= 0\n", __FILE__, __FUNC__, __LINE__)); TagBuffer->ti_Tag = PM_Item; - TagBuffer->ti_Data = (ULONG) PM_MakeItem(PM_ID, PM_TITLE_ID, - PM_Title, (ULONG) GetLocString(MSGID_PMTITLE1NAME + Level), + TagBuffer->ti_Data = (IPTR) PM_MakeItem(PM_ID, PM_TITLE_ID, + PM_Title, (IPTR) GetLocString(MSGID_PMTITLE1NAME + Level), PM_NoSelect, TRUE, PM_ShinePen, TRUE, PM_Shadowed, FALSE, @@ -1025,7 +1052,7 @@ static struct PopupMenu *BuildPopupMenu(struct ScalosMenuTree *mTree, LONG Level MaxTagItem--; TagBuffer->ti_Tag = PM_Item; - TagBuffer->ti_Data = (ULONG) PM_MakeItem(PM_WideTitleBar, TRUE, + TagBuffer->ti_Data = (IPTR) PM_MakeItem(PM_WideTitleBar, TRUE, TAG_END); TagBuffer++; @@ -1037,7 +1064,7 @@ static struct PopupMenu *BuildPopupMenu(struct ScalosMenuTree *mTree, LONG Level while (mTree && MaxTagItem > 1) { TagBuffer->ti_Tag = PM_Item; - TagBuffer->ti_Data = (ULONG) MakePopupMenuItem(mTree); + TagBuffer->ti_Data = (IPTR) MakePopupMenuItem(mTree); d1(KPrintF("%s/%s/%ld: mTree=%08lx Next=%08lx\n", __FILE__, __FUNC__, __LINE__, mTree, mTree->mtre_Next)); @@ -1059,7 +1086,7 @@ static struct PopupMenu *BuildPopupMenu(struct ScalosMenuTree *mTree, LONG Level } -static struct PopupMenu *MakePopupMenuItem(struct ScalosMenuTree *mTree) +static struct PopupMenu *MakePopupMenuItem(struct SCALOS_MENUTREE *mTree) { struct PopupMenu *pm; @@ -1083,7 +1110,7 @@ static struct PopupMenu *MakePopupMenuItem(struct ScalosMenuTree *mTree) if (UnselectedIconName && strlen(UnselectedIconName) >= 1) { UnselectedImage = NewObject(DtImageClass, NULL, - DTIMG_ImageName, (ULONG) UnselectedIconName, + DTIMG_ImageName, (IPTR) UnselectedIconName, TAG_END); if (UnselectedImage) AddMenuImage(UnselectedImage); @@ -1091,7 +1118,7 @@ static struct PopupMenu *MakePopupMenuItem(struct ScalosMenuTree *mTree) if (SelectedIconName && strlen(SelectedIconName) >= 1) { SelectedImage = NewObject(DtImageClass, NULL, - DTIMG_ImageName, (ULONG) SelectedIconName, + DTIMG_ImageName, (IPTR) SelectedIconName, TAG_END); if (SelectedImage) AddMenuImage(SelectedImage); @@ -1102,11 +1129,11 @@ static struct PopupMenu *MakePopupMenuItem(struct ScalosMenuTree *mTree) if (mTree->mtre_tree && SCAMENUTYPE_Menu == mTree->mtre_type) { // Build Submenu - pm = PM_MakeItem(PM_Sub, (ULONG) BuildPopupMenu(mTree->mtre_tree, -1), + pm = PM_MakeItem(PM_Sub, (IPTR) BuildPopupMenu(mTree->mtre_tree, -1), PM_UserData, NULL, - PM_Title, (ULONG) mTree->MenuCombo.MenuTree.mtre_name, - UnselectedImage ? PM_IconUnselected : TAG_IGNORE, (ULONG) UnselectedImage, - SelectedImage ? PM_IconSelected : TAG_IGNORE, (ULONG) SelectedImage, + PM_Title, (IPTR) mTree->MenuCombo.MenuTree.mtre_name, + UnselectedImage ? PM_IconUnselected : TAG_IGNORE, (IPTR) UnselectedImage, + SelectedImage ? PM_IconSelected : TAG_IGNORE, (IPTR) SelectedImage, TAG_END); } else @@ -1116,7 +1143,7 @@ static struct PopupMenu *MakePopupMenuItem(struct ScalosMenuTree *mTree) if (mTree->mtre_tree && SCAMENUTYPE_Command == mTree->mtre_tree->mtre_type) { - struct ScalosMenuTree *subTree; + struct SCALOS_MENUTREE *subTree; UserData = mTree->mtre_tree; d1(KPrintF("%s/%s/%ld: mtre_tree=%08lx Next=%08lx\n", __FILE__, __FUNC__, __LINE__, mTree->mtre_tree, mTree->mtre_tree->mtre_Next)); @@ -1135,10 +1162,10 @@ static struct PopupMenu *MakePopupMenuItem(struct ScalosMenuTree *mTree) } d1(KPrintF("%s/%s/%ld: UserData=%08lx\n", __FILE__, __FUNC__, __LINE__, UserData)); - pm = PM_MakeItem(PM_UserData, (ULONG) UserData, - PM_Title, (ULONG) mTree->MenuCombo.MenuTree.mtre_name, - UnselectedImage ? PM_IconUnselected : TAG_IGNORE, (ULONG) UnselectedImage, - SelectedImage ? PM_IconSelected : TAG_IGNORE, (ULONG) SelectedImage, + pm = PM_MakeItem(PM_UserData, (IPTR) UserData, + PM_Title, (IPTR) mTree->MenuCombo.MenuTree.mtre_name, + UnselectedImage ? PM_IconUnselected : TAG_IGNORE, (IPTR) UnselectedImage, + SelectedImage ? PM_IconSelected : TAG_IGNORE, (IPTR) SelectedImage, PM_Bold, isDefaultCommand, TAG_END); } @@ -1155,30 +1182,29 @@ static struct PopupMenu *MakePopupMenuItem(struct ScalosMenuTree *mTree) return pm; } - -static void AddAddresses(struct ScalosMenuTree *MenuTree, const UBYTE *BaseAddr) +static void AddAddresses(struct ScalosMenuTree *srcTree, struct SCALOS_MENUTREE *MenuTree, const UBYTE *BaseAddr) { while (MenuTree) { if (SCAMENUTYPE_Command == MenuTree->mtre_type) { - MenuTree->MenuCombo.MenuCommand.mcom_name = (APTR) SCA_BE2LONG(MenuTree->MenuCombo.MenuCommand.mcom_name); + MenuTree->MenuCombo.MenuCommand.mcom_name = (APTR)0 + SCA_BE2LONG(srcTree->MenuCombo.MenuCommand.mcom_name); if (MenuTree->MenuCombo.MenuCommand.mcom_name) - MenuTree->MenuCombo.MenuCommand.mcom_name += (ULONG) BaseAddr; - MenuTree->MenuCombo.MenuCommand.mcom_stack = SCA_BE2LONG(MenuTree->MenuCombo.MenuCommand.mcom_stack); + MenuTree->MenuCombo.MenuCommand.mcom_name += (IPTR) BaseAddr; + MenuTree->MenuCombo.MenuCommand.mcom_stack = SCA_BE2LONG(srcTree->MenuCombo.MenuCommand.mcom_stack); } else { - MenuTree->MenuCombo.MenuTree.mtre_name = (APTR) SCA_BE2LONG(MenuTree->MenuCombo.MenuTree.mtre_name); + MenuTree->MenuCombo.MenuTree.mtre_name = (APTR)0 + SCA_BE2LONG(srcTree->MenuCombo.MenuTree.mtre_name); if (MenuTree->MenuCombo.MenuTree.mtre_name) - MenuTree->MenuCombo.MenuTree.mtre_name += (ULONG) BaseAddr; + MenuTree->MenuCombo.MenuTree.mtre_name += (IPTR) BaseAddr; if (MenuTree->mtre_flags & MTREFLGF_IconNames) { - MenuTree->MenuCombo.MenuTree.mtre_iconnames = (APTR) SCA_BE2LONG(MenuTree->MenuCombo.MenuTree.mtre_iconnames); + MenuTree->MenuCombo.MenuTree.mtre_iconnames = (APTR)0 + SCA_BE2LONG(srcTree->MenuCombo.MenuTree.mtre_iconnames); if (MenuTree->MenuCombo.MenuTree.mtre_iconnames) { - MenuTree->MenuCombo.MenuTree.mtre_iconnames += (ULONG) BaseAddr; + MenuTree->MenuCombo.MenuTree.mtre_iconnames += (IPTR) BaseAddr; } else { @@ -1190,16 +1216,16 @@ static void AddAddresses(struct ScalosMenuTree *MenuTree, const UBYTE *BaseAddr) MenuTree->MenuCombo.MenuTree.mtre_iconnames = NULL; } } - MenuTree->mtre_tree = (APTR) SCA_BE2LONG(MenuTree->mtre_tree); + MenuTree->mtre_tree = (APTR)0 + SCA_BE2LONG(srcTree->mtre_tree); if (MenuTree->mtre_tree) { - MenuTree->mtre_tree = (struct ScalosMenuTree *) (((UBYTE *) MenuTree->mtre_tree) + (ULONG) BaseAddr); - AddAddresses(MenuTree->mtre_tree, BaseAddr); + MenuTree->mtre_tree = (struct SCALOS_MENUTREE *) (((UBYTE *) MenuTree->mtre_tree) + (IPTR) BaseAddr); + AddAddresses(srcTree, MenuTree->mtre_tree, BaseAddr); } - MenuTree->mtre_Next = (APTR) SCA_BE2LONG(MenuTree->mtre_Next); + MenuTree->mtre_Next = (APTR)0 + SCA_BE2LONG(srcTree->mtre_Next); if (MenuTree->mtre_Next) { - MenuTree->mtre_Next = (struct ScalosMenuTree *) (((UBYTE *) MenuTree->mtre_Next) + (ULONG) BaseAddr); + MenuTree->mtre_Next = (struct SCALOS_MENUTREE *) (((UBYTE *) MenuTree->mtre_Next) + (IPTR) BaseAddr); } MenuTree = MenuTree->mtre_Next; } @@ -1278,7 +1304,7 @@ static void ParseMenuItem(struct MenuItem *theItem, ULONG *MenuNumber, ULONG Men { while (theItem) { - struct ScalosMenuTree *mtre = GTMENUITEM_USERDATA(theItem); + struct SCALOS_MENUTREE *mtre = GTMENUITEM_USERDATA(theItem); d1(kprintf("%s/%s/%ld: theItem=%08lx\n", __FILE__, __FUNC__, __LINE__, theItem)); diff --git a/scalos/main/MenuCommand.c b/scalos/main/MenuCommand.c index 97d079e4e..9bf74cb58 100644 --- a/scalos/main/MenuCommand.c +++ b/scalos/main/MenuCommand.c @@ -506,7 +506,7 @@ static void DoForAllIconsExclusive(struct internalScaWindowTask *iwt, void WBInfoStart(struct internalScaWindowTask *iwt, struct ScaIconNode *in, APTR undoStep) { - ULONG IconType; + IPTR IconType; d1(KPrintF("%s/%s/%ld: iwt=%08lx in=%08lx <%s>\n", __FILE__, __FUNC__, __LINE__, iwt, in, GetIconName(in))); @@ -1149,7 +1149,7 @@ void AsyncDeleteProg(struct internalScaWindowTask *iwt, const struct MenuCmdArg static void LeaveOutIcon(struct internalScaWindowTask *iwt, struct ScaIconNode *in, APTR undoStep) { - ULONG IconType = 0; + IPTR IconType = 0; d1(KPrintF("%s/%s/%ld: START iwt=%08lx <%s>\n", __FILE__, __FUNC__, __LINE__, iwt, iwt->iwt_WinTitle)); d1(KPrintF("%s/%s/%ld: Icon=<%s> Lock=%08lx\n", __FILE__, __FUNC__, __LINE__, IconName, in->in_Lock)); @@ -1193,7 +1193,7 @@ static void LeaveOutIcon(struct internalScaWindowTask *iwt, struct ScaIconNode * static void PutAwayIconNode(struct internalScaWindowTask *iwt, struct ScaIconNode *in, APTR undoStep) { - ULONG IconType = 0; + IPTR IconType = 0; d1(KPrintF("%s/%s/%ld: START iwt=%08lx <%s>\n", __FILE__, __FUNC__, __LINE__, iwt, iwt->iwt_WinTitle)); d1(KPrintF("%s/%s/%ld: Icon=<%s> Lock=%08lx\n", __FILE__, __FUNC__, __LINE__, GetIconName(in), in->in_Lock)); @@ -1337,7 +1337,7 @@ static void SnapshotWindow(struct internalScaWindowTask *iwt) SetAttrs(IconObj, IDTA_ViewModes, IconViewMode, IDTA_Flags, ddFlags, - IDTA_WindowRect, (ULONG) &WinRect, + IDTA_WindowRect, (IPTR) &WinRect, IDTA_WinCurrentY, ws->ws_yoffset, IDTA_WinCurrentX, ws->ws_xoffset, TAG_END); @@ -1743,7 +1743,7 @@ static void CloneProg(struct internalScaWindowTask *iwt, const struct MenuCmdArg if (mcArg->mca_IconNode) { - ULONG IconType; + IPTR IconType; GetAttr(IDTA_Type, mcArg->mca_IconNode->in_Icon, &IconType); @@ -1828,7 +1828,7 @@ static void CloneInfoStart(struct internalScaWindowTask *iwt, if (gg->Flags & GFLG_SELECTED) { - ULONG IconType; + IPTR IconType; GetAttr(IDTA_Type, in->in_Icon, &IconType); @@ -1910,7 +1910,7 @@ static SAVEDS(ULONG) CloneFilesStart(APTR aptr, struct SM_RunProcess *msg) break; fileTransObj = SCA_NewScalosObjectTags((STRPTR) "FileTransfer.sca", - SCCA_FileTrans_Screen, (ULONG) iInfos.xii_iinfos.ii_Screen, + SCCA_FileTrans_Screen, (IPTR) iInfos.xii_iinfos.ii_Screen, SCCA_FileTrans_Number, arg->cla_NumArgs, SCCA_FileTrans_ReplaceMode, SCCV_ReplaceMode_Ask, TAG_END); @@ -2339,7 +2339,7 @@ static SAVEDS(LONG) IconCompareFunc(struct Hook *hook, struct ScaIconNode *in2, static void MenuOpenProg(struct internalScaWindowTask *iwt, const struct MenuCmdArg *mcArg) { - ULONG IconType = 0; + IPTR IconType = 0; if (mcArg->mca_IconNode) GetAttr(IDTA_Type, mcArg->mca_IconNode->in_Icon, &IconType); @@ -2418,7 +2418,7 @@ static void OpenParentProg(struct internalScaWindowTask *iwt, const struct MenuC else { SCA_OpenIconWindowTags(SCA_Flags, SCAF_OpenWindow_ScalosPort, - SCA_Path, (ULONG) ParentName, + SCA_Path, (IPTR) ParentName, SCA_CheckOverlappingIcons, CurrentPrefs.pref_CheckOverlappingIcons, TAG_END); } @@ -2678,7 +2678,7 @@ static void MenuRedoProg(struct internalScaWindowTask *iwt, const struct MenuCmd static void SnapshotIcon(struct internalScaWindowTask *iwt, struct ScaIconNode *in, APTR undoStep) { - ULONG IconType = 0; + IPTR IconType = 0; d1(KPrintF("%s/%s/%ld: START iwt=%08lx in=%08lx <%s>\n", __FILE__, __FUNC__, __LINE__, iwt, in, GetIconName(in))); @@ -2752,7 +2752,7 @@ static void UnsnapshotIconAndSave(struct internalScaWindowTask *iwt, struct ScaI static void UnsnapshotIcon(struct internalScaWindowTask *iwt, struct ScaIconNode *in, BOOL SaveIcon, APTR undoStep) { - ULONG IconType = 0; + IPTR IconType = 0; d1(KPrintF("%s/%s/%ld: iwt=%08lx in=%08lx <%s>\n", __FILE__, __FUNC__, __LINE__, iwt, in, GetIconName(in))); @@ -2874,7 +2874,7 @@ void SetIconWindowRect(struct ScaIconNode *in) } else { - ULONG IconType = 0; + IPTR IconType = 0; GetAttr(IDTA_Type, in->in_Icon, &IconType); @@ -2937,7 +2937,7 @@ static void SetRect2(struct ScaIconNode *in, BPTR iconLock) SetAttrs(in->in_Icon, IDTA_ViewModes, IconViewMode, IDTA_Flags, ddFlags, - IDTA_WindowRect, (ULONG) &WinRect, + IDTA_WindowRect, (IPTR) &WinRect, IDTA_WinCurrentY, ws->ws_yoffset, IDTA_WinCurrentX, ws->ws_xoffset, TAG_END); @@ -3048,7 +3048,7 @@ static void EmptyTrashProg(struct internalScaWindowTask *iwt, const struct MenuC { if (mcArg->mca_IconNode) { - ULONG IconType; + IPTR IconType; GetAttr(IDTA_Type, mcArg->mca_IconNode->in_Icon, &IconType); @@ -3080,7 +3080,7 @@ static void EmptyTrashProg(struct internalScaWindowTask *iwt, const struct MenuC if (gg->Flags & GFLG_SELECTED) { - ULONG IconType; + IPTR IconType; GetAttr(IDTA_Type, in->in_Icon, &IconType); @@ -3160,7 +3160,7 @@ static void CloseWindowProg(struct internalScaWindowTask *iwt, const struct Menu static ULONG FindIconType(struct WBArg *Arg) { struct ScaWindowStruct *ws; - ULONG IconType = 0; + IPTR IconType = 0; BOOL Found = FALSE; SCA_LockWindowList(SCA_LockWindowList_Shared); @@ -3435,7 +3435,7 @@ static void AsyncPasteProg(struct internalScaWindowTask *iwt, const struct MenuC { BPTR parentDirLock; BPTR newLock = (BPTR)NULL; - ULONG IconType = 0; + IPTR IconType = 0; d1(kprintf("%s/%s/%ld: mca_IconNode=%08lx <%s>\n", __FILE__, __FUNC__, __LINE__, mcArg->mca_IconNode, GetIconName(mcArg->mca_IconNode))); @@ -3484,7 +3484,7 @@ static void AsyncPasteProg(struct internalScaWindowTask *iwt, const struct MenuC debugLock_d1(DestLock); fileTransObj = SCA_NewScalosObjectTags((STRPTR) "FileTransfer.sca", - SCCA_FileTrans_Screen, (ULONG) iInfos.xii_iinfos.ii_Screen, + SCCA_FileTrans_Screen, (IPTR) iInfos.xii_iinfos.ii_Screen, // SCCA_FileTrans_Number, ArgCount, SCCA_FileTrans_ReplaceMode, SCCV_ReplaceMode_Ask, TAG_END); @@ -3620,7 +3620,7 @@ static void RememberFilesToCut(struct internalScaWindowTask *iwt, struct ScaIcon { struct ScaIconNode inCopy; struct ScaIconNode *IconList = &inCopy; - ULONG UserFlags = 0L; + IPTR UserFlags = 0; (void) undoStep; @@ -4083,7 +4083,7 @@ static void CopyToCloneInfoStart(struct internalScaWindowTask *iwt, if (gg->Flags & GFLG_SELECTED) { - ULONG IconType; + IPTR IconType; GetAttr(IDTA_Type, in->in_Icon, &IconType); @@ -4194,7 +4194,7 @@ static void CopyToProg(struct internalScaWindowTask *iwt, const struct MenuCmdAr if (mcArg->mca_IconNode) { - ULONG IconType; + IPTR IconType; GetAttr(IDTA_Type, mcArg->mca_IconNode->in_Icon, &IconType); @@ -4263,8 +4263,8 @@ static SAVEDS(ULONG) CopyToStart(APTR aptr, struct SM_RunProcess *msg) // AllocAslRequest() dirReq = AllocAslRequestTags(ASL_FileRequest, ASLFR_PrivateIDCMP, TRUE, - ASLFR_Screen, (ULONG) iInfos.xii_iinfos.ii_Screen, - ASLFR_TitleText, (ULONG) GetLocString(MSGID_COPYTO_ASLTITLE), + ASLFR_Screen, (IPTR) iInfos.xii_iinfos.ii_Screen, + ASLFR_TitleText, (IPTR) GetLocString(MSGID_COPYTO_ASLTITLE), ASLFR_DoSaveMode, TRUE, ASLFR_DrawersOnly, TRUE, TAG_END); @@ -4274,7 +4274,7 @@ static SAVEDS(ULONG) CopyToStart(APTR aptr, struct SM_RunProcess *msg) // AslRequest() Success = AslRequestTags(dirReq, - ASLFR_InitialDrawer, (ULONG) Path, + ASLFR_InitialDrawer, (IPTR) Path, TAG_END); if (Success) @@ -4296,7 +4296,7 @@ static SAVEDS(ULONG) CopyToStart(APTR aptr, struct SM_RunProcess *msg) stccpy(LockdirName, dirReq->fr_Drawer, sizeof(LockdirName)); fileTransObj = SCA_NewScalosObjectTags((STRPTR) "FileTransfer.sca", - SCCA_FileTrans_Screen, (ULONG) iInfos.xii_iinfos.ii_Screen, + SCCA_FileTrans_Screen, (IPTR) iInfos.xii_iinfos.ii_Screen, SCCA_FileTrans_Number, arg->cla_NumArgs, SCCA_FileTrans_ReplaceMode, SCCV_ReplaceMode_Ask, TAG_END); @@ -4436,7 +4436,7 @@ static void MoveToCloneInfoStart(struct internalScaWindowTask *iwt, if (gg->Flags & GFLG_SELECTED) { - ULONG IconType; + IPTR IconType; GetAttr(IDTA_Type, in->in_Icon, &IconType); @@ -4499,7 +4499,7 @@ static void MoveToProg(struct internalScaWindowTask *iwt, const struct MenuCmdAr if (mcArg->mca_IconNode) { - ULONG IconType; + IPTR IconType; GetAttr(IDTA_Type, mcArg->mca_IconNode->in_Icon, &IconType); @@ -4567,8 +4567,8 @@ static SAVEDS(ULONG) MoveToStart(APTR aptr, struct SM_RunProcess *msg) // AllocAslRequest() dirReq = AllocAslRequestTags(ASL_FileRequest, ASLFR_PrivateIDCMP, TRUE, - ASLFR_Screen, (ULONG) iInfos.xii_iinfos.ii_Screen, - ASLFR_TitleText, (ULONG) GetLocString(MSGID_MOVETO_ASLTITLE), + ASLFR_Screen, (IPTR) iInfos.xii_iinfos.ii_Screen, + ASLFR_TitleText, (IPTR) GetLocString(MSGID_MOVETO_ASLTITLE), ASLFR_DoSaveMode, TRUE, ASLFR_DrawersOnly, TRUE, TAG_END); @@ -4602,7 +4602,7 @@ static SAVEDS(ULONG) MoveToStart(APTR aptr, struct SM_RunProcess *msg) // AslRequest() Success = AslRequestTags(dirReq, - ASLFR_InitialDrawer, (ULONG) Path, + ASLFR_InitialDrawer, (IPTR) Path, TAG_END); if (Success) @@ -4624,7 +4624,7 @@ static SAVEDS(ULONG) MoveToStart(APTR aptr, struct SM_RunProcess *msg) stccpy(LockdirName, dirReq->fr_Drawer, sizeof(LockdirName)); fileTransObj = SCA_NewScalosObjectTags((STRPTR) "FileTransfer.sca", - SCCA_FileTrans_Screen, (ULONG) iInfos.xii_iinfos.ii_Screen, + SCCA_FileTrans_Screen, (IPTR) iInfos.xii_iinfos.ii_Screen, SCCA_FileTrans_Number, arg->cla_NumArgs, SCCA_FileTrans_ReplaceMode, SCCV_ReplaceMode_Ask, TAG_END); @@ -4812,7 +4812,7 @@ static void DoForAppIcons(ULONG AppMsgClass) if (gg->Flags & GFLG_SELECTED) { - ULONG IconType; + IPTR IconType; GetAttr(IDTA_Type, in->in_Icon, &IconType); diff --git a/scalos/main/Messages.c b/scalos/main/Messages.c index 0b89608d9..a14a5d14a 100755 --- a/scalos/main/Messages.c +++ b/scalos/main/Messages.c @@ -511,6 +511,7 @@ static ULONG UpdateIconMsg(struct internalScaWindowTask *iwt, struct Message *ms static ULONG AddIconMsg(struct internalScaWindowTask *iwt, struct Message *msg, APTR p) { struct SM_AddIcon *smai = (struct SM_AddIcon *) msg; + ULONG *x_ptr; ULONG Result; Result = DoMethod(iwt->iwt_WindowTask.mt_MainObject, @@ -518,7 +519,8 @@ static ULONG AddIconMsg(struct internalScaWindowTask *iwt, struct Message *msg, SCCM_ADDICON_MAKEXY(smai->smai_x, smai->smai_y), smai->smai_DirLock, smai->smai_IconName); - *((ULONG *) &(smai->smai_x)) = Result; + x_ptr = (ULONG *) &smai->smai_x; + *x_ptr = Result; return 0; } @@ -697,7 +699,7 @@ static ULONG RedrawIconObjectMsg(struct internalScaWindowTask *iwt, struct Messa { if (smrio->smrio_Flags & SMRIOFLAGF_HightlightOn) { - ULONG IconUserFlags; + IPTR IconUserFlags; d1(KPrintF("%s/%s/%ld: SMRIOFLAGF_HightlightOn\n", __FILE__, __FUNC__, __LINE__)); @@ -712,7 +714,7 @@ static ULONG RedrawIconObjectMsg(struct internalScaWindowTask *iwt, struct Messa } else if (smrio->smrio_Flags & SMRIOFLAGF_HightlightOff) { - ULONG IconUserFlags; + IPTR IconUserFlags; d1(KPrintF("%s/%s/%ld: SMRIOFLAGF_HightlightOff\n", __FILE__, __FUNC__, __LINE__)); diff --git a/scalos/main/OpenDrawerByName.c b/scalos/main/OpenDrawerByName.c index b1675c093..f35b7e0a5 100644 --- a/scalos/main/OpenDrawerByName.c +++ b/scalos/main/OpenDrawerByName.c @@ -60,9 +60,9 @@ struct ScaWindowStruct *OpenDrawerByName(CONST_STRPTR Path, struct TagItem *TagL { d1(KPrintF("%s/%s/%ld: open device window Path=<%s>\n", __FILE__, __FUNC__, __LINE__, Path)); SCA_OpenIconWindowTags( - SCA_Path, (ULONG) Path, + SCA_Path, (IPTR) Path, SCA_CheckOverlappingIcons, CurrentPrefs.pref_CheckOverlappingIcons, - TAG_MORE, (ULONG) TagList, + TAG_MORE, (IPTR) TagList, TAG_END ); } @@ -93,9 +93,9 @@ struct ScaWindowStruct *OpenDrawerByName(CONST_STRPTR Path, struct TagItem *TagL SCA_OpenIconWindowTags( SCA_CheckOverlappingIcons, CurrentPrefs.pref_CheckOverlappingIcons, - SCA_IconObject, (ULONG) iconObj, - SCA_WindowStruct, (ULONG) &Result, - TAG_MORE, (ULONG) TagList, + SCA_IconObject, (IPTR) iconObj, + SCA_WindowStruct, (IPTR) &Result, + TAG_MORE, (IPTR) TagList, TAG_END ); } @@ -180,8 +180,8 @@ static Object *ReadIconObject_NoFail(CONST_STRPTR Path) d1(kprintf("%s/%s/%ld wa_Lock=%08lx wa_Name=<%s>\n", __FILE__, __FUNC__, __LINE__, OriginalLocation.wa_Lock, OriginalLocation.wa_Name)); iconObj = GetDefIconObjectTags(WBDRAWER, - IDTA_IconLocation, (ULONG) &OriginalLocation, - DTA_Name, (ULONG) Path, + IDTA_IconLocation, (IPTR) &OriginalLocation, + DTA_Name, (IPTR) Path, TAG_END); d1(kprintf("%s/%s/%ld iconObj=%08lx\n", __FILE__, __FUNC__, __LINE__, iconObj)); diff --git a/scalos/main/Patches.c b/scalos/main/Patches.c index 57d046e45..6e46b58d0 100755 --- a/scalos/main/Patches.c +++ b/scalos/main/Patches.c @@ -336,7 +336,7 @@ LIBFUNC_END // OpenWorkBench() replacement -LIBFUNC_P1(LONG, sca_OpenWorkBench, +LIBFUNC_P1(IPTR, sca_OpenWorkBench, A6, struct IntuitionBase *, iBase, 0) { LONG Success; @@ -364,7 +364,7 @@ LIBFUNC_P1(LONG, sca_OpenWorkBench, // OpenWorkBench() is supposed to return WBScreeen !!! - return Success ? (LONG) iInfos.xii_iinfos.ii_Screen : 0L; + return Success ? (IPTR) iInfos.xii_iinfos.ii_Screen : 0L; } LIBFUNC_END @@ -396,7 +396,7 @@ static LONG ReOpenScalos(void) { // IconControlA() IconControl(NULL, - ICONCTRLA_SetGlobalScreen, (ULONG) iInfos.xii_iinfos.ii_Screen, + ICONCTRLA_SetGlobalScreen, (IPTR) iInfos.xii_iinfos.ii_Screen, TAG_END); } @@ -581,7 +581,7 @@ LIBFUNC_P8(struct AppIcon *, sca_AddAppIconA, break; SetAttrs(IconObj, - IDTA_Text, (ULONG) IconText, + IDTA_Text, (IPTR) IconText, TAG_END); OpenLibrary("scalos.library", 0); @@ -846,7 +846,7 @@ static SAVEDS(ULONG) AppChangeFunc(struct WBArg *ArgArray, struct SM_RunProcess d1(kprintf("%s/%s/%ld: Path=<%s>\n", __FILE__, __FUNC__, __LINE__, Path)); IconObj = NewIconObjectTags(Path, - IDTA_SizeConstraints, (ULONG) &ws->ws_IconSizeConstraints, + IDTA_SizeConstraints, (IPTR) &ws->ws_IconSizeConstraints, IDTA_ScalePercentage, ws->ws_IconScaleFactor, TAG_END); d1(kprintf("%s/%s/%ld: IconObj=%08lx\n", __FILE__, __FUNC__, __LINE__, IconObj)); @@ -860,7 +860,7 @@ static SAVEDS(ULONG) AppChangeFunc(struct WBArg *ArgArray, struct SM_RunProcess d1(kprintf("%s/%s/%ld: Path=<%s>\n", __FILE__, __FUNC__, __LINE__, Path)); IconObj = NewIconObjectTags(Path, - IDTA_SizeConstraints, (ULONG) &ws->ws_IconSizeConstraints, + IDTA_SizeConstraints, (IPTR) &ws->ws_IconSizeConstraints, IDTA_ScalePercentage, ws->ws_IconScaleFactor, TAG_END); } while (0); @@ -1354,7 +1354,7 @@ LIBFUNC_P3(struct Screen *, sca_OpenScreenTagList, d1(KPrintF("%s/%s/%ld: NewScreen=%08lx\n", __FILE__, __FUNC__, __LINE__, newScr)); - PubScreenName = (CONST_STRPTR) GetTagData(SA_PubName, (ULONG)NULL, (struct TagItem *) TagList); + PubScreenName = (CONST_STRPTR) GetTagData(SA_PubName, (IPTR)NULL, (struct TagItem *) TagList); if (PubScreenName && 0 == strcmp("Workbench", PubScreenName)) { @@ -1390,7 +1390,7 @@ LIBFUNC_P3(struct Screen *, sca_OpenScreenTagList, if (-1 != PalettePrefs.pal_driPens[0]) { ti[nTag].ti_Tag = SA_Pens; - ti[nTag++].ti_Data = (ULONG) PalettePrefs.pal_driPens; + ti[nTag++].ti_Data = (IPTR) PalettePrefs.pal_driPens; d1(KPrintF("%s/%s/%ld: driPens[0]=%ld driPens[1]=%ld\n", __FILE__, __FUNC__, __LINE__, PalettePrefs.pal_driPens[0], PalettePrefs.pal_driPens[1])); @@ -1405,7 +1405,7 @@ LIBFUNC_P3(struct Screen *, sca_OpenScreenTagList, if (PalettePrefs.pal_ScreenColorList) { ti[nTag].ti_Tag = SA_Colors32; - ti[nTag++].ti_Data = (ULONG) PalettePrefs.pal_ScreenColorList; + ti[nTag++].ti_Data = (IPTR) PalettePrefs.pal_ScreenColorList; #if 0 { @@ -1426,7 +1426,7 @@ LIBFUNC_P3(struct Screen *, sca_OpenScreenTagList, ti[nTag++].ti_Data = FALSE; } ti[nTag].ti_Tag = TAG_MORE; - ti[nTag++].ti_Data = (ULONG) AllocatedTagList; + ti[nTag++].ti_Data = (IPTR) AllocatedTagList; ti[nTag].ti_Tag = TAG_END; diff --git a/scalos/main/Patches.h b/scalos/main/Patches.h index 8baf1cf22..83df35a97 100755 --- a/scalos/main/Patches.h +++ b/scalos/main/Patches.h @@ -65,7 +65,7 @@ LIBFUNC_P3_PROTO(struct Window *, sca_OpenWindowTagList, LIBFUNC_P1_PROTO(LONG, sca_CloseWorkBench, A6, struct IntuitionBase *, iBase, 0); -LIBFUNC_P1_PROTO(LONG, sca_OpenWorkBench, +LIBFUNC_P1_PROTO(IPTR, sca_OpenWorkBench, A6, struct IntuitionBase *, iBase, 0); LIBFUNC_P8_PROTO(struct AppIcon *, sca_AddAppIconA, D0, ULONG, Id, diff --git a/scalos/main/Pattern.c b/scalos/main/Pattern.c index 8fde6ab38..7647ab11f 100644 --- a/scalos/main/Pattern.c +++ b/scalos/main/Pattern.c @@ -487,8 +487,8 @@ static BOOL SetBackFill_AsyncRead(struct internalScaWindowTask *iwt, if (!ChildProcessRun(iwt, &msg->ScalosMessage, - NP_CommandName, (ULONG) "Scalos_Async_Backfill", - NP_Name, (ULONG) "Scalos_Async_Backfill", + NP_CommandName, (IPTR) "Scalos_Async_Backfill", + NP_Name, (IPTR) "Scalos_Async_Backfill", TAG_END)) { iwt->iwt_AsyncLayoutPending = FALSE; @@ -596,7 +596,7 @@ static BOOL ReadBackFill_NoGuiGfx(struct internalScaWindowTask *iwt, struct Patt { struct BitMap *destBitMap = NULL; struct BitMapHeader *bmhd = NULL; - ULONG ReallyUseFriendBitMap; + IPTR ReallyUseFriendBitMap; BOOL Success = FALSE; d1(KPrintF("%s/%s/%ld: START ptn=%08lx ptn_flags=%04lx ptinf=%08lx scr=%08lx\n", \ @@ -613,7 +613,7 @@ static BOOL ReadBackFill_NoGuiGfx(struct internalScaWindowTask *iwt, struct Patt DTA_SourceType, DTST_FILE, DTA_GroupID, GID_PICTURE, PDTA_Remap, !(ptNode->ptn_flags & PTNF_NoRemap), - PDTA_Screen, (ULONG) scr, + PDTA_Screen, (IPTR) scr, PDTA_FreeSourceBitMap, TRUE, OBP_Precision, ptNode->ptn_prec, TAG_END); @@ -627,8 +627,8 @@ static BOOL ReadBackFill_NoGuiGfx(struct internalScaWindowTask *iwt, struct Patt DoMethod(ptNode->ptn_object, DTM_PROCLAYOUT, NULL, TRUE); GetDTAttrs(ptNode->ptn_object, - PDTA_DestBitMap, (ULONG) &destBitMap, - PDTA_BitMapHeader, (ULONG) &bmhd, + PDTA_DestBitMap, (IPTR) &destBitMap, + PDTA_BitMapHeader, (IPTR) &bmhd, TAG_END); d1(KPrintF("%s/%s/%ld: destBitMap=%08lx bmhd=%08lx\n", __FILE__, __FUNC__, __LINE__, destBitMap, bmhd)); if (NULL == destBitMap || NULL == bmhd) @@ -804,8 +804,8 @@ static BOOL ReadBackFill_Enhanced(struct internalScaWindowTask *iwt, struct Patt break; if (2 != GetPictureAttrs(ptNode->ptn_picture, - PICATTR_Width, (ULONG) &picWidth, - PICATTR_Height, (ULONG) &picHeight, + PICATTR_Width, (IPTR) &picWidth, + PICATTR_Height, (IPTR) &picHeight, TAG_END)) break; @@ -1233,13 +1233,13 @@ static BOOL PatternCreateScaledBitMapNoGuiGFX(struct internalScaWindowTask *iwt, do { struct ScaleBitMapArg sbma; struct BitMap *ScaledBitMap; - ULONG NumColors; + IPTR NumColors; ULONG *ColorTable; struct RastPort rp; if (2 != GetDTAttrs(ptNode->ptn_object, - PDTA_NumColors, (ULONG) &NumColors, - PDTA_CRegs, (ULONG) &ColorTable, + PDTA_NumColors, (IPTR) &NumColors, + PDTA_CRegs, (IPTR) &ColorTable, TAG_END)) break; diff --git a/scalos/main/PopupMenus.c b/scalos/main/PopupMenus.c index e5b0e74c2..bb781bd31 100644 --- a/scalos/main/PopupMenus.c +++ b/scalos/main/PopupMenus.c @@ -78,13 +78,13 @@ static void SetPopupMenuAfterIconSupportFlags(struct internalScaWindowTask *iwt, struct PopupMenu *pm, struct ScaIconNode *in); static void SetPopupMenuAfterWindowFlags(struct PopupMenu *pm, struct internalScaWindowTask *iwt); static void SetPopupMenuCommandAttributes(struct internalScaWindowTask *iwt, - const struct ScalosMenuTree *mTree, struct PopupMenu *pm, + const struct SCALOS_MENUTREE *mTree, struct PopupMenu *pm, struct ScaIconNode *in, const struct IconMenuSupports *CmdTable, ULONG Flags); static SAVEDS(CONST_STRPTR) PMGetStringFunc(struct Hook *theHook, ULONG dummy, ULONG *args); static void ShowIconPopupMenu(struct internalScaWindowTask *iwt, struct msg_ShowPopupMenu *mpm); static void ShowWindowPopupMenu(struct internalScaWindowTask *iwt, struct msg_ShowPopupMenu *mpm); static ULONG CheckPopupMenu(struct internalScaWindowTask *iwt, struct ScaIconNode *in, - const struct ScalosMenuTree *mTree, ULONG *Checkit, ULONG *Checked); + const struct SCALOS_MENUTREE *mTree, ULONG *Checkit, ULONG *Checked); static void CreateSelectedIconList(struct List *SelectedIconList, struct List *LockedWindowList, struct ScaIconNode *IconUnderPointer); static void CleanupSelectedIconList(struct List *SelectedIconList, struct List *LockedWindowList); @@ -160,7 +160,7 @@ LONG TestPopup(struct internalScaWindowTask *iwt, WORD MouseX, WORD MouseY, UWOR } else { - ULONG IconType; + IPTR IconType; GetAttr(IDTA_Type, inUnderPointer->in_Icon, &IconType); @@ -304,17 +304,17 @@ LONG TestPopup(struct internalScaWindowTask *iwt, WORD MouseX, WORD MouseY, UWOR static void SetPopupMenuAfterIconSupportFlags(struct internalScaWindowTask *iwt, struct PopupMenu *pm, struct ScaIconNode *in) { - ULONG IconType; + IPTR IconType; GetAttr(IDTA_Type, in->in_Icon, &IconType); while (pm) { struct PopupMenu *pmSub = NULL; - struct ScalosMenuTree *mTree = NULL; + struct SCALOS_MENUTREE *mTree = NULL; PM_GetItemAttrs(pm, - PM_UserData, (ULONG) &mTree, + PM_UserData, (IPTR) &mTree, TAG_END); if (mTree) @@ -326,7 +326,7 @@ static void SetPopupMenuAfterIconSupportFlags(struct internalScaWindowTask *iwt, } PM_GetItemAttrs(pm, - PM_Sub, (ULONG) &pmSub, + PM_Sub, (IPTR) &pmSub, TAG_END); if (pmSub) SetPopupMenuAfterIconSupportFlags(iwt, pmSub, in); @@ -343,10 +343,10 @@ static void SetPopupMenuAfterWindowFlags(struct PopupMenu *pm, struct internalSc while (pm) { struct PopupMenu *pmSub = NULL; - struct ScalosMenuTree *mTree = NULL; + struct SCALOS_MENUTREE *mTree = NULL; PM_GetItemAttrs(pm, - PM_UserData, (ULONG) &mTree, + PM_UserData, (IPTR) &mTree, TAG_END); if (mTree) @@ -358,7 +358,7 @@ static void SetPopupMenuAfterWindowFlags(struct PopupMenu *pm, struct internalSc } PM_GetItemAttrs(pm, - PM_Sub, (ULONG) &pmSub, + PM_Sub, (IPTR) &pmSub, TAG_END); if (pmSub) SetPopupMenuAfterWindowFlags(pmSub, iwt); @@ -369,7 +369,7 @@ static void SetPopupMenuAfterWindowFlags(struct PopupMenu *pm, struct internalSc static void SetPopupMenuCommandAttributes(struct internalScaWindowTask *iwt, - const struct ScalosMenuTree *mTree, struct PopupMenu *pm, struct ScaIconNode *in, + const struct SCALOS_MENUTREE *mTree, struct PopupMenu *pm, struct ScaIconNode *in, const struct IconMenuSupports *CmdTable, ULONG Flags) { if (SCAMENUTYPE_Command == mTree->mtre_type) @@ -387,13 +387,13 @@ static void SetPopupMenuCommandAttributes(struct internalScaWindowTask *iwt, if (0 == Stricmp("undo", mTree->MenuCombo.MenuCommand.mcom_name)) { PM_SetItemAttrs(pm, - PM_Title, (ULONG) UndoGetDescription(), + PM_Title, (IPTR) UndoGetDescription(), TAG_END); } else if (0 == Stricmp("redo", mTree->MenuCombo.MenuCommand.mcom_name)) { PM_SetItemAttrs(pm, - PM_Title, (ULONG) RedoGetDescription(), + PM_Title, (IPTR) RedoGetDescription(), TAG_END); } @@ -459,7 +459,7 @@ static void ShowIconPopupMenu(struct internalScaWindowTask *iwt, struct msg_Show Object *IconObj = mpm->mpm_IconNode->in_Icon; struct ExtGadget *gg = (struct ExtGadget *) mpm->mpm_IconNode->in_Icon; struct PopupMenu *pmTitle; - struct ScalosMenuTree *mtr; + struct SCALOS_MENUTREE *mtr; struct SelectedIcon *sli; ULONG wasSelected; ULONG SelectedIconCount = 0; @@ -514,7 +514,7 @@ static void ShowIconPopupMenu(struct internalScaWindowTask *iwt, struct msg_Show d1(kprintf("%s/%s/%ld: in_Name=<%s> %08lx\n", \ __FILE__, __FUNC__, __LINE__, mpm->mpm_IconNode->in_Name, mpm->mpm_IconNode->in_Name)); - pmTitle2 = PM_MakeItem(PM_Title, (ULONG) MenuTitle, + pmTitle2 = PM_MakeItem(PM_Title, (IPTR) MenuTitle, PM_NoSelect, TRUE, PM_ShinePen, TRUE, PM_Shadowed, TRUE, @@ -524,8 +524,8 @@ static void ShowIconPopupMenu(struct internalScaWindowTask *iwt, struct msg_Show if (pmTitle2) { PM_InsertMenuItem(mpm->mpm_PopupMenu, - PM_Insert_After, (ULONG) pmTitle, - PM_Insert_Item, (ULONG) pmTitle2, + PM_Insert_After, (IPTR) pmTitle, + PM_Insert_Item, (IPTR) pmTitle2, TAG_END); } } @@ -536,9 +536,9 @@ static void ShowIconPopupMenu(struct internalScaWindowTask *iwt, struct msg_Show ScalosObtainSemaphore(&LayersSema); // PM_OpenPopupMenuA() - mtr = (struct ScalosMenuTree *) PM_OpenPopupMenu(iwt->iwt_WindowTask.wt_Window, - PM_Menu, (ULONG) mpm->mpm_PopupMenu, - PM_LocaleHook, (ULONG) &PMGetStringHook, + mtr = (struct SCALOS_MENUTREE *) PM_OpenPopupMenu(iwt->iwt_WindowTask.wt_Window, + PM_Menu, (IPTR) mpm->mpm_PopupMenu, + PM_LocaleHook, (IPTR) &PMGetStringHook, TAG_END); d1(KPrintF("%s/%s/%ld: mtr=%08lx\n", __FILE__, __FUNC__, __LINE__, mtr)); @@ -638,7 +638,7 @@ static void ShowIconPopupMenu(struct internalScaWindowTask *iwt, struct msg_Show static void ShowWindowPopupMenu(struct internalScaWindowTask *iwt, struct msg_ShowPopupMenu *mpm) { struct PopupMenu *pmTitle2 = NULL; - struct ScalosMenuTree *mtr; + struct SCALOS_MENUTREE *mtr; struct PopupMenu *pmTitle; d1(KPrintF("%s/%s/%ld: START\n", __FILE__, __FUNC__, __LINE__)); @@ -646,7 +646,7 @@ static void ShowWindowPopupMenu(struct internalScaWindowTask *iwt, struct msg_Sh pmTitle = PM_FindItem(mpm->mpm_PopupMenu, PM_TITLE_ID); if (pmTitle && iwt->iwt_WindowTask.mt_WindowStruct->ws_Name) { - pmTitle2 = PM_MakeItem(PM_Title, (ULONG) iwt->iwt_WindowTask.mt_WindowStruct->ws_Name, + pmTitle2 = PM_MakeItem(PM_Title, (IPTR) iwt->iwt_WindowTask.mt_WindowStruct->ws_Name, PM_NoSelect, TRUE, PM_ShinePen, TRUE, PM_Shadowed, TRUE, @@ -656,8 +656,8 @@ static void ShowWindowPopupMenu(struct internalScaWindowTask *iwt, struct msg_Sh if (pmTitle2) { PM_InsertMenuItem(mpm->mpm_PopupMenu, - PM_Insert_After, (ULONG) pmTitle, - PM_Insert_Item, (ULONG) pmTitle2, + PM_Insert_After, (IPTR) pmTitle, + PM_Insert_Item, (IPTR) pmTitle2, TAG_END); } } @@ -667,9 +667,9 @@ static void ShowWindowPopupMenu(struct internalScaWindowTask *iwt, struct msg_Sh ScalosObtainSemaphore(&LayersSema); // PM_OpenPopupMenuA() - mtr = (struct ScalosMenuTree *) PM_OpenPopupMenu(iwt->iwt_WindowTask.wt_Window, - PM_Menu, (ULONG) mpm->mpm_PopupMenu, - PM_LocaleHook, (ULONG) &PMGetStringHook, + mtr = (struct SCALOS_MENUTREE *) PM_OpenPopupMenu(iwt->iwt_WindowTask.wt_Window, + PM_Menu, (IPTR) mpm->mpm_PopupMenu, + PM_LocaleHook, (IPTR) &PMGetStringHook, TAG_END); ScalosReleaseSemaphore(&LayersSema); @@ -695,7 +695,7 @@ static void ShowWindowPopupMenu(struct internalScaWindowTask *iwt, struct msg_Sh static ULONG CheckPopupMenu(struct internalScaWindowTask *iwt, struct ScaIconNode *in, - const struct ScalosMenuTree *mTree, ULONG *Checkit, ULONG *Checked) + const struct SCALOS_MENUTREE *mTree, ULONG *Checkit, ULONG *Checked) { ULONG Disabled = FALSE; struct ScalosMenuCommand *mpi; diff --git a/scalos/main/Prefs.c b/scalos/main/Prefs.c index bb854c699..e2dce2360 100644 --- a/scalos/main/Prefs.c +++ b/scalos/main/Prefs.c @@ -628,7 +628,7 @@ void ReadFontPrefs(void) InitIFFasDOS(iff); - iff->iff_Stream = (ULONG) Open("ENV:sys/font.prefs", MODE_OLDFILE); + iff->iff_Stream = (IPTR) Open("ENV:sys/font.prefs", MODE_OLDFILE); d1(KPrintF("%s/%s/%ld: iff_Stream=%08lx\n", __FILE__, __FUNC__, __LINE__, iff->iff_Stream)); if (0 == iff->iff_Stream) @@ -1221,7 +1221,7 @@ BOOL ReadScalosPrefs(void) NewPrefs->pref_ScreenTitle = GetPrefsConfigString(NewPrefs->pref_Handle, SCP_ScreenTitle, DefaultScreenTitle); SetAttrs(ScreenTitleObject, - SCCA_Title_Format, (ULONG) NewPrefs->pref_ScreenTitle, + SCCA_Title_Format, (IPTR) NewPrefs->pref_ScreenTitle, TAG_END); NewPrefs->pref_MainWindowTitle = GetPrefsConfigString(NewPrefs->pref_Handle, SCP_RootWinTitle, DefaultMainWindowTitle); @@ -1449,7 +1449,7 @@ BOOL ReadScalosPrefs(void) } SetAttrs(ScreenTitleObject, - SCCA_Title_Format, (ULONG) NewPrefs->pref_ScreenTitle, + SCCA_Title_Format, (IPTR) NewPrefs->pref_ScreenTitle, TAG_END); ps = FindPreferences(NewPrefs->pref_Handle, ID_MAIN, SCP_TextMode_ListColumns); diff --git a/scalos/main/Request.c b/scalos/main/Request.c index 72c3609ee..6ac653f29 100644 --- a/scalos/main/Request.c +++ b/scalos/main/Request.c @@ -113,8 +113,8 @@ void UseAsyncRequestArgs(struct internalScaWindowTask *iwt, msg->smrq_ez.es_GadgetFormat = (STRPTR) GetLocString(GadgetTextNum); RequestProc = CreateNewProcTags(NP_WindowPtr, NULL, - NP_Name, (ULONG) "Scalos_Request", - NP_Entry, (ULONG) PATCH_NEWFUNC(RequestTask), + NP_Name, (IPTR) "Scalos_Request", + NP_Entry, (IPTR) PATCH_NEWFUNC(RequestTask), TAG_END); if (RequestProc) diff --git a/scalos/main/RootClass.c b/scalos/main/RootClass.c index 433e0e833..4c208791b 100755 --- a/scalos/main/RootClass.c +++ b/scalos/main/RootClass.c @@ -65,8 +65,8 @@ struct EventListener // local functions -static ULONG RootClass_Dispatcher(Class *cl, Object *o, Msg msg); -static ULONG RootClass_New(Class *cl, Object *o, Msg msg); +static IPTR RootClass_Dispatcher(Class *cl, Object *o, Msg msg); +static IPTR RootClass_New(Class *cl, Object *o, Msg msg); static ULONG Root_HandleMessages(Class *cl, Object *o, Msg msg); static ULONG Root_CheckForMessages(Class *cl, Object *o, Msg msg); static ULONG RootClass_Message(Class *cl, Object *o, Msg msg); @@ -74,7 +74,7 @@ static int IDCMPFuncTableComp(const void *keyval, const void *datum); static ULONG RootClass_RunProcess(Class *cl, Object *o, Msg msg); static ULONG RootClass_AddToClipboard(Class *cl, Object *o, Msg msg); static ULONG RootClass_ClearClipboard(Class *cl, Object *o, Msg msg); -static ULONG RootClass_GetLocalizedString(Class *cl, Object *o, Msg msg); +static IPTR RootClass_GetLocalizedString(Class *cl, Object *o, Msg msg); static struct EventListener *RootClass_AddListener(Class *cl, Object *o, Msg msg); static ULONG RootClass_RemListener(Class *cl, Object *o, Msg msg); static ULONG RootMessageUnIconify(struct internalScaWindowTask *iwt, struct AppMessage *appMsg); @@ -142,44 +142,44 @@ Class * initRootClass(void) } -static ULONG RootClass_Dispatcher(Class *cl, Object *o, Msg msg) +static IPTR RootClass_Dispatcher(Class *cl, Object *o, Msg msg) { - ULONG Result; + IPTR Result; GenerateEvents(cl, o, msg); switch (msg->MethodID) { case OM_NEW: - Result = (ULONG) RootClass_New(cl, o, msg); + Result = (IPTR) RootClass_New(cl, o, msg); break; case SCCM_HandleMessages: - Result = (ULONG) Root_HandleMessages(cl, o, msg); + Result = (IPTR) Root_HandleMessages(cl, o, msg); break; case SCCM_CheckForMessages: - Result = (ULONG) Root_CheckForMessages(cl, o, msg); + Result = (IPTR) Root_CheckForMessages(cl, o, msg); break; case SCCM_Message: - Result = (ULONG) RootClass_Message(cl, o, msg); + Result = (IPTR) RootClass_Message(cl, o, msg); break; case SCCM_RunProcess: - Result = (ULONG) RootClass_RunProcess(cl, o, msg); + Result = (IPTR) RootClass_RunProcess(cl, o, msg); break; case SCCM_AddToClipboard: - Result = (ULONG) RootClass_AddToClipboard(cl, o, msg); + Result = (IPTR) RootClass_AddToClipboard(cl, o, msg); break; case SCCM_ClearClipboard: - Result = (ULONG) RootClass_ClearClipboard(cl, o, msg); + Result = (IPTR) RootClass_ClearClipboard(cl, o, msg); break; case SCCM_GetLocalizedString: - Result = (ULONG) RootClass_GetLocalizedString(cl, o, msg); + Result = (IPTR) RootClass_GetLocalizedString(cl, o, msg); break; case SCCM_WindowStartComplete: @@ -188,7 +188,7 @@ static ULONG RootClass_Dispatcher(Class *cl, Object *o, Msg msg) break; case SCCM_AddListener: - Result = (ULONG) RootClass_AddListener(cl, o, msg); + Result = (IPTR) RootClass_AddListener(cl, o, msg); break; case SCCM_RemListener: @@ -204,7 +204,7 @@ static ULONG RootClass_Dispatcher(Class *cl, Object *o, Msg msg) } -static ULONG RootClass_New(Class *cl, Object *o, Msg msg) +static IPTR RootClass_New(Class *cl, Object *o, Msg msg) { o = (Object *) DoSuperMethodA(cl, o, msg); if (o) @@ -212,11 +212,11 @@ static ULONG RootClass_New(Class *cl, Object *o, Msg msg) struct RootClassInstance *inst = INST_DATA(cl, o); struct opSet *ops = (struct opSet *) msg; - inst->rci_RootList.rl_WindowTask = (struct ScaWindowTask *) GetTagData(SCCA_WindowTask, (ULONG)NULL, ops->ops_AttrList); + inst->rci_RootList.rl_WindowTask = (struct ScaWindowTask *) GetTagData(SCCA_WindowTask, (IPTR)NULL, ops->ops_AttrList); inst->rci_RootList.rl_internInfos = &iInfos.xii_iinfos; } - return (ULONG) o; + return (IPTR) o; } @@ -380,7 +380,7 @@ static ULONG RootClass_RunProcess(Class *cl, Object *o, Msg msg) d1(kprintf("%s/%s/%ld: iwt=%08lx <%s>\n", __FILE__, __FUNC__, __LINE__, iwt, iwt->iwt_WinTitle, mrp->mrp_ReplyPort)); - if (SCCV_RunProcess_WaitReply == (ULONG) mrp->mrp_ReplyPort) + if (SCCV_RunProcess_WaitReply == (IPTR) mrp->mrp_ReplyPort) { if (ScalosAttemptSemaphoreShared(&iwt->iwt_ChildProcessSemaphore)) { @@ -389,7 +389,7 @@ static ULONG RootClass_RunProcess(Class *cl, Object *o, Msg msg) d1(kprintf("%s/%s/%ld: wt_IconPort=%08lx\n", __FILE__, __FUNC__, __LINE__, iwt->iwt_WindowTask.wt_IconPort)); Result = RunProcess(&iwt->iwt_WindowTask, mrp->mrp_EntryPoint, - (mrp->mrp_ArgSize + 3) / sizeof(LONG), + (mrp->mrp_ArgSize + 3) / sizeof(IPTR), (struct WBArg *) mrp->mrp_Args, iwt->iwt_WindowTask.wt_IconPort); if (Result) @@ -417,7 +417,7 @@ static ULONG RootClass_AddToClipboard(Class *cl, Object *o, Msg msg) struct msg_AddToClipboard *acp = (struct msg_AddToClipboard *) msg; BPTR destDirLock; BPTR newLock = (BPTR)NULL; - ULONG IconType = 0; + IPTR IconType = 0; struct FileTransArg *fta; d1(kprintf("%s/%s/%ld: in=%08lx <%s> Opcode=%ld Clipboard=%08lx\n", \ @@ -506,11 +506,11 @@ static ULONG RootClass_ClearClipboard(Class *cl, Object *o, Msg msg) } -static ULONG RootClass_GetLocalizedString(Class *cl, Object *o, Msg msg) +static IPTR RootClass_GetLocalizedString(Class *cl, Object *o, Msg msg) { struct msg_GetLocString *mgl = (struct msg_GetLocString *) msg; - return (ULONG) GetLocString(mgl->mgl_StringID); + return (IPTR) GetLocString(mgl->mgl_StringID); } @@ -700,7 +700,7 @@ static void UnShadowIcon(struct internalScaWindowTask *iwt, struct ScaIconNode * // we found the icon struct ScaIconNode inCopy; struct ScaIconNode *IconList = &inCopy; - ULONG UserFlags = 0L; + IPTR UserFlags = 0L; GetAttr(IDTA_UserFlags, in2->in_Icon, &UserFlags); UserFlags &= ~ICONOBJ_USERFLAGF_DrawShadowed; diff --git a/scalos/main/ScaLibrary.c b/scalos/main/ScaLibrary.c index 74f5ae8df..f79195749 100755 --- a/scalos/main/ScaLibrary.c +++ b/scalos/main/ScaLibrary.c @@ -160,7 +160,7 @@ LIBFUNC_P6(struct AppObject *, sca_NewAddAppIcon, appo->appo_object.appoo_IconObject = iconObj; appo->appo_TagList = CloneTagItems(TagList); - renderHook = (struct Hook *) GetTagData(WBAPPICONA_RenderHook, (ULONG)NULL, TagList); + renderHook = (struct Hook *) GetTagData(WBAPPICONA_RenderHook, (IPTR)NULL, TagList); SetAttrs(iconObj, IDTA_Type, WBAPPICON, @@ -186,11 +186,11 @@ LIBFUNC_P6(struct AppObject *, sca_NewAddAppIcon, IDTA_TextMode, CurrentPrefs.pref_TextMode, IDTA_TextDrawMode, FontPrefs.fprf_TextDrawMode, IDTA_TextBackPen, FontPrefs.fprf_FontBackPen, - IDTA_Font, (ULONG) iwt->iwt_IconFont, - IDTA_Fonthandle, (ULONG) &iwt->iwt_IconTTFont, - IDTA_FontHook, (ULONG) (TTEngineBase ? &ScalosFontHook : NULL), - IDTA_RenderHook, (ULONG) renderHook, - IDTA_SizeConstraints, (ULONG) &iInfos.xii_iinfos.ii_AppWindowStruct->ws_IconSizeConstraints, + IDTA_Font, (IPTR) iwt->iwt_IconFont, + IDTA_Fonthandle, (IPTR) &iwt->iwt_IconTTFont, + IDTA_FontHook, (IPTR) (TTEngineBase ? &ScalosFontHook : NULL), + IDTA_RenderHook, (IPTR) renderHook, + IDTA_SizeConstraints, (IPTR) &iInfos.xii_iinfos.ii_AppWindowStruct->ws_IconSizeConstraints, IDTA_ScalePercentage, iInfos.xii_iinfos.ii_AppWindowStruct->ws_IconScaleFactor, TAG_END); @@ -781,10 +781,10 @@ LIBFUNC_P6(struct AppObject *, sca_NewAddAppMenuItem, if (NULL == appo) break; - CmdString = (STRPTR) GetTagData(WBAPPMENUA_CommandKeyString, (ULONG) "", TagList); + CmdString = (STRPTR) GetTagData(WBAPPMENUA_CommandKeyString, (IPTR) "", TagList); - SubKey = (struct AppMenuInfo **) GetTagData(WBAPPMENUA_GetKey, (ULONG)NULL, TagList); - TitleKey = (struct AppMenuInfo **) GetTagData(WBAPPMENUA_GetTitleKey, (ULONG)NULL, TagList); + SubKey = (struct AppMenuInfo **) GetTagData(WBAPPMENUA_GetKey, (IPTR)NULL, TagList); + TitleKey = (struct AppMenuInfo **) GetTagData(WBAPPMENUA_GetTitleKey, (IPTR)NULL, TagList); appo->appo_Kennung = ID_SC; appo->appo_type = APPTYPE_AppMenuItem; @@ -826,7 +826,7 @@ LIBFUNC_P6(struct AppObject *, sca_NewAddAppMenuItem, *SubKey = appo->appo_object.appoo_MenuInfo; } - appo->appo_object.appoo_MenuInfo->ami_Parent = (struct AppMenuInfo *) GetTagData(WBAPPMENUA_UseKey, (ULONG)NULL, TagList); + appo->appo_object.appoo_MenuInfo->ami_Parent = (struct AppMenuInfo *) GetTagData(WBAPPMENUA_UseKey, (IPTR)NULL, TagList); if (appo->appo_object.appoo_MenuInfo->ami_Parent) { @@ -997,7 +997,7 @@ LIBFUNC_P4(BOOL, sca_WBStart, if (!(wblArg->wbl_IO.wbl_Input.wbli_Flags & SCAF_WBStart_NoIcon)) { - IconObject = (Object *) GetTagData(SCA_IconObject, (ULONG)NULL, TagList); + IconObject = (Object *) GetTagData(SCA_IconObject, (IPTR)NULL, TagList); d1(KPrintF("%s/%s/%ld: IconObject=%08lx\n", __FILE__, __FUNC__, __LINE__, IconObject)); @@ -1010,7 +1010,9 @@ LIBFUNC_P4(BOOL, sca_WBStart, if (IconObject) { - GetAttr(IDTA_Stacksize, IconObject, &wblArg->wbl_IO.wbl_Input.wbli_StackSize); + IPTR stackSize = 0; + GetAttr(IDTA_Stacksize, IconObject, &stackSize); + wblArg->wbl_IO.wbl_Input.wbli_StackSize = stackSize; if (!CheckProject(IconObject, &wblArg->wbl_IO.wbl_Input, &cliStart, &RexxStart, &Arg0Locked)) { @@ -1068,8 +1070,8 @@ LIBFUNC_P4(BOOL, sca_WBStart, newProc = CreateNewProcTags(NP_CurrentDir, NULL, NP_WindowPtr, NULL, NP_Priority, wblArg->wbl_IO.wbl_Input.wbli_Priority, - NP_Name, (ULONG) "WBL", - NP_Entry, (ULONG) PATCH_NEWFUNC(WblTask), + NP_Name, (IPTR) "WBL", + NP_Entry, (IPTR) PATCH_NEWFUNC(WblTask), TAG_END); if (NULL == newProc) break; @@ -1258,7 +1260,7 @@ static BOOL CheckProject(Object *IconObject, struct WblInput *wbli, BOOL *cliSta { Object *DefaultIconObject = NULL; STRPTR Path = NULL; - ULONG IconType; + IPTR IconType; ULONG ul; STRPTR tt; @@ -1442,7 +1444,7 @@ LIBFUNC_P5(struct ScalosClass *, sca_MakeScalosClass, d1(kprintf("%s/%s/%ld: NewScalosClass=%08lx\n", __FILE__, __FUNC__, __LINE__, NewScalosClass)); - NewClass->cl_UserData = (ULONG) NewScalosClass; + NewClass->cl_UserData = (IPTR) NewScalosClass; NewScalosClass->sccl_class = NewClass; NewScalosClass->sccl_name = (STRPTR) ClassName; @@ -2831,8 +2833,8 @@ static STRPTR ChkPrjRequestFile(struct WBArg *arg) // AllocAslRequest() fileReq = AllocAslRequestTags(ASL_FileRequest, ASLFR_PrivateIDCMP, TRUE, - ASLFR_Screen, (ULONG) iInfos.xii_iinfos.ii_Screen, - ASLFR_TitleText, (ULONG) GetLocString(MSGID_REQ_SELECTDEFTOOL), + ASLFR_Screen, (IPTR) iInfos.xii_iinfos.ii_Screen, + ASLFR_TitleText, (IPTR) GetLocString(MSGID_REQ_SELECTDEFTOOL), ASLFR_DoSaveMode, FALSE, ASLFR_RejectIcons, TRUE, TAG_END); @@ -2842,8 +2844,8 @@ static STRPTR ChkPrjRequestFile(struct WBArg *arg) // AslRequest() Success = AslRequestTags(fileReq, - ASLFR_InitialFile, (ULONG) arg->wa_Name, - ASLFR_InitialDrawer, (ULONG) Path, + ASLFR_InitialFile, (IPTR) arg->wa_Name, + ASLFR_InitialDrawer, (IPTR) Path, TAG_END); if (Success) diff --git a/scalos/main/filetypes.c b/scalos/main/filetypes.c index e79f2c465..c3e5bd1a8 100644 --- a/scalos/main/filetypes.c +++ b/scalos/main/filetypes.c @@ -99,7 +99,7 @@ struct FileTypeMenuItem struct ScalosTagList ftmi_TagList; - struct ScalosMenuTree *ftmi_MenuTree; + struct SCALOS_MENUTREE *ftmi_MenuTree; BOOL ftmi_DefaultAction; }; @@ -158,7 +158,7 @@ static struct FileTypeMenuItem *NewFileTypeMenuItem(void); static void DisposeFileTypeMenuItem(const struct FileTypeDef *ParentFtd, struct FileTypeMenuItem *ftmi); static struct FileTypeTTItem *NewFileTypeTTItem(enum TTItemTypes type); static void DisposeFileTypeTTItem(struct FileTypeTTItem *ftti); -static void FreeMenuTree(const struct FileTypeDef *ParentFtd, struct ScalosMenuTree *mTree); +static void FreeMenuTree(const struct FileTypeDef *ParentFtd, struct SCALOS_MENUTREE *mTree); static struct FileTypeDef *GetFileTypeDefForName(CONST_STRPTR Name); static void AddFileTypeDef(struct FileTypeDef *ftd, CONST_STRPTR Name); static void FileTypeFlushObsolete(void); @@ -1276,14 +1276,14 @@ static IPTR FtInternalCmd(struct FileTypeDef *ftd, IPTR *ArgArray) { struct FileTypeMenuItem *ftmi = ftd->ftd_CurrentMenuItem; CONST_STRPTR cmdName = (CONST_STRPTR) ArgArray[0]; - struct ScalosMenuTree *mTree; + struct SCALOS_MENUTREE *mTree; d1(KPrintF("%s/%s/%ld: cmdName=<%s>\n", __FILE__, __FUNC__, __LINE__, cmdName)); if (NULL == ftmi) return RETURN_ERROR; - mTree = ScalosAlloc(sizeof(struct ScalosMenuTree)); + mTree = ScalosAlloc(sizeof(struct SCALOS_MENUTREE)); if (mTree) { d1(KPrintF("%s/%s/%ld: ftmi_MenuTree=%08lx\n", __FILE__, __FUNC__, __LINE__, ftmi->ftmi_MenuTree)); @@ -1315,14 +1315,14 @@ static IPTR FtWbCmd(struct FileTypeDef *ftd, IPTR *ArgArray) ULONG *StackSize = (ULONG *) ArgArray[1]; ULONG wbArgs = ArgArray[2]; ULONG *Priority = (ULONG *) ArgArray[3]; - struct ScalosMenuTree *mTree; + struct SCALOS_MENUTREE *mTree; d1(kprintf("%s/%s/%ld: cmdName=<%s> StackSize=%08lx wbArgs=%ld\n", __FILE__, __FUNC__, __LINE__, cmdName, StackSize, wbArgs)); if (NULL == ftmi) return RETURN_ERROR; - mTree = ScalosAlloc(sizeof(struct ScalosMenuTree)); + mTree = ScalosAlloc(sizeof(struct SCALOS_MENUTREE)); if (mTree) { AppendToMenuTree(&ftmi->ftmi_MenuTree, mTree); @@ -1360,14 +1360,14 @@ static IPTR FtARexxCmd(struct FileTypeDef *ftd, IPTR *ArgArray) ULONG *StackSize = (ULONG *) ArgArray[1]; ULONG wbArgs = ArgArray[2]; ULONG *Priority = (ULONG *) ArgArray[3]; - struct ScalosMenuTree *mTree; + struct SCALOS_MENUTREE *mTree; d1(kprintf("%s/%s/%ld: cmdName=<%s> StackSize=%08lx wbArgs=%ld\n", __FILE__, __FUNC__, __LINE__, cmdName, StackSize, wbArgs)); if (NULL == ftmi) return RETURN_ERROR; - mTree = ScalosAlloc(sizeof(struct ScalosMenuTree)); + mTree = ScalosAlloc(sizeof(struct SCALOS_MENUTREE)); if (mTree) { AppendToMenuTree(&ftmi->ftmi_MenuTree, mTree); @@ -1405,14 +1405,14 @@ static IPTR FtCliCmd(struct FileTypeDef *ftd, IPTR *ArgArray) ULONG *StackSize = (ULONG *) ArgArray[1]; ULONG wbArgs = ArgArray[2]; ULONG *Priority = (ULONG *) ArgArray[3]; - struct ScalosMenuTree *mTree; + struct SCALOS_MENUTREE *mTree; d1(kprintf("%s/%s/%ld: cmdName=<%s> StackSize=%08lx\n", __FILE__, __FUNC__, __LINE__, cmdName, StackSize)); if (NULL == ftmi) return RETURN_ERROR; - mTree = ScalosAlloc(sizeof(struct ScalosMenuTree)); + mTree = ScalosAlloc(sizeof(struct SCALOS_MENUTREE)); if (mTree) { AppendToMenuTree(&ftmi->ftmi_MenuTree, mTree); @@ -1447,14 +1447,14 @@ static IPTR FtPluginCmd(struct FileTypeDef *ftd, IPTR *ArgArray) { struct FileTypeMenuItem *ftmi = ftd->ftd_CurrentMenuItem; CONST_STRPTR cmdName = (CONST_STRPTR) ArgArray[0]; - struct ScalosMenuTree *mTree; + struct SCALOS_MENUTREE *mTree; d1(kprintf("%s/%s/%ld: cmdName=<%s>\n", __FILE__, __FUNC__, __LINE__, cmdName)); if (NULL == ftmi) return RETURN_ERROR; - mTree = ScalosAlloc(sizeof(struct ScalosMenuTree)); + mTree = ScalosAlloc(sizeof(struct SCALOS_MENUTREE)); if (mTree) { AppendToMenuTree(&ftmi->ftmi_MenuTree, mTree); @@ -1480,14 +1480,14 @@ static IPTR FtIconWindowCmd(struct FileTypeDef *ftd, IPTR *ArgArray) { struct FileTypeMenuItem *ftmi = ftd->ftd_CurrentMenuItem; CONST_STRPTR cmdName = (CONST_STRPTR) ArgArray[0]; - struct ScalosMenuTree *mTree; + struct SCALOS_MENUTREE *mTree; d1(kprintf("%s/%s/%ld: cmdName=<%s>\n", __FILE__, __FUNC__, __LINE__, cmdName)); if (NULL == ftmi) return RETURN_ERROR; - mTree = ScalosAlloc(sizeof(struct ScalosMenuTree)); + mTree = ScalosAlloc(sizeof(struct SCALOS_MENUTREE)); if (mTree) { AppendToMenuTree(&ftmi->ftmi_MenuTree, mTree); @@ -2251,13 +2251,13 @@ LONG ConvertPenNameToPen(CONST_STRPTR PenName) } -static void FreeMenuTree(const struct FileTypeDef *ParentFtd, struct ScalosMenuTree *mTree) +static void FreeMenuTree(const struct FileTypeDef *ParentFtd, struct SCALOS_MENUTREE *mTree) { d1(kprintf("%s/%s/%ld: ParentFtd=%08lx, mTree=%08lx\n", __FILE__, __FUNC__, __LINE__, ParentFtd, mTree)); while (mTree) { - struct ScalosMenuTree *mTreeNext = mTree->mtre_Next; + struct SCALOS_MENUTREE *mTreeNext = mTree->mtre_Next; // Do NOT free parent's ftd_DefaultAction here! if (NULL == ParentFtd || mTree != ParentFtd->ftd_DefaultAction) diff --git a/scalos/main/functions.h b/scalos/main/functions.h index eaef65fc3..97c4d7e46 100755 --- a/scalos/main/functions.h +++ b/scalos/main/functions.h @@ -10,7 +10,6 @@ #include #include #include -#include #include #include "defs.h" @@ -1025,9 +1024,9 @@ BOOL isMakeLinkQualifier(ULONG Qualifier); BOOL isMoveQualifier(ULONG Qualifier); BOOL isAlternateLssoQualifier(ULONG Qualifier); void RunMenuCommand(struct internalScaWindowTask *iwt, - struct ScalosMenuTree *mtr, struct ScaIconNode *in, ULONG Flags); + struct SCALOS_MENUTREE *mtr, struct ScaIconNode *in, ULONG Flags); void RunMenuCommandExt(struct internalScaWindowTask *iwt, struct internalScaWindowTask *iwtDest, - struct ScalosMenuTree *mtr, struct ScaIconNode *in, ULONG Flags); + struct SCALOS_MENUTREE *mtr, struct ScaIconNode *in, ULONG Flags); LONG ScalosPutIcon(struct ScaIconNode *in, BPTR destDirLock, BOOL NeedUpdateIcon); Object *LoadIconObject(BPTR DirLock, CONST_STRPTR IconName, struct TagItem *TagList); LONG SaveIconObject(Object *IconObj, BPTR DirLock, @@ -1045,9 +1044,9 @@ ULONG DisposeScalosWindow(struct internalScaWindowTask *iwt, struct ScaWindowStr void AdjustRenamedWindowName(BPTR objLock); void LockWindow(struct internalScaWindowTask *iwt); void UnLockWindow(struct internalScaWindowTask *iwt); -struct ScalosMenuTree *CloneMenuTree(const struct ScalosMenuTree *mtr); -void DisposeMenuTree(struct ScalosMenuTree *mtr); -void AppendToMenuTree(struct ScalosMenuTree **mtreList, struct ScalosMenuTree *mTree); +struct SCALOS_MENUTREE *CloneMenuTree(const struct SCALOS_MENUTREE *mtr); +void DisposeMenuTree(struct SCALOS_MENUTREE *mtr); +void AppendToMenuTree(struct SCALOS_MENUTREE **mtreList, struct SCALOS_MENUTREE *mTree); void SetIconWindowReadOnly(struct internalScaWindowTask *iwt, BOOL IsReadOnly); void RedrawResizedWindow(struct internalScaWindowTask *iwt, WORD OldInnerWidth, WORD OldInnerHeight); diff --git a/scalos/main/idcmp.c b/scalos/main/idcmp.c index 1ebf2144b..dcd0be18d 100755 --- a/scalos/main/idcmp.c +++ b/scalos/main/idcmp.c @@ -521,12 +521,12 @@ static ULONG IDCMPMenuPick(struct internalScaWindowTask *iwt, struct IntuiMessag while ((WORD) MENUNULL != code) { struct MenuItem *mItem = ItemAddress(MainMenu, code); - struct ScalosMenuTree *mTree; + struct SCALOS_MENUTREE *mTree; if (NULL == mItem) break; - mTree = (struct ScalosMenuTree *) GTMENUITEM_USERDATA(mItem); + mTree = (struct SCALOS_MENUTREE *) GTMENUITEM_USERDATA(mItem); if (mTree) { struct AppObject *appo = (struct AppObject *) mTree; @@ -1294,7 +1294,7 @@ static void ArrowUp(struct internalScaWindowTask *iwt, struct IntuiMessage *iMsg static void SetPropBottom(struct internalScaWindowTask *iwt) { - ULONG Top; + IPTR Top; GetAttr(PGA_Top, (Object *) iwt->iwt_PropBottom, &Top); @@ -1329,7 +1329,7 @@ static void SetPropBottom(struct internalScaWindowTask *iwt) static void SetPropSide(struct internalScaWindowTask *iwt) { - ULONG Top; + IPTR Top; GetAttr(PGA_Top, (Object *) iwt->iwt_PropSide, &Top); diff --git a/scalos/main/mmakefile.src b/scalos/main/mmakefile.src index 9d7352b25..5bfe549a3 100644 --- a/scalos/main/mmakefile.src +++ b/scalos/main/mmakefile.src @@ -116,10 +116,11 @@ FILES := about \ Patches-aros \ ScaLibrary-aros +NOWARN_FLAGS := -Wno-discarded-qualifiers USER_INCLUDES := -I$(AROS_CONTRIB)/Scalos/Development/include -idirafter $(SRCDIR)/$(CURDIR)/../include -I$(SRCDIR)/$(CURDIR)/../common/McpGfx \ -I$(SRCDIR)/$(CURDIR)/../common/Fs -I$(SRCDIR)/$(CURDIR)/../common/Int64 -I$(SRCDIR)/$(CURDIR) SCALOS_LOCALE := Scalos_Locale.h -USER_CFLAGS := -D__UTILITY_STDLIBBASE__ -D__REXXSYSLIB_STDLIBBASE__ -D__LOCALE_STDLIBBASE__ \ +USER_CFLAGS := $(NOWARN_FLAGS) -D__UTILITY_STDLIBBASE__ -D__REXXSYSLIB_STDLIBBASE__ -D__LOCALE_STDLIBBASE__ \ -D__CONSOLE_STDLIBBASE__ -DSCALOSLOCALE=$(SCALOS_LOCALE) TARGETDIR := $(AROS_CONTRIB)/Scalos diff --git a/scalos/main/scalos_structures.h b/scalos/main/scalos_structures.h index d3a9c809f..cf83c7afb 100755 --- a/scalos/main/scalos_structures.h +++ b/scalos/main/scalos_structures.h @@ -16,6 +16,7 @@ #include #include "Semaphores.h" #include +#include #include #include #include @@ -1284,7 +1285,7 @@ struct FileTypeDef STRPTR ftd_Description; // textual description of file type - struct ScalosMenuTree *ftd_DefaultAction; // default action on double click + struct SCALOS_MENUTREE *ftd_DefaultAction; // default action on double click BPTR ftd_FileTypesDirLock; // Lock on filetype descriptions' directory -- 2.11.4.GIT