From 3630d7348de4ddaf5bd01ce2a7eb9dd81b0f6af4 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 10 Jan 2015 22:47:20 +0000 Subject: Use inlines and OS3ify amigaguide.class --- amiga/agclass/amigaguide_class.c | 55 ++++++++++++++++++++++------------------ amiga/os3support.h | 1 + 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/amiga/agclass/amigaguide_class.c b/amiga/agclass/amigaguide_class.c index 8d8160dcc..e0f6600ef 100644 --- a/amiga/agclass/amigaguide_class.c +++ b/amiga/agclass/amigaguide_class.c @@ -4,8 +4,7 @@ * by Daniel "Trixie" Jedlicka */ -#undef __USE_INLINE__ - +#include "amiga/os3support.h" #include "amigaguide_class.h" @@ -46,18 +45,22 @@ Class *initAGClass(void) // Open amigaguide.library and its interface. - if ( (AmigaGuideBase = IExec->OpenLibrary("amigaguide.library", 52)) ) + if ( (AmigaGuideBase = OpenLibrary("amigaguide.library", 52)) ) { - if ( (IAmigaGuide = (struct AmigaGuideIFace *)IExec->GetInterface(AmigaGuideBase, "main", 1L, NULL)) ) +#ifdef __amigaos4__ + if ( (IAmigaGuide = (struct AmigaGuideIFace *)GetInterface(AmigaGuideBase, "main", 1L, NULL)) ) { - if ( (cl = IIntuition->MakeClass(NULL, "rootclass", NULL, sizeof(struct localObjectData), 0)) ) +#endif + if ( (cl = MakeClass(NULL, "rootclass", NULL, sizeof(struct localObjectData), 0)) ) { cl->cl_Dispatcher.h_Entry = (HOOKFUNC)dispatchAGClass; - IIntuition->AddClass(cl); + AddClass(cl); } else freeAGClass(NULL); +#ifdef __amigaos4__ } else freeAGClass(NULL); +#endif } return cl; @@ -72,9 +75,11 @@ BOOL freeAGClass(Class *cl) // Close amigaguide.library and free the class. - if (IAmigaGuide) IExec->DropInterface((struct Interface *)IAmigaGuide); - if (AmigaGuideBase) IExec->CloseLibrary(AmigaGuideBase); - if (cl) retVal = IIntuition->FreeClass(cl); +#ifdef __amigaos4__ + if (IAmigaGuide) DropInterface((struct Interface *)IAmigaGuide); +#endif + if (AmigaGuideBase) CloseLibrary(AmigaGuideBase); + if (cl) retVal = FreeClass(cl); return retVal; } @@ -112,7 +117,7 @@ static uint32 dispatchAGClass(Class *cl, Object *o, Msg msg) return agm_process(cl, o, msg); default: - return IIntuition->IDoSuperMethodA(cl, o, msg); + return IDoSuperMethodA(cl, o, msg); } } @@ -126,7 +131,7 @@ uint32 om_new(Class *cl, Object *o, struct opSet *msg) uint32 retVal = 0L; - if ( (retVal = IIntuition->IDoSuperMethodA(cl, o, (Msg)msg)) ) + if ( (retVal = IDoSuperMethodA(cl, o, (Msg)msg)) ) { // Obtain pointer to our object's local instance data. if ( (lod = (struct localObjectData *)INST_DATA(cl, retVal)) ) @@ -161,7 +166,7 @@ uint32 om_dispose(Class *cl, Object *o, Msg msg) agm_close(cl, o, msg); // Let superclass dispose of the object. - return IIntuition->IDoSuperMethodA(cl, o, msg); + return IDoSuperMethodA(cl, o, msg); } @@ -176,7 +181,7 @@ uint32 om_set(Class *cl, Object *o, struct opSet *msg) uint32 retVal = 0L; - while ((ti = IUtility->NextTagItem (&tags))) + while ((ti = NextTagItem (&tags))) { switch (ti->ti_Tag) { @@ -267,7 +272,7 @@ uint32 om_get(Class *cl, Object *o, struct opGet *msg) break; default: - retVal = IIntuition->IDoSuperMethodA(cl, o, (Msg)msg); + retVal = IDoSuperMethodA(cl, o, (Msg)msg); } return retVal; @@ -289,15 +294,15 @@ uint32 agm_open(Class *cl, Object *o, Msg msg) if ( lod->agHandle ) agm_close(cl, o, msg); // (Re)establish the AmigaGuide context and open the database asynchronously. - if ( (lod->agHandle = IAmigaGuide->OpenAmigaGuideAsync(&(lod->nag), NULL)) ) + if ( (lod->agHandle = OpenAmigaGuideAsync(&(lod->nag), NULL)) ) { - if ( (lod->agSignal = IAmigaGuide->AmigaGuideSignal(lod->agHandle)) ) + if ( (lod->agSignal = AmigaGuideSignal(lod->agHandle)) ) { // Wait until the database is displayed and ready. - IExec->Wait(lod->agSignal); + Wait(lod->agSignal); while ( agActive == FALSE ) { - while ( (lod->agm = IAmigaGuide->GetAmigaGuideMsg(lod->agHandle)) ) + while ( (lod->agm = GetAmigaGuideMsg(lod->agHandle)) ) { // The AmigaGuide process started OK. if ( lod->agm->agm_Type == ActiveToolID ) agActive = TRUE; @@ -305,19 +310,19 @@ uint32 agm_open(Class *cl, Object *o, Msg msg) // Opening the guide file failed for some reason, continue as usual. if ( lod->agm->agm_Type == ToolStatusID && lod->agm->agm_Pri_Ret ) agActive = TRUE; - IAmigaGuide->ReplyAmigaGuideMsg(lod->agm); + ReplyAmigaGuideMsg(lod->agm); } } if ( lod->nag.nag_Context ) { // A context node array is provided = open the current context node. - IAmigaGuide->SetAmigaGuideContext(lod->agHandle, lod->agContextID, NULL); - retVal = IAmigaGuide->SendAmigaGuideContext(lod->agHandle, NULL); + SetAmigaGuideContext(lod->agHandle, lod->agContextID, NULL); + retVal = SendAmigaGuideContext(lod->agHandle, NULL); } else { // No context array is provided = open the main node. - retVal = IAmigaGuide->SendAmigaGuideCmd(lod->agHandle, "LINK MAIN", TAG_DONE); + retVal = SendAmigaGuideCmd(lod->agHandle, "LINK MAIN", TAG_DONE); } } } @@ -338,7 +343,7 @@ uint32 agm_close(Class *cl, Object *o, Msg msg) if ( lod->agHandle ) { - IAmigaGuide->CloseAmigaGuide(lod->agHandle); + CloseAmigaGuide(lod->agHandle); lod->agHandle = NULL; lod->agSignal = 0; retVal = 1L; @@ -361,7 +366,7 @@ uint32 agm_process(Class *cl, Object *o, Msg msg) if (lod->agHandle) { - while ( (lod->agm = IAmigaGuide->GetAmigaGuideMsg(lod->agHandle)) ) + while ( (lod->agm = GetAmigaGuideMsg(lod->agHandle)) ) { switch (lod->agm->agm_Type) { @@ -374,7 +379,7 @@ uint32 agm_process(Class *cl, Object *o, Msg msg) //printf("%d\n", lod->agm->agm_Type); break; } - IAmigaGuide->ReplyAmigaGuideMsg(lod->agm); + ReplyAmigaGuideMsg(lod->agm); } } diff --git a/amiga/os3support.h b/amiga/os3support.h index b2b09c0df..cadcc737f 100644 --- a/amiga/os3support.h +++ b/amiga/os3support.h @@ -62,6 +62,7 @@ /* Intuition */ #define IDoMethod DoMethod +#define IDoSuperMethodA DoSuperMethodA /* Integral type definitions */ typedef int8_t int8; -- cgit v1.2.3 From 80558b3116c911f06ae7d482c226865b55feacea Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 10 Jan 2015 23:10:05 +0000 Subject: Use a function to create ready-cleared memory --- amiga/arexx.c | 4 ++-- amiga/bitmap.c | 10 ++++------ amiga/clipboard.c | 9 +++++---- amiga/misc.c | 13 +++++++++++++ amiga/misc.h | 1 + amiga/os3support.h | 7 +++++-- 6 files changed, 30 insertions(+), 14 deletions(-) diff --git a/amiga/arexx.c b/amiga/arexx.c index 35cdfb028..b138d4969 100644 --- a/amiga/arexx.c +++ b/amiga/arexx.c @@ -16,7 +16,7 @@ * along with this program. If not, see . */ - +#include #include #include @@ -238,7 +238,7 @@ STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu { if(!gw) return; - dln = AllocVecTags(sizeof(struct dlnode), AVT_ClearWithValue, 0, TAG_DONE); + dln = ami_misc_allocvec_clear(sizeof(struct dlnode), 0); 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 90f89e9d3..e7bd72ce4 100644 --- a/amiga/bitmap.c +++ b/amiga/bitmap.c @@ -40,6 +40,7 @@ #include "amiga/gui.h" #include "amiga/bitmap.h" #include "amiga/download.h" +#include "amiga/misc.h" /** * Create a bitmap. @@ -54,13 +55,10 @@ void *bitmap_create(int width, int height, unsigned int state) { struct bitmap *bitmap; - bitmap = AllocVecTags(sizeof(struct bitmap), AVT_ClearWithValue, 0, TAG_DONE); + bitmap = ami_misc_allocvec_clear(sizeof(struct bitmap), 0); if(bitmap) { - bitmap->pixdata = AllocVecTags(width*height*4, - AVT_Type,MEMF_PRIVATE, - AVT_ClearWithValue,0xff, - TAG_DONE); + bitmap->pixdata = ami_misc_allocvec_clear(width*height*4, 0xff); bitmap->width = width; bitmap->height = height; @@ -378,7 +376,7 @@ struct bitmap *ami_bitmap_from_datatype(char *filename) bm_format, bitmap_get_rowstride(bm), 0, 0, bmh->bmh_Width, bmh->bmh_Height); #ifndef __amigaos4__ - ami_bitmap_argb_to_rgba(bitmap); + ami_bitmap_argb_to_rgba(bm); #endif bitmap_set_opaque(bm, bitmap_test_opaque(bm)); } diff --git a/amiga/clipboard.c b/amiga/clipboard.c index a14a7b7ad..c95a9a3a6 100644 --- a/amiga/clipboard.c +++ b/amiga/clipboard.c @@ -42,6 +42,7 @@ #include "amiga/iff_cset.h" #include "amiga/iff_dr2d.h" #include "amiga/menu.h" +#include "amiga/misc.h" #include "amiga/utf8.h" #define ID_UTF8 MAKE_ID('U','T','F','8') @@ -110,10 +111,10 @@ static char *ami_clipboard_cat_collection(struct CollectionItem *ci, LONG codese case 0: if(ci_new) { - ci_next->ci_Next = AllocVecTags(sizeof(struct CollectionItem), AVT_ClearWithValue, 0, TAG_DONE); + ci_next->ci_Next = ami_misc_allocvec_clear(sizeof(struct CollectionItem), 0); ci_next = ci_next->ci_Next; } else { - ci_new = AllocVecTags(sizeof(struct CollectionItem), AVT_ClearWithValue, 0, TAG_DONE); + ci_new = ami_misc_allocvec_clear(sizeof(struct CollectionItem), 0); ci_next = ci_new; } @@ -124,10 +125,10 @@ static char *ami_clipboard_cat_collection(struct CollectionItem *ci, LONG codese default: if(ci_new) { - ci_next->ci_Next = AllocVecTags(sizeof(struct CollectionItem), AVT_ClearWithValue, 0, TAG_DONE); + ci_next->ci_Next = ami_misc_allocvec_clear(sizeof(struct CollectionItem), 0); ci_next = ci_next->ci_Next; } else { - ci_new = AllocVecTags(sizeof(struct CollectionItem), AVT_ClearWithValue, 0, TAG_DONE); + ci_new = ami_misc_allocvec_clear(sizeof(struct CollectionItem), 0); ci_next = ci_new; } diff --git a/amiga/misc.c b/amiga/misc.c index 2f2f93eb8..0cd3baedd 100755 --- a/amiga/misc.c +++ b/amiga/misc.c @@ -34,6 +34,19 @@ #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_CLEAR); + if (mem && (value != 0)) { + memset(mem, value, size); + } + return mem; +#endif +} + static LONG ami_misc_req(const char *message, uint32 type) { LONG ret = 0; diff --git a/amiga/misc.h b/amiga/misc.h index 33313036f..66a6f1d11 100644 --- a/amiga/misc.h +++ b/amiga/misc.h @@ -23,6 +23,7 @@ extern struct gui_file_table *amiga_file_table; struct Window; +void *ami_misc_allocvec_clear(int size, UBYTE value); char *translate_escape_chars(const char *s); void ami_misc_fatal_error(const char *message); int32 ami_warn_user_multi(const char *body, diff --git a/amiga/os3support.h b/amiga/os3support.h index cadcc737f..708ed50ce 100644 --- a/amiga/os3support.h +++ b/amiga/os3support.h @@ -36,6 +36,9 @@ #include #endif +/* Macros */ +#define IsMinListEmpty(L) (L)->mlh_Head->mln_Succ == 0 + /* Define extra memory type flags */ #define MEMF_PRIVATE MEMF_ANY #define MEMF_SHARED MEMF_ANY @@ -57,8 +60,8 @@ #define ObtainCharsetInfo(A,B,C) (const char *)"ISO-8859-1" /* DOS */ -#define FOpen(A,B,C) Open(A,B); -#define FClose(A) Close(A); +#define FOpen(A,B,C) Open(A,B) +#define FClose(A) Close(A) /* Intuition */ #define IDoMethod DoMethod -- cgit v1.2.3 From 793b53a27ad85f6aca0cbb77837b537fa405c364 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 10 Jan 2015 23:15:06 +0000 Subject: make context_menu.c build for os3 --- amiga/context_menu.c | 7 +++++-- amiga/context_menu.h | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/amiga/context_menu.c b/amiga/context_menu.c index 500f1895a..b74affb11 100644 --- a/amiga/context_menu.c +++ b/amiga/context_menu.c @@ -1313,6 +1313,9 @@ void gui_create_form_select_menu(struct gui_window *g, #else +#include +#include "amiga/context_menu.h" + void ami_context_menu_init(void) { } @@ -1330,8 +1333,8 @@ void ami_context_menu_show(struct gui_window_2 *gwin, int x, int y) { } -void gui_create_form_select_menu(struct gui_window *g, - struct form_control *control) +void gui_create_form_select_menu(struct gui_window *g, struct form_control *control) { } #endif + diff --git a/amiga/context_menu.h b/amiga/context_menu.h index e3d66edef..5697b5611 100755 --- a/amiga/context_menu.h +++ b/amiga/context_menu.h @@ -20,6 +20,9 @@ #define AMIGA_CONTEXT_MENU_H struct tree; +struct gui_window; +struct gui_window_2; +struct form_control; void ami_context_menu_init(void); void ami_context_menu_free(void); @@ -29,3 +32,4 @@ void ami_context_menu_show(struct gui_window_2 *gwin, int x, int y); void gui_create_form_select_menu(struct gui_window *g, struct form_control *control); #endif + -- cgit v1.2.3 From 427a67e932ae9e315c916b6c1126cf70204ef3fe Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 10 Jan 2015 23:16:11 +0000 Subject: allocvec clear --- amiga/download.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amiga/download.c b/amiga/download.c index 1c49629e7..e9d1a71f2 100644 --- a/amiga/download.c +++ b/amiga/download.c @@ -98,7 +98,7 @@ static struct gui_download_window *gui_download_window_create(download_context * char *dl_filename = ami_utf8_easy(download_context_get_filename(ctx)); APTR va[3]; - dw = AllocVecTags(sizeof(struct gui_download_window), AVT_ClearWithValue, 0, TAG_DONE); + dw = ami_misc_allocvec_clear(sizeof(struct gui_download_window), 0); if(gui && (!IsListEmpty(&gui->dllist)) && (dw->dln = (struct dlnode *)FindName(&gui->dllist,url))) { -- cgit v1.2.3 From 5a541e581babc422d8b7e04b39d2999dde290cc8 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 10 Jan 2015 23:39:21 +0000 Subject: stub out drag stuff for os3 --- amiga/drag.c | 46 +++++++++++++++++++++++++++++++++++++++++----- amiga/drag.h | 7 +++++++ 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/amiga/drag.c b/amiga/drag.c index bf2c94123..5999caade 100644 --- a/amiga/drag.c +++ b/amiga/drag.c @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - +#ifdef __amigaos4__ #include #include @@ -26,9 +26,7 @@ #include #include -#ifdef __amigaos4__ #include -#endif #include #include "utils/errors.h" @@ -36,10 +34,8 @@ #include "utils/messages.h" #include "utils/utils.h" #include "utils/nsoption.h" -#include "desktop/browser.h" #include "content/hlcache.h" #include "desktop/mouse.h" -#include "desktop/gui_window.h" #include "amiga/gui.h" #include "amiga/bitmap.h" @@ -315,3 +311,43 @@ void *ami_window_at_pointer(int type) if(layer) return ami_find_gwin_by_id(layer->Window, type); else return NULL; } + +#else +#include "amiga/drag.h" + +void gui_drag_save_object(struct gui_window *g, struct hlcache_handle *c, + gui_save_type type) +{ +} + +void gui_drag_save_selection(struct gui_window *g, const char *selection) +{ +} + +void ami_drag_save(struct Window *win) +{ +} + +void ami_drag_icon_show(struct Window *win, const char *type) +{ +} + +void ami_drag_icon_close(struct Window *win) +{ +} + +void ami_drag_icon_move(void) +{ +} + +BOOL ami_drag_in_progress(void) +{ + return FALSE; +} + +void *ami_window_at_pointer(int type) +{ + return NULL; +} +#endif + diff --git a/amiga/drag.h b/amiga/drag.h index 35f2754ee..59a1a8467 100644 --- a/amiga/drag.h +++ b/amiga/drag.h @@ -18,9 +18,15 @@ #ifndef AMIGA_DRAG_H #define AMIGA_DRAG_H +#include +#include "desktop/browser.h" +#include "desktop/gui_window.h" #define AMI_DRAG_THRESHOLD 10 +struct hlcache_handle; +struct Window; + int drag_save; void *drag_save_data; struct gui_window *drag_save_gui; @@ -36,3 +42,4 @@ BOOL ami_drag_in_progress(void); void *ami_window_at_pointer(int type); #endif + -- cgit v1.2.3 From 18fe60baf1fc5775e0a96a1930ce622bbc40b1ec Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 10 Jan 2015 23:46:17 +0000 Subject: fix-up the datatypes handlers for os3 --- amiga/dt_anim.c | 13 ++++++++++--- amiga/dt_picture.c | 3 +++ amiga/dt_sound.c | 2 ++ amiga/os3support.h | 1 + 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/amiga/dt_anim.c b/amiga/dt_anim.c index a76966dc9..f69af31b9 100644 --- a/amiga/dt_anim.c +++ b/amiga/dt_anim.c @@ -21,8 +21,11 @@ */ #ifdef WITH_AMIGA_DATATYPES +#include "amiga/os3support.h" + #include "amiga/filetype.h" #include "amiga/datatypes.h" +#include "amiga/misc.h" #include "amiga/plotters.h" #include "content/content_protected.h" #include "desktop/plotters.h" @@ -36,7 +39,9 @@ #include #include #include +#ifdef __amigaos4__ #include +#endif #include typedef struct amiga_dt_anim_content { @@ -192,7 +197,7 @@ bool amiga_dt_anim_convert(struct content *c) IDoMethodA(plugin->dto, (Msg)&adt_frame); clut = ami_colormap_to_clut(adt_frame.alf_CMap); - +#ifdef __amigaos4__ BltBitMapTags( BLITA_Width, width, BLITA_Height, height, @@ -203,7 +208,9 @@ bool amiga_dt_anim_convert(struct content *c) BLITA_DestBytesPerRow, width, BLITA_CLUT, clut, TAG_DONE); - +#else +#warning FIXME: Need to use a different blitter function for OS3! +#endif FreeVec(clut); adt_frame.MethodID = ADTM_UNLOADFRAME; @@ -332,7 +339,7 @@ content_type amiga_dt_anim_content_type(void) APTR ami_colormap_to_clut(struct ColorMap *cmap) { int i; - UBYTE *clut = AllocVecTags(256 * 4, AVT_ClearWithValue, 0, TAG_DONE); /* NB: Was not MEMF_PRIVATE */ + UBYTE *clut = ami_misc_allocvec_clear(256 * 4, 0); /* NB: Was not MEMF_PRIVATE */ ULONG colr[256 * 4]; if(!clut) return NULL; diff --git a/amiga/dt_picture.c b/amiga/dt_picture.c index 38bb46311..a31c3501c 100644 --- a/amiga/dt_picture.c +++ b/amiga/dt_picture.c @@ -21,6 +21,9 @@ */ #ifdef WITH_AMIGA_DATATYPES +#include "amiga/os3support.h" + +#include "amiga/bitmap.h" #include "amiga/filetype.h" #include "amiga/datatypes.h" #include "content/content_protected.h" diff --git a/amiga/dt_sound.c b/amiga/dt_sound.c index 93933bce5..2823178e2 100644 --- a/amiga/dt_sound.c +++ b/amiga/dt_sound.c @@ -21,6 +21,8 @@ */ #ifdef WITH_AMIGA_DATATYPES +#include "amiga/os3support.h" + #include "amiga/filetype.h" #include "amiga/datatypes.h" #include "content/content_protected.h" diff --git a/amiga/os3support.h b/amiga/os3support.h index 708ed50ce..dbd1ef755 100644 --- a/amiga/os3support.h +++ b/amiga/os3support.h @@ -65,6 +65,7 @@ /* Intuition */ #define IDoMethod DoMethod +#define IDoMethodA DoMethodA #define IDoSuperMethodA DoSuperMethodA /* Integral type definitions */ -- cgit v1.2.3 From 81d024e3d856ccb2e5d8270d8f7168417ece81ac Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 10 Jan 2015 23:49:55 +0000 Subject: Fix file.c and remove some rogue semicolons --- amiga/file.c | 2 +- amiga/os3support.h | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/amiga/file.c b/amiga/file.c index 80e5d84b1..e191ae190 100644 --- a/amiga/file.c +++ b/amiga/file.c @@ -217,7 +217,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 = AllocVecTags(1024, NULL); + char *fname = AllocVecTagList(1024, NULL); char *initial_fname = NULL; if(object) { diff --git a/amiga/os3support.h b/amiga/os3support.h index dbd1ef755..9eb195913 100644 --- a/amiga/os3support.h +++ b/amiga/os3support.h @@ -46,14 +46,17 @@ /* Ignore tags that aren't supported */ #define PDTA_PromoteMask TAG_IGNORE +/* Renamed structures */ +#define AnchorPathOld AnchorPath + /* Easy compat macros */ /* application */ #define Notify(...) (void)0; /* Exec */ /* AllocVecTagList with no tags */ -#define AllocVecTagList(SZ,TAG) AllocVec(SZ,MEMF_ANY); -#define GetSucc(N) (N)->ln_Succ; +#define AllocVecTagList(SZ,TAG) AllocVec(SZ,MEMF_ANY) +#define GetSucc(N) (N)->ln_Succ /* diskfont */ /* Only used in one place we haven't ifdeffed, where it returns the charset name */ -- cgit v1.2.3 From ae012398b0f0a7320ed1d80bf6c370971033b2b9 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 11 Jan 2015 00:07:11 +0000 Subject: more easy os3 fixes --- amiga/arexx.c | 4 +++- amiga/filetype.c | 7 +++++-- amiga/font_scan.h | 2 +- amiga/os3support.c | 12 ++++++++++++ amiga/os3support.h | 8 +++++++- 5 files changed, 28 insertions(+), 5 deletions(-) diff --git a/amiga/arexx.c b/amiga/arexx.c index b138d4969..eb2a6c10a 100644 --- a/amiga/arexx.c +++ b/amiga/arexx.c @@ -16,6 +16,8 @@ * along with this program. If not, see . */ +#include "amiga/os3support.h" + #include #include #include @@ -32,11 +34,11 @@ #include "desktop/gui_window.h" #include "desktop/version.h" -#include "amiga/os3support.h" #include "amiga/arexx.h" #include "amiga/download.h" #include "amiga/gui.h" #include "amiga/hotlist.h" +#include "amiga/misc.h" #include "amiga/theme.h" extern const char * const verarexx; diff --git a/amiga/filetype.c b/amiga/filetype.c index 67b60ab07..b37ebe58d 100644 --- a/amiga/filetype.c +++ b/amiga/filetype.c @@ -16,9 +16,12 @@ * along with this program. If not, see . */ +#include "amiga/os3support.h" + #include #include #include "amiga/filetype.h" +#include "amiga/misc.h" #include "amiga/object.h" #include "content/fetch.h" #include "content/content.h" @@ -201,7 +204,7 @@ nserror ami_mime_init(const char *mimefile) if(ReadArgs(template, rarray, rargs)) { node = AddObject(ami_mime_list, AMINS_MIME); - mimeentry = AllocVecTags(sizeof(struct ami_mime_entry), AVT_ClearWithValue, 0, TAG_DONE); + mimeentry = ami_misc_allocvec_clear(sizeof(struct ami_mime_entry), 0); node->objstruct = mimeentry; if(rarray[AMI_MIME_MIMETYPE]) @@ -351,7 +354,7 @@ static APTR ami_mime_guess_add_datatype(struct DataType *dt, lwc_string **lwc_mi char *p; node = AddObject(ami_mime_list, AMINS_MIME); - mimeentry = AllocVecTags(sizeof(struct ami_mime_entry), AVT_ClearWithValue, 0, TAG_DONE); + mimeentry = ami_misc_allocvec_clear(sizeof(struct ami_mime_entry), 0); node->objstruct = mimeentry; lerror = lwc_intern_string(dth->dth_Name, strlen(dth->dth_Name), &mimeentry->datatype); diff --git a/amiga/font_scan.h b/amiga/font_scan.h index d29469742..69361557f 100755 --- a/amiga/font_scan.h +++ b/amiga/font_scan.h @@ -18,7 +18,7 @@ #ifndef AMIGA_FONT_SCAN_H #define AMIGA_FONT_SCAN_H - +#include "amiga/os3support.h" #include void ami_font_scan_init(const char *filename, bool force_scan, bool save, diff --git a/amiga/os3support.c b/amiga/os3support.c index e020d0420..613701cc5 100644 --- a/amiga/os3support.c +++ b/amiga/os3support.c @@ -160,4 +160,16 @@ char *ASPrintf(const char *fmt, ...) return rbuf; } +/* C */ +char *strlwr(char *str) +{ + size_t i; + size_t len = strlen(str); + + for(i=0; i