Move memory functions from misc.c to memory.c

This commit is contained in:
Chris Young 2016-11-19 15:50:22 +00:00
parent d3c7d410a8
commit ec239402ea
25 changed files with 23 additions and 76 deletions

View File

@ -37,7 +37,7 @@ MESSAGES_FILTER=ami
# sources purely for the Amiga build
S_FRONTEND := gui.c tree.c history.c hotlist.c schedule.c file.c \
misc.c bitmap.c font.c filetype.c utf8.c login.c \
misc.c bitmap.c font.c filetype.c utf8.c login.c memory.c \
plotters.c object.c menu.c save_pdf.c arexx.c version.c \
cookies.c ctxmenu.c clipboard.c help.c font_scan.c \
launch.c search.c history_local.c download.c iff_dr2d.c \

View File

@ -42,6 +42,7 @@
#include "amiga/hotlist.h"
#include "amiga/tree.h"
#include "amiga/libs.h"
#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/theme.h"

View File

@ -54,6 +54,7 @@
#include "amiga/gui.h"
#include "amiga/bitmap.h"
#include "amiga/plotters.h"
#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/rtg.h"

View File

@ -45,7 +45,7 @@
#include "amiga/iff_cset.h"
#include "amiga/iff_dr2d.h"
#include "amiga/menu.h"
#include "amiga/misc.h"
#include "amiga/memory.h"
#include "amiga/utf8.h"
#define ID_UTF8 MAKE_ID('U','T','F','8')

View File

@ -64,6 +64,7 @@
#include "amiga/file.h"
#include "amiga/iff_dr2d.h"
#include "amiga/libs.h"
#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/theme.h"
#include "amiga/utf8.h"

View File

