Abstract all instances of NewMinList as it causes alert 80000006 on OS3

This commit is contained in:
Chris Young 2015-08-05 23:42:20 +01:00
parent ef5ce5c2f6
commit f4903743ba
7 changed files with 32 additions and 25 deletions

View File

@ -539,7 +539,7 @@ static nserror bitmap_render(struct bitmap *bitmap, hlcache_handle *content)
bitmap->width;
ami_init_layers(&bm_globals, bitmap->width, bitmap->height);
NewMinList(&shared_pens);
ami_NewMinList(&shared_pens);
bm_globals.shared_pens = &shared_pens;
glob = &bm_globals;

View File

@ -889,7 +889,6 @@ static void gui_init2(int argc, char** argv)
ami_hotlist_initialise(nsoption_charp(hotlist_file));
ami_cookies_initialise();
ami_global_history_initialise();
search_web_select_provider(nsoption_int(search_provider));
if (notalreadyrunning &&
@ -3853,7 +3852,7 @@ gui_window_create(struct browser_window *bw,
return NULL;
}
NewMinList(&g->shared->shared_pens);
ami_NewMinList(&g->shared->shared_pens);
g->shared->scrollerhook.h_Entry = (void *)ami_scroller_hook;
g->shared->scrollerhook.h_Data = g->shared;

View File

@ -42,7 +42,6 @@ void ami_hotlist_initialise(const char *hotlist_file)
{
tree_hotlist_path = hotlist_file;
hotlist_window = ami_tree_create(TREE_HOTLIST, NULL);
if(!hotlist_window) return;
}

View File

@ -31,6 +31,7 @@
#include <proto/openurl.h>
#include "amiga/launch.h"
#include "amiga/object.h" /* for list abstraction */
#include "utils/nsoption.h"
#include "utils/nsurl.h"
@ -131,7 +132,7 @@ void ami_openurl_open(void)
}
}
NewMinList(&ami_unsupportedprotocols);
ami_NewMinList(&ami_unsupportedprotocols);
}
void ami_openurl_close(void)

View File

@ -29,25 +29,38 @@
#include "amiga/misc.h"
#include "amiga/object.h"
#include "utils/log.h"
#ifdef __amigaos4__
#define nsList MinList
#define NewnsList NewMinList
#else
#define nsList List
#define NewnsList NewList
#endif
/****/
struct nsList *NewObjList(void)
/* Slightly abstract MinList initialisation */
void ami_NewMinList(struct MinList *list)
{
struct nsList *objlist = (struct nsList *)AllocVecTagList(sizeof(struct nsList), NULL);
if(list == NULL) return;
NewnsList((struct nsList *)list);
}
/* Allocate and initialise a new MinList */
struct MinList *ami_AllocMinList(void)
{
struct MinList *objlist = (struct MinList *)AllocVecTagList(sizeof(struct nsList), NULL);
if(objlist == NULL) return NULL;
ami_NewMinList(objlist);
return objlist;
}
NewnsList(objlist);
struct MinList *NewObjList(void)
{
struct MinList *objlist = ami_AllocMinList();
return(objlist);
}
struct nsObject *AddObject(struct nsList *objlist, ULONG otype)
struct nsObject *AddObject(struct MinList *objlist, ULONG otype)
{
struct nsObject *dtzo;
@ -81,7 +94,7 @@ void DelObjectNoFree(struct nsObject *dtzo)
DelObjectInternal(dtzo, FALSE);
}
void FreeObjList(struct nsList *objlist)
void FreeObjList(struct MinList *objlist)
{
struct nsObject *node;
struct nsObject *nnode;

View File

@ -46,20 +46,15 @@ struct nsObject
ULONG objstruct_size;
};
struct nsList
{
#ifdef __amigaos4__
struct MinList list;
#else
struct List list;
#endif
};
struct nsList *NewObjList(void);
struct nsObject *AddObject(struct nsList *objlist, ULONG otype);
struct MinList *NewObjList(void);
struct nsObject *AddObject(struct MinList *objlist, ULONG otype);
void DelObject(struct nsObject *dtzo);
void DelObjectNoFree(struct nsObject *dtzo);
void FreeObjList(struct nsList *objlist);
void FreeObjList(struct MinList *objlist);
/** List abstraction as OS3 appears to have problems with NewMinList() **/
struct MinList *ami_AllocMinList(void);
void ami_NewMinList(struct MinList *list);
#endif

View File

@ -1484,7 +1484,7 @@ struct treeview_window *ami_tree_create(int flags,
twin->ssl_data = ssl_data;
twin->tree = tree_create(flags, &ami_tree_callbacks, twin);
NewMinList(&twin->shared_pens);
ami_NewMinList(&twin->shared_pens);
twin->globals.shared_pens = &twin->shared_pens;
return twin;