From ade86e496ea4bc27b6edab125bad9f5dc4bb3852 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 12 Oct 2013 13:11:13 +0100 Subject: Replace AllocVec with AllocVecTags. Remove some instances of MEMF_CLEAR where it is not necessary. --- amiga/arexx.c | 2 +- amiga/bitmap.c | 2 +- amiga/clipboard.c | 8 ++++---- amiga/download.c | 2 +- amiga/dt_anim.c | 2 +- amiga/file.c | 4 ++-- amiga/filetype.c | 4 ++-- amiga/font.c | 2 +- amiga/font_scan.c | 4 ++-- amiga/gui.c | 12 ++++++------ amiga/gui_options.c | 4 ++-- amiga/history_local.c | 2 +- amiga/icon.c | 5 ++--- amiga/iff_dr2d.c | 8 ++++---- amiga/launch.c | 3 +-- amiga/login.c | 3 ++- amiga/menu.c | 10 +++++----- amiga/object.c | 4 ++-- amiga/plotters.c | 15 +++++++-------- amiga/print.c | 10 ++++------ amiga/schedule.c | 4 ++-- amiga/search.c | 2 +- amiga/stringview/urlhistory.c | 13 ++++++++++--- amiga/theme.c | 4 ++-- amiga/tree.c | 7 +++---- 25 files changed, 69 insertions(+), 67 deletions(-) (limited to 'amiga') diff --git a/amiga/arexx.c b/amiga/arexx.c index 436aa8f49..472aea1ce 100644 --- a/amiga/arexx.c +++ b/amiga/arexx.c @@ -239,7 +239,7 @@ STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu { if(!bw) return; - dln = AllocVec(sizeof(struct dlnode),MEMF_PRIVATE | MEMF_CLEAR); + dln = AllocVecTags(sizeof(struct dlnode), AVT_ClearWithValue, 0, TAG_DONE); dln->filename = strdup((char *)cmd->ac_ArgList[3]); dln->node.ln_Name = strdup((char *)cmd->ac_ArgList[0]); dln->node.ln_Type = NT_USER; diff --git a/amiga/bitmap.c b/amiga/bitmap.c index 0704129ec..dfa2ba52c 100644 --- a/amiga/bitmap.c +++ b/amiga/bitmap.c @@ -49,7 +49,7 @@ void *bitmap_create(int width, int height, unsigned int state) { struct bitmap *bitmap; - bitmap = AllocVec(sizeof(struct bitmap),MEMF_PRIVATE | MEMF_CLEAR); + bitmap = AllocVecTags(sizeof(struct bitmap), AVT_ClearWithValue, 0, TAG_DONE); if(bitmap) { bitmap->pixdata = AllocVecTags(width*height*4, diff --git a/amiga/clipboard.c b/amiga/clipboard.c index fd42f4d61..e02344c96 100644 --- a/amiga/clipboard.c +++ b/amiga/clipboard.c @@ -135,10 +135,10 @@ char *ami_clipboard_cat_collection(struct CollectionItem *ci, LONG codeset, size case 0: if(ci_new) { - ci_next->ci_Next = AllocVec(sizeof(struct CollectionItem), MEMF_PRIVATE | MEMF_CLEAR); + ci_next->ci_Next = AllocVecTags(sizeof(struct CollectionItem), AVT_ClearWithValue, 0, TAG_DONE); ci_next = ci_next->ci_Next; } else { - ci_new = AllocVec(sizeof(struct CollectionItem), MEMF_PRIVATE | MEMF_CLEAR); + ci_new = AllocVecTags(sizeof(struct CollectionItem), AVT_ClearWithValue, 0, TAG_DONE); ci_next = ci_new; } @@ -149,10 +149,10 @@ char *ami_clipboard_cat_collection(struct CollectionItem *ci, LONG codeset, size default: if(ci_new) { - ci_next->ci_Next = AllocVec(sizeof(struct CollectionItem), MEMF_PRIVATE | MEMF_CLEAR); + ci_next->ci_Next = AllocVecTags(sizeof(struct CollectionItem), AVT_ClearWithValue, 0, TAG_DONE); ci_next = ci_next->ci_Next; } else { - ci_new = AllocVec(sizeof(struct CollectionItem), MEMF_PRIVATE | MEMF_CLEAR); + ci_new = AllocVecTags(sizeof(struct CollectionItem), AVT_ClearWithValue, 0, TAG_DONE); ci_next = ci_new; } diff --git a/amiga/download.c b/amiga/download.c index fc68e2a89..52baedb24 100644 --- a/amiga/download.c +++ b/amiga/download.c @@ -94,7 +94,7 @@ struct gui_download_window *gui_download_window_create(download_context *ctx, struct gui_download_window *dw; APTR va[3]; - dw = AllocVec(sizeof(struct gui_download_window),MEMF_PRIVATE | MEMF_CLEAR); + dw = AllocVecTags(sizeof(struct gui_download_window), AVT_ClearWithValue, 0, TAG_DONE); if(gui && (!IsListEmpty(&gui->dllist)) && (dw->dln = (struct dlnode *)FindName(&gui->dllist,url))) { diff --git a/amiga/dt_anim.c b/amiga/dt_anim.c index 221f331fb..c84470052 100644 --- a/amiga/dt_anim.c +++ b/amiga/dt_anim.c @@ -340,7 +340,7 @@ content_type amiga_dt_anim_content_type(void) APTR ami_colormap_to_clut(struct ColorMap *cmap) { int i; - UBYTE *clut = AllocVec(256 * 4, MEMF_CLEAR); + UBYTE *clut = AllocVecTags(256 * 4, AVT_ClearWithValue, 0, TAG_DONE); /* NB: Was not MEMF_PRIVATE */ ULONG colour[3 * 256]; if(!clut) return NULL; diff --git a/amiga/file.c b/amiga/file.c index 694285738..937fb9052 100644 --- a/amiga/file.c +++ b/amiga/file.c @@ -91,7 +91,7 @@ void ami_file_open(struct gui_window_2 *gwin) ASLFR_FilterFunc, &aslhookfunc, TAG_DONE)) { - if(temp = AllocVec(1024,MEMF_PRIVATE | MEMF_CLEAR)) + if(temp = AllocVecTagList(1024, NULL)) { strlcpy(temp, filereq->fr_Drawer, 1024); AddPart(temp, filereq->fr_File, 1024); @@ -228,7 +228,7 @@ void ami_file_save(int type, char *fname, struct Window *win, void ami_file_save_req(int type, struct gui_window_2 *gwin, struct hlcache_handle *object) { - char *fname = AllocVec(1024, MEMF_CLEAR | MEMF_PRIVATE); + char *fname = AllocVecTags(1024, NULL); if(AslRequestTags(savereq, ASLFR_Window, gwin->win, diff --git a/amiga/filetype.c b/amiga/filetype.c index 7808ff7d2..39e874ab0 100644 --- a/amiga/filetype.c +++ b/amiga/filetype.c @@ -218,7 +218,7 @@ nserror ami_mime_init(const char *mimefile) if(ReadArgs(template, rarray, rargs)) { node = AddObject(ami_mime_list, AMINS_MIME); - mimeentry = AllocVec(sizeof(struct ami_mime_entry), MEMF_PRIVATE | MEMF_CLEAR); + mimeentry = AllocVecTags(sizeof(struct ami_mime_entry), AVT_ClearWithValue, 0, TAG_DONE); node->objstruct = mimeentry; if(rarray[AMI_MIME_MIMETYPE]) @@ -366,7 +366,7 @@ APTR ami_mime_guess_add_datatype(struct DataType *dt, lwc_string **lwc_mimetype) char *p; node = AddObject(ami_mime_list, AMINS_MIME); - mimeentry = AllocVec(sizeof(struct ami_mime_entry), MEMF_PRIVATE | MEMF_CLEAR); + mimeentry = AllocVecTags(sizeof(struct ami_mime_entry), AVT_ClearWithValue, 0, TAG_DONE); node->objstruct = mimeentry; lerror = lwc_intern_string(dth->dth_Name, strlen(dth->dth_Name), &mimeentry->datatype); diff --git a/amiga/font.c b/amiga/font.c index 310d8bec3..36c810428 100755 --- a/amiga/font.c +++ b/amiga/font.c @@ -383,7 +383,7 @@ struct ami_font_node *ami_font_open(const char *font) LOG(("Font cache miss: %s", font)); - nodedata = AllocVec(sizeof(struct ami_font_node), MEMF_PRIVATE | MEMF_CLEAR); + nodedata = AllocVecTagList(sizeof(struct ami_font_node), NULL); nodedata->font = OpenOutlineFont(font, &ami_diskfontlib_list, OFF_OPEN); if(!nodedata->font) diff --git a/amiga/font_scan.c b/amiga/font_scan.c index b1732da3e..f3ad36e6f 100644 --- a/amiga/font_scan.c +++ b/amiga/font_scan.c @@ -91,7 +91,7 @@ const char *ami_font_scan_lookup(uint16 *code, lwc_string **glypharray) struct ami_font_scan_window *ami_font_scan_gui_open(int32 fonts) { struct ami_font_scan_window *fsw = - AllocVec(sizeof(struct ami_font_scan_window), MEMF_PRIVATE); + AllocVecTagList(sizeof(struct ami_font_scan_window), NULL); if(fsw == NULL) return NULL; @@ -301,7 +301,7 @@ ULONG ami_font_scan_list(struct MinList *list) struct nsObject *node; do { - if(afh = (struct AvailFontsHeader *)AllocVec(afSize, MEMF_PRIVATE)) { + if(afh = (struct AvailFontsHeader *)AllocVecTagList(afSize, NULL)) { if(afShortage = AvailFonts(afh, afSize, AFF_DISK | AFF_OTAG | AFF_SCALED)) { FreeVec(afh); afSize += afShortage; diff --git a/amiga/gui.c b/amiga/gui.c index 962c3a180..cbd713471 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -1323,7 +1323,7 @@ struct IBox *ami_ns_rect_to_ibox(struct gui_window_2 *gwin, const struct rect *r { struct IBox *bbox, *ibox; - ibox = AllocVec(sizeof(struct IBox), MEMF_CLEAR | MEMF_PRIVATE); + ibox = AllocVecTagList(sizeof(struct IBox), NULL); if(ibox == NULL) return NULL; GetAttr(SPACE_AreaBox, (Object *)gwin->objects[GID_BROWSER], (ULONG *)&bbox); @@ -2312,7 +2312,7 @@ void ami_handle_appmsg(void) { if(appwinargs = &appmsg->am_ArgList[i]) { - if(filename = AllocVec(1024, MEMF_PRIVATE | MEMF_CLEAR)) + if(filename = AllocVecTagList(1024, NULL)) { if(appwinargs->wa_Lock) { @@ -3146,7 +3146,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw, } } - g = AllocVec(sizeof(struct gui_window),MEMF_PRIVATE | MEMF_CLEAR); + g = AllocVecTags(sizeof(struct gui_window), AVT_ClearWithValue, 0, TAG_DONE); if(!g) { @@ -3215,7 +3215,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw, return g; } - g->shared = AllocVec(sizeof(struct gui_window_2),MEMF_PRIVATE | MEMF_CLEAR); + g->shared = AllocVecTags(sizeof(struct gui_window_2), AVT_ClearWithValue, 0, TAG_DONE); if(!g->shared) { @@ -3268,7 +3268,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw, g->shared->tabs=1; g->shared->next_tab=1; - g->shared->svbuffer = AllocVec(2000, MEMF_CLEAR); + g->shared->svbuffer = AllocVecTagList(2000, NULL); g->shared->helphints[GID_BACK] = translate_escape_chars(messages_get("HelpToolbarBack")); @@ -4204,7 +4204,7 @@ void gui_window_update_box(struct gui_window *g, const struct rect *rect) if(!g) return; if(ami_gui_window_update_box_deferred_check(g->deferred_rects, rect)) { - deferred_rect = AllocVec(sizeof(struct rect), MEMF_PRIVATE); + deferred_rect = AllocVecTagList(sizeof(struct rect), NULL); CopyMem(rect, deferred_rect, sizeof(struct rect)); nsobj = AddObject(g->deferred_rects, AMINS_RECT); nsobj->objstruct = deferred_rect; diff --git a/amiga/gui_options.c b/amiga/gui_options.c index 4da3d353e..2a7b9f5f7 100755 --- a/amiga/gui_options.c +++ b/amiga/gui_options.c @@ -520,7 +520,7 @@ void ami_gui_opts_open(void) { ami_gui_opts_setup(); - gow = AllocVec(sizeof(struct ami_gui_opts_window),MEMF_CLEAR | MEMF_PRIVATE); + gow = AllocVecTags(sizeof(struct ami_gui_opts_window), AVT_ClearWithValue, 0, TAG_DONE); gow->objects[OID_MAIN] = WindowObject, WA_ScreenTitle,nsscreentitle, @@ -2116,7 +2116,7 @@ STRPTR *ami_gui_opts_websearch(void) ULONG ref = 0; STRPTR *websearchlist; - websearchlist = AllocVec(200, MEMF_CLEAR); + websearchlist = AllocVecTagList(200, NULL); /* NB: Was not MEMF_PRIVATE */ if (nsoption_charp(search_engines_file) == NULL) return websearchlist; diff --git a/amiga/history_local.c b/amiga/history_local.c index 520327686..b5aba3825 100755 --- a/amiga/history_local.c +++ b/amiga/history_local.c @@ -82,7 +82,7 @@ void ami_history_open(struct browser_window *bw, struct history *history) if(!hwindow) { - hwindow = AllocVec(sizeof(struct history_window),MEMF_CLEAR | MEMF_PRIVATE); + hwindow = AllocVecTags(sizeof(struct history_window), AVT_ClearWithValue, 0, TAG_DONE); ami_init_layers(&hwindow->gg, scrn->Width, scrn->Height); diff --git a/amiga/icon.c b/amiga/icon.c index 641095bc4..c5bc6ae1f 100644 --- a/amiga/icon.c +++ b/amiga/icon.c @@ -326,7 +326,7 @@ ULONG *amiga_icon_convertcolouricon32(UBYTE *icondata, ULONG width, ULONG height if (alpha==0) alpha=0xff; - argbicon = (ULONG *)AllocVec(width*height*4,MEMF_CLEAR); + argbicon = (ULONG *)AllocVecTagList(width*height*4, NULL); if (!argbicon) return(NULL); cmap=GetColorMap(pals1); @@ -504,8 +504,7 @@ struct DiskObject *amiga_icon_from_bitmap(struct bitmap *bm) { bitmap = ami_bitmap_get_native(bm, THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT, NULL); - bm->icondata = AllocVec(THUMBNAIL_WIDTH * 4 * THUMBNAIL_HEIGHT, - MEMF_CLEAR); + bm->icondata = AllocVecTagList(THUMBNAIL_WIDTH * 4 * THUMBNAIL_HEIGHT, NULL); BltBitMapTags(BLITA_Width, THUMBNAIL_WIDTH, BLITA_Height, THUMBNAIL_HEIGHT, diff --git a/amiga/iff_dr2d.c b/amiga/iff_dr2d.c index b428ed25f..0638b94a6 100644 --- a/amiga/iff_dr2d.c +++ b/amiga/iff_dr2d.c @@ -165,7 +165,7 @@ bool ami_svg_to_dr2d(struct IFFHandle *iffh, const char *buffer, } for (i = 0; i != diagram->shape_count; i++) { - attr = AllocVec(sizeof(struct attr_struct),MEMF_CLEAR | MEMF_PRIVATE); + attr = AllocVecTagList(sizeof(struct attr_struct), NULL); if (diagram->shape[i].fill == svgtiny_TRANSPARENT) attr->FillType = FT_NONE; else @@ -266,13 +266,13 @@ bool ami_svg_to_dr2d(struct IFFHandle *iffh, const char *buffer, PopChunk(iffh); } } else if (diagram->shape[i].text) { - stxt = AllocVec(sizeof(struct stxt_struct),MEMF_CLEAR); + stxt = AllocVecTagList(sizeof(struct stxt_struct), NULL); stxt->BaseX = diagram->shape[i].text_x; stxt->BaseY = diagram->shape[i].text_y; stxt->NumChars = strlen(diagram->shape[i].text); if(!fons_written) { - fons = AllocVec(sizeof(struct fons_struct),MEMF_CLEAR); + fons = AllocVecTagList(sizeof(struct fons_struct), NULL); if(!(PushChunk(iffh,0,ID_FONS,IFFSIZE_UNKNOWN))) { WriteChunkBytes(iffh,fons,sizeof(struct fons_struct)); @@ -366,7 +366,7 @@ int main(int argc, char **argv) { size = GetFileSize(fh); - buffer = AllocVec((uint32)size,MEMF_PRIVATE); + buffer = AllocVecTagList((uint32)size, NULL); Read(fh,buffer,(uint32)size); Close(fh); diff --git a/amiga/launch.c b/amiga/launch.c index 3236e797b..ebd82294a 100755 --- a/amiga/launch.c +++ b/amiga/launch.c @@ -47,8 +47,7 @@ struct ami_protocol struct ami_protocol *ami_openurl_add_protocol(const char *url) { struct ami_protocol *ami_p = - (struct ami_protocol *)AllocVec(sizeof(struct ami_protocol), - MEMF_PRIVATE | MEMF_CLEAR); + (struct ami_protocol *)AllocVecTagList(sizeof(struct ami_protocol), NULL); if(url_scheme(url, &ami_p->protocol) != URL_FUNC_OK) { diff --git a/amiga/login.c b/amiga/login.c index e70002c81..816ece675 100755 --- a/amiga/login.c +++ b/amiga/login.c @@ -59,7 +59,8 @@ void gui_401login_open(nsurl *url, const char *realm, nserror (*cb)(bool proceed, void *pw), void *cbpw) { const char *auth; - struct gui_login_window *lw = AllocVec(sizeof(struct gui_login_window),MEMF_PRIVATE | MEMF_CLEAR); + struct gui_login_window *lw = AllocVecTags(sizeof(struct gui_login_window), + AVT_ClearWithValue, 0, TAG_DONE); lwc_string *host = nsurl_get_component(url, NSURL_HOST); assert(host != NULL); diff --git a/amiga/menu.c b/amiga/menu.c index 3280bdedd..c8c085a07 100644 --- a/amiga/menu.c +++ b/amiga/menu.c @@ -188,7 +188,7 @@ void ami_init_menulabs(struct gui_window_2 *gwin) { int i; - gwin->menutype = AllocVec(AMI_MENU_AREXX_MAX + 1, MEMF_PRIVATE | MEMF_CLEAR); + gwin->menutype = AllocVecTagList(AMI_MENU_AREXX_MAX + 1, NULL); for(i=0;i <= AMI_MENU_AREXX_MAX;i++) { @@ -458,7 +458,7 @@ struct NewMenu *ami_create_menu(struct gui_window_2 *gwin) { int i; - gwin->menu = AllocVec(sizeof(struct NewMenu) * (AMI_MENU_AREXX_MAX + 1), MEMF_CLEAR); + gwin->menu = AllocVecTagList(sizeof(struct NewMenu) * (AMI_MENU_AREXX_MAX + 1), NULL); /* NB: Was not MEMF_PRIVATE */ ami_init_menulabs(gwin); ami_menu_scan(ami_tree_get_tree(hotlist_window), gwin); ami_menu_arexx_scan(gwin); @@ -499,7 +499,7 @@ void ami_menu_arexx_scan(struct gui_window_2 *gwin) if(lock = Lock(nsoption_charp(arexx_dir), SHARED_LOCK)) { - if(buffer = AllocVec(1024,MEMF_PRIVATE | MEMF_CLEAR)) + if(buffer = AllocVecTagList(1024, NULL)) { if(ctrl = AllocDosObject(DOS_EXALLCONTROL,NULL)) { @@ -1093,7 +1093,7 @@ static void ami_menu_item_arexx_execute(struct Hook *hook, APTR window, struct I ASLFR_InitialPattern, "#?.nsrx", TAG_DONE)) { - if(temp = AllocVec(1024,MEMF_PRIVATE | MEMF_CLEAR)) + if(temp = AllocVecTagList(1024, NULL)) { strlcpy(temp, filereq->fr_Drawer, 1024); AddPart(temp, filereq->fr_File, 1024); @@ -1112,7 +1112,7 @@ static void ami_menu_item_arexx_entries(struct Hook *hook, APTR window, struct I if(script) { - if(temp = AllocVec(1024, MEMF_PRIVATE | MEMF_CLEAR)) + if(temp = AllocVecTagList(1024, NULL)) { strcpy(temp, nsoption_charp(arexx_dir)); AddPart(temp, script, 1024); diff --git a/amiga/object.c b/amiga/object.c index c028ea369..a70efdd7c 100755 --- a/amiga/object.c +++ b/amiga/object.c @@ -29,7 +29,7 @@ struct MinList *NewObjList(void) struct MinList *objlist; - objlist = (struct MinList *)AllocVec(sizeof(struct MinList),MEMF_PRIVATE | MEMF_CLEAR); + objlist = (struct MinList *)AllocVecTagList(sizeof(struct MinList), NULL); NewMinList(objlist); @@ -41,7 +41,7 @@ struct nsObject *AddObject(struct MinList *objlist, ULONG otype) { struct nsObject *dtzo; - dtzo = (struct nsObject *)AllocVec(sizeof(struct nsObject),MEMF_PRIVATE | MEMF_CLEAR); + dtzo = (struct nsObject *)AllocVecTagList(sizeof(struct nsObject), NULL); AddTail((struct List *)objlist,(struct Node *)dtzo); diff --git a/amiga/plotters.c b/amiga/plotters.c index b2544da93..42b523911 100755 --- a/amiga/plotters.c +++ b/amiga/plotters.c @@ -158,8 +158,8 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height) if(!height) height = nsoption_int(redraw_tile_size_y); gg->layerinfo = NewLayerInfo(); - gg->areabuf = AllocVec(AREA_SIZE, MEMF_PRIVATE | MEMF_CLEAR); - gg->tmprasbuf = AllocVec(width * height, MEMF_PRIVATE | MEMF_CLEAR); + gg->areabuf = AllocVecTagList(AREA_SIZE, NULL); + gg->tmprasbuf = AllocVecTagList(width * height, NULL); if(palette_mapped == true) { gg->bm = AllocBitMap(width, height, depth, @@ -171,7 +171,7 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height) if(!gg->bm) warn_user("NoMemory",""); - gg->rp = AllocVec(sizeof(struct RastPort), MEMF_PRIVATE | MEMF_CLEAR); + gg->rp = AllocVecTagList(sizeof(struct RastPort), NULL); if(!gg->rp) warn_user("NoMemory",""); InitRastPort(gg->rp); @@ -185,12 +185,12 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height) InstallLayerHook(gg->rp->Layer,LAYERS_NOBACKFILL); - gg->rp->AreaInfo = AllocVec(sizeof(struct AreaInfo),MEMF_PRIVATE | MEMF_CLEAR); + gg->rp->AreaInfo = AllocVecTagList(sizeof(struct AreaInfo), NULL); if((!gg->areabuf) || (!gg->rp->AreaInfo)) warn_user("NoMemory",""); InitArea(gg->rp->AreaInfo,gg->areabuf, AREA_SIZE/5); - gg->rp->TmpRas = AllocVec(sizeof(struct TmpRas),MEMF_PRIVATE | MEMF_CLEAR); + gg->rp->TmpRas = AllocVecTagList(sizeof(struct TmpRas), NULL); if((!gg->tmprasbuf) || (!gg->rp->TmpRas)) warn_user("NoMemory",""); @@ -251,8 +251,7 @@ static ULONG ami_plot_obtain_pen(struct MinList *shared_pens, ULONG colour) if(pen == -1) LOG(("WARNING: Cannot allocate pen for ABGR:%lx", colour)); if(shared_pens != NULL) { - if(node = (struct ami_plot_pen *)AllocVec(sizeof(struct ami_plot_pen), - MEMF_PRIVATE | MEMF_CLEAR)) { + if(node = (struct ami_plot_pen *)AllocVecTagList(sizeof(struct ami_plot_pen), NULL)) { AddTail((struct List *)shared_pens, (struct Node *)node); } } else { @@ -829,7 +828,7 @@ bool ami_bitmap_tile(int x, int y, int width, int height, bfbm.offsetx = ox; bfbm.offsety = oy; bfbm.mask = ami_bitmap_get_mask(bitmap, width, height, tbm); - bfh = AllocVec(sizeof(struct Hook),MEMF_CLEAR); + bfh = AllocVecTags(sizeof(struct Hook), AVT_ClearWithValue, 0, TAG_DONE); /* NB: Was not MEMF_PRIVATE */ bfh->h_Entry = (HOOKFUNC)ami_bitmap_tile_hook; bfh->h_SubEntry = 0; bfh->h_Data = &bfbm; diff --git a/amiga/print.c b/amiga/print.c index f0689f73a..4bfce139b 100644 --- a/amiga/print.c +++ b/amiga/print.c @@ -212,19 +212,18 @@ void ami_print_ui(struct hlcache_handle *c) char filename[30]; int i; - struct ami_print_window *pw = AllocVec(sizeof(struct ami_print_window), - MEMF_PRIVATE | MEMF_CLEAR); + struct ami_print_window *pw = AllocVecTags(sizeof(struct ami_print_window), AVT_ClearWithValue, 0, TAG_DONE); pw->c = c; - printers[0] = AllocVec(50, MEMF_PRIVATE | MEMF_CLEAR); + printers[0] = AllocVecTags(50, AVT_ClearWithValue, 0, TAG_DONE); ami_print_readunit("ENV:Sys/printer.prefs", printers[0], 50, 0); strcpy(filename,"ENV:Sys/printerN.prefs"); for (i = 1; i < 10; i++) { filename[15] = '0' + i; - printers[i] = AllocVec(50, MEMF_PRIVATE | MEMF_CLEAR); + printers[i] = AllocVecTagList(50, NULL); if(!ami_print_readunit(filename, printers[i], 50, i)) { FreeVec(printers[i]); @@ -461,8 +460,7 @@ struct MsgPort *ami_print_get_msgport(void) bool ami_print_begin(struct print_settings *ps) { - ami_print_info.gg = AllocVec(sizeof(struct gui_globals), - MEMF_PRIVATE | MEMF_CLEAR); + ami_print_info.gg = AllocVecTags(sizeof(struct gui_globals), AVT_ClearWithValue, 0, TAG_DONE); if(!ami_print_info.gg) return false; ami_init_layers(ami_print_info.gg, diff --git a/amiga/schedule.c b/amiga/schedule.c index 260225b37..d4b35a509 100755 --- a/amiga/schedule.c +++ b/amiga/schedule.c @@ -58,7 +58,7 @@ void schedule(int t, void (*callback)(void *p), void *p) if(schedule_list == NULL) return; - nscb = AllocVec(sizeof(struct nscallback), MEMF_PRIVATE | MEMF_CLEAR); + nscb = AllocVecTagList(sizeof(struct nscallback), NULL); if(!nscb) return; time_us = t*10000; /* t converted to µs */ @@ -69,7 +69,7 @@ void schedule(int t, void (*callback)(void *p), void *p) GetSysTime(&tv); AddTime(&nscb->tv,&tv); // now contains time when event occurs - if(nscb->treq = AllocVec(sizeof(struct TimeRequest),MEMF_PRIVATE | MEMF_CLEAR)) + if(nscb->treq = AllocVecTagList(sizeof(struct TimeRequest), NULL)) { *nscb->treq = *tioreq; nscb->treq->Request.io_Command=TR_ADDREQUEST; diff --git a/amiga/search.c b/amiga/search.c index 18ea27fce..17a2d453c 100755 --- a/amiga/search.c +++ b/amiga/search.c @@ -100,7 +100,7 @@ void ami_search_open(struct gui_window *gwin) return; } - fwin = AllocVec(sizeof(struct find_window),MEMF_PRIVATE | MEMF_CLEAR); + fwin = AllocVecTags(sizeof(struct find_window), AVT_ClearWithValue, 0, TAG_DONE); fwin->objects[OID_MAIN] = WindowObject, WA_ScreenTitle,nsscreentitle, diff --git a/amiga/stringview/urlhistory.c b/amiga/stringview/urlhistory.c index fa5aec448..6d134a4a5 100644 --- a/amiga/stringview/urlhistory.c +++ b/amiga/stringview/urlhistory.c @@ -73,17 +73,24 @@ static bool URLHistoryFound(nsurl *url, const struct url_data *data) { struct Node *node; - /* skip non-visted pages */ + /* skip non-visited pages */ if(data->visits <= 0) return true; /* skip this URL if it is already in the list */ if(URLHistory_FindPage(nsurl_access(url))) return true; - node = AllocVec( sizeof( struct Node ), MEMF_SHARED|MEMF_CLEAR ); + node = AllocVecTags(sizeof(struct Node), + AVT_Type, MEMF_SHARED, + //AVT_ClearWithValue, 0, + TAG_DONE); if ( node ) { - STRPTR urladd = (STRPTR) AllocVec( strlen ( nsurl_access(url) ) + 1, MEMF_SHARED|MEMF_CLEAR ); + STRPTR urladd = (STRPTR) AllocVecTags( strlen ( nsurl_access(url) ) + 1, + AVT_Type, MEMF_SHARED, + //AVT_ClearWithValue, 0, + TAG_DONE); + if ( urladd ) { strcpy(urladd, nsurl_access(url)); diff --git a/amiga/theme.c b/amiga/theme.c index 512173db5..bb793a337 100644 --- a/amiga/theme.c +++ b/amiga/theme.c @@ -353,10 +353,10 @@ void ami_init_mouse_pointers(void) if(ptrfile = Open(ptrfname,MODE_OLDFILE)) { int mx,my; - UBYTE *pprefsbuf = AllocVec(1061,MEMF_PRIVATE | MEMF_CLEAR); + UBYTE *pprefsbuf = AllocVecTagList(1061, NULL); Read(ptrfile,pprefsbuf,1061); - mouseptrbm[i]=AllocVec(sizeof(struct BitMap),MEMF_PRIVATE | MEMF_CLEAR); + mouseptrbm[i]=AllocVecTagList(sizeof(struct BitMap), NULL); InitBitMap(mouseptrbm[i],2,32,32); mouseptrbm[i]->Planes[0] = AllocRaster(32,32); mouseptrbm[i]->Planes[1] = AllocRaster(32,32); diff --git a/amiga/tree.c b/amiga/tree.c index 5ef3a20d6..78777da43 100644 --- a/amiga/tree.c +++ b/amiga/tree.c @@ -130,8 +130,7 @@ struct treeview_window *ami_tree_create(int flags, { struct treeview_window *twin; - twin = AllocVec(sizeof(struct treeview_window), - MEMF_PRIVATE | MEMF_CLEAR); + twin = AllocVecTags(sizeof(struct treeview_window), AVT_ClearWithValue, 0, TAG_DONE); if(!twin) { @@ -378,7 +377,7 @@ void ami_tree_menu(struct treeview_window *twin) { if(twin->menu) return; - if(twin->menu = AllocVec(sizeof(struct NewMenu) * AMI_TREE_MENU_ITEMS, MEMF_CLEAR)) + if(twin->menu = AllocVecTagList(sizeof(struct NewMenu) * AMI_TREE_MENU_ITEMS, NULL)) /* NB: Was not MEMF_PRIVATE */ { twin->menu[0].nm_Type = NM_TITLE; twin->menu_name[0] = ami_utf8_easy((char *)messages_get("Tree")); @@ -1301,7 +1300,7 @@ static void ami_tree_redraw_req(void *p) void ami_tree_redraw_request(int x, int y, int width, int height, void *data) { - struct ami_tree_redraw_req *atrr_data = AllocVec(sizeof(struct ami_tree_redraw_req), MEMF_CLEAR | MEMF_PRIVATE); + struct ami_tree_redraw_req *atrr_data = AllocVecTagList(sizeof(struct ami_tree_redraw_req), NULL); atrr_data->x = x; atrr_data->y = y; -- cgit v1.2.3