@ -46,7 +46,7 @@
#include "amiga/bitmap.h"
#include "amiga/filetype.h"
#include "amiga/datatypes.h"
#include "amiga/misc.h"
#include "amiga/memory.h"
#include "amiga/plotters.h"
typedef struct amiga_dt_anim_content {

View File

@ -40,6 +40,7 @@
#include "amiga/filetype.h"
#include "amiga/icon.h"
#include "amiga/iff_dr2d.h"
#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/save_pdf.h"
#include "amiga/theme.h"

View File

@ -31,7 +31,7 @@
#include "utils/utils.h"
#include "amiga/filetype.h"
#include "amiga/misc.h"
#include "amiga/memory.h"
#include "amiga/object.h"
/**

View File

@ -41,6 +41,7 @@
#include "utils/utf8.h"
#include "utils/utils.h"
#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/font.h"
#include "amiga/font_bullet.h"

View File

@ -141,6 +141,7 @@
#include "amiga/libs.h"
#include "amiga/login.h"
#include "amiga/menu.h"
#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/nsoption.h"
#include "amiga/plotters.h"

View File

@ -73,7 +73,7 @@
#include "amiga/gui_options.h"
#include "amiga/help.h"
#include "amiga/libs.h"
#include "amiga/misc.h"
#include "amiga/memory.h"
#include "amiga/nsoption.h"
#include "amiga/object.h"
#include "amiga/selectmenu.h"

View File

@ -51,6 +51,7 @@
#include "graphics/rpattr.h"
#include "amiga/libs.h"
#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/object.h"
#include "amiga/plotters.h"

View File

@ -49,7 +49,7 @@
#include "amiga/os3support.h"
#include "amiga/bitmap.h"
#include "amiga/icon.h"
#include "amiga/misc.h"
#include "amiga/memory.h"
#define THUMBNAIL_WIDTH 100 /* Icon sizes for thumbnails, usually the same as */
#define THUMBNAIL_HEIGHT 86 /* WIDTH/HEIGHT in desktop/thumbnail.c */

View File

@ -30,7 +30,7 @@
#include "netsurf/content.h"
#include "amiga/os3support.h"
#include "amiga/iff_dr2d.h"
#include "amiga/misc.h"
#include "amiga/memory.h"
#else
#include "os3support.h"
#include "iff_dr2d.h"

View File

@ -46,7 +46,7 @@
#include "amiga/gui.h"
#include "amiga/libs.h"
#include "amiga/misc.h"
#include "amiga/memory.h"
#include "amiga/object.h"
#include "amiga/login.h"

View File

@ -68,7 +68,7 @@
#include "amiga/hotlist.h"
#include "amiga/libs.h"
#include "amiga/menu.h"
#include "amiga/misc.h"
#include "amiga/memory.h"
#include "amiga/nsoption.h"
#include "amiga/print.h"
#include "amiga/search.h"

View File

@ -42,58 +42,6 @@
#include "amiga/misc.h"
#include "amiga/utf8.h"
void *ami_misc_allocvec_clear(int size, UBYTE value)
{
#ifdef __amigaos4__
return AllocVecTags(size, AVT_ClearWithValue, value, TAG_DONE);
#else
void *mem = AllocVec(size, MEMF_ANY);
if (mem) memset(mem, value, size);
return mem;
#endif
}
APTR ami_misc_itempool_create(int size)
{
#ifdef __amigaos4__
return AllocSysObjectTags(ASOT_ITEMPOOL,
ASOITEM_MFlags, MEMF_PRIVATE,
ASOITEM_ItemSize, size,
ASOITEM_GCPolicy, ITEMGC_AFTERCOUNT,
ASOITEM_GCParameter, 100,
TAG_DONE);
#else
return CreatePool(MEMF_ANY, 20 * size, size);
#endif
}
void ami_misc_itempool_delete(APTR pool)
{
#ifdef __amigaos4__
FreeSysObject(ASOT_ITEMPOOL, pool);
#else
DeletePool(pool);
#endif
}
APTR ami_misc_itempool_alloc(APTR pool, int size)
{
#ifdef __amigaos4__
return ItemPoolAlloc(pool);
#else
return AllocPooled(pool, size);
#endif
}
void ami_misc_itempool_free(APTR restrict pool, APTR restrict item, int size)
{
#ifdef __amigaos4__
ItemPoolFree(pool, item);
#else
FreePooled(pool, item, size);
#endif
}
static LONG ami_misc_req(const char *message, uint32 type)
{
LONG ret = 0;

View File

@ -35,15 +35,6 @@ struct Window;
* faliure displaying the message to the user.
*/
nserror amiga_warn_user(const char *warning, const char *detail);
void *ami_misc_allocvec_clear(int size, UBYTE value);
/* Itempool cross-compatibility */
APTR ami_misc_itempool_create(int size);
void ami_misc_itempool_delete(APTR pool);
APTR ami_misc_itempool_alloc(APTR pool, int size);
void ami_misc_itempool_free(APTR pool, APTR item, int size);
char *translate_escape_chars(const char *s);
void ami_misc_fatal_error(const char *message);
int32 amiga_warn_user_multi(const char *body,

View File

@ -26,7 +26,7 @@
#include <exec/lists.h>
#include <exec/nodes.h>
#include "amiga/misc.h"
#include "amiga/memory.h"
#include "amiga/object.h"
#ifdef __amigaos4__

View File

@ -45,7 +45,7 @@
#include "amiga/bitmap.h"
#include "amiga/font.h"
#include "amiga/gui.h"
#include "amiga/misc.h"
#include "amiga/memory.h"
#include "amiga/rtg.h"
#include "amiga/utf8.h"

View File

@ -62,6 +62,7 @@
#include "amiga/font.h"
#include "amiga/gui.h"
#include "amiga/libs.h"
#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/print.h"
#include "amiga/utf8.h"

View File

@ -30,7 +30,7 @@
#include "utils/errors.h"
#include "utils/log.h"
#include "amiga/misc.h"
#include "amiga/memory.h"
#include "amiga/schedule.h"
struct nscallback

View File

@ -56,7 +56,7 @@
#include "amiga/libs.h"
#include "amiga/gui.h"
#include "amiga/misc.h"
#include "amiga/memory.h"
#include "amiga/search.h"
#include "amiga/object.h"
#include "amiga/theme.h"

View File

@ -49,7 +49,7 @@
#include "amiga/bitmap.h"
#include "amiga/schedule.h"
#include "amiga/theme.h"
#include "amiga/misc.h"
#include "amiga/memory.h"
static struct BitMap *throbber = NULL;
static struct bitmap *throbber_nsbm = NULL;

View File

@ -66,7 +66,7 @@
#include "amiga/tree.h"
#include "amiga/file.h"
#include "amiga/libs.h"
#include "amiga/misc.h"
#include "amiga/memory.h"
#include "amiga/utf8.h"
#include "amiga/sslcert.h"
#include "amiga/drag.h" /* drag icon stuff */