From 4d18947adb21aa3e06f2431900111ad17b58d80d Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 1 May 2016 14:00:47 +0100 Subject: [PATCH] Update to new warn_user API --- amiga/arexx.c | 4 ++-- amiga/ctxmenu.c | 6 +++--- amiga/download.c | 6 +++--- amiga/file.c | 2 +- amiga/font_bullet.c | 4 ++-- amiga/gui.c | 2 +- amiga/history_local.c | 8 ++++---- amiga/menu.c | 4 ++-- amiga/misc.c | 2 +- amiga/misc.h | 2 +- amiga/plotters.c | 8 ++++---- amiga/print.c | 4 ++-- amiga/theme.c | 6 +++--- amiga/tree.c | 18 +++++++++--------- 14 files changed, 38 insertions(+), 38 deletions(-) diff --git a/amiga/arexx.c b/amiga/arexx.c index dec40e096..c5b5ab42d 100644 --- a/amiga/arexx.c +++ b/amiga/arexx.c @@ -245,7 +245,7 @@ STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[4], *(ULONG *)cmd->ac_ArgList[5]); if (nsurl_create((char *)cmd->ac_ArgList[0], &url) != NSERROR_OK) { - warn_user("NoMemory", 0); + amiga_warn_user("NoMemory", 0); return; } @@ -513,7 +513,7 @@ STATIC VOID rx_home(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu if(gw == NULL) return; if (nsurl_create(nsoption_charp(homepage_url), &url) != NSERROR_OK) { - warn_user("NoMemory", 0); + amiga_warn_user("NoMemory", 0); } else { browser_window_navigate(gw->bw, url, diff --git a/amiga/ctxmenu.c b/amiga/ctxmenu.c index 9320fac26..cc612da24 100644 --- a/amiga/ctxmenu.c +++ b/amiga/ctxmenu.c @@ -131,7 +131,7 @@ HOOKF(void, ami_ctxmenu_item_websearch, APTR, window, struct IntuiMessage *) nsurl_unref(url); } if (ret != NSERROR_OK) { - warn_user(messages_get_errorcode(ret), 0); + amiga_warn_user(messages_get_errorcode(ret), 0); } free(sel); @@ -151,7 +151,7 @@ HOOKF(void, ami_ctxmenu_item_urlopentab, APTR, window, struct IntuiMessage *) &bw); if (error != NSERROR_OK) - warn_user(messages_get_errorcode(error), 0); + amiga_warn_user(messages_get_errorcode(error), 0); } HOOKF(void, ami_ctxmenu_item_urlopenwin, APTR, window, struct IntuiMessage *) @@ -168,7 +168,7 @@ HOOKF(void, ami_ctxmenu_item_urlopenwin, APTR, window, struct IntuiMessage *) &bw); if (error != NSERROR_OK) - warn_user(messages_get_errorcode(error), 0); + amiga_warn_user(messages_get_errorcode(error), 0); } HOOKF(void, ami_ctxmenu_item_urldownload, APTR, window, struct IntuiMessage *) diff --git a/amiga/download.c b/amiga/download.c index 21c21cade..a0bc5c47b 100644 --- a/amiga/download.c +++ b/amiga/download.c @@ -274,7 +274,7 @@ static void gui_download_window_done(struct gui_download_window *dw) if(queuedl) { nsurl *url; if (nsurl_create(dln2->node.ln_Name, &url) != NSERROR_OK) { - warn_user("NoMemory", 0); + amiga_warn_user("NoMemory", 0); } else { browser_window_navigate(bw, url, @@ -292,7 +292,7 @@ static void gui_download_window_done(struct gui_download_window *dw) static void gui_download_window_error(struct gui_download_window *dw, const char *error_msg) { - warn_user("Unwritten",""); + amiga_warn_user("Unwritten",""); dw->result = AMINS_DLOAD_ERROR; gui_download_window_done(dw); } @@ -432,7 +432,7 @@ BOOL ami_download_check_overwrite(const char *file, struct Window *win, ULONG si overwritetext = ASPrintf(messages_get("OverwriteFile")); } - res = ami_warn_user_multi(overwritetext, "Replace", "DontReplace", win); + res = amiga_warn_user_multi(overwritetext, "Replace", "DontReplace", win); FreeVec(overwritetext); } else return TRUE; diff --git a/amiga/file.c b/amiga/file.c index 267ebae5a..8957ecfe6 100644 --- a/amiga/file.c +++ b/amiga/file.c @@ -97,7 +97,7 @@ void ami_file_open(struct gui_window_2 *gwin) AddPart(temp, filereq->fr_File, 1024); if (netsurf_path_to_nsurl(temp, &url) != NSERROR_OK) { - warn_user("NoMemory", 0); + amiga_warn_user("NoMemory", 0); } else { browser_window_navigate(gwin->gw->bw, url, diff --git a/amiga/font_bullet.c b/amiga/font_bullet.c index 81d41ddc9..3032b9735 100644 --- a/amiga/font_bullet.c +++ b/amiga/font_bullet.c @@ -345,7 +345,7 @@ static struct ami_font_cache_node *ami_font_open(const char *font, bool critical nodedata = ami_font_cache_alloc_entry(font); if(nodedata == NULL) { - warn_user("NoMemory", ""); + amiga_warn_user("NoMemory", ""); return NULL; } @@ -354,7 +354,7 @@ static struct ami_font_cache_node *ami_font_open(const char *font, bool critical if(!nodedata->font) { LOG("Requested font not found: %s", font); - if(critical == true) warn_user("CompError", font); + if(critical == true) amiga_warn_user("CompError", font); FreeVec(nodedata); return NULL; } diff --git a/amiga/gui.c b/amiga/gui.c index 9c8908469..c6c963312 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -4419,7 +4419,7 @@ static void ami_gui_close_tabs(struct gui_window_2 *gwin, bool other_tabs) if((gwin->tabs > 1) && (nsoption_bool(tab_close_warn) == true)) { char *req_body = ami_utf8_easy(messages_get("MultiTabClose")); - int32 res = ami_warn_user_multi(req_body, "Yes", "No", gwin->win); + int32 res = amiga_warn_user_multi(req_body, "Yes", "No", gwin->win); free(req_body); if(res == 0) return; diff --git a/amiga/history_local.c b/amiga/history_local.c index f11c78473..3016cbf16 100755 --- a/amiga/history_local.c +++ b/amiga/history_local.c @@ -76,7 +76,7 @@ static void ami_history_redraw(struct history_window *hw) GetAttr(SCROLLER_Top,hw->objects[OID_HSCROLL],(ULONG *)&xs); GetAttr(SCROLLER_Top,hw->objects[OID_VSCROLL],(ULONG *)&ys); if(ami_gui_get_space_box(hw->objects[GID_BROWSER], &bbox) != NSERROR_OK) { - warn_user("NoMemory", ""); + amiga_warn_user("NoMemory", ""); return; } @@ -193,7 +193,7 @@ static bool ami_history_click(struct history_window *hw, uint16 code) ULONG xs, ys; if(ami_gui_get_space_box(hw->objects[GID_BROWSER], &bbox) != NSERROR_OK) { - warn_user("NoMemory", ""); + amiga_warn_user("NoMemory", ""); return false; } @@ -259,7 +259,7 @@ BOOL ami_history_event(struct history_window *hw) GetAttr(SCROLLER_Top, hw->objects[OID_VSCROLL], (ULONG *)&ys); if(ami_gui_get_space_box(hw->objects[GID_BROWSER], &bbox) != NSERROR_OK) { - warn_user("NoMemory", ""); + amiga_warn_user("NoMemory", ""); break; } @@ -299,7 +299,7 @@ void ami_history_update_extent(struct history_window *hw) browser_window_history_size(hw->gw->bw, &width, &height); if(ami_gui_get_space_box(hw->objects[GID_BROWSER], &bbox) != NSERROR_OK) { - warn_user("NoMemory", ""); + amiga_warn_user("NoMemory", ""); return; } diff --git a/amiga/menu.c b/amiga/menu.c index e2dc414aa..4a30c4878 100644 --- a/amiga/menu.c +++ b/amiga/menu.c @@ -116,7 +116,7 @@ HOOKF(void, ami_menu_item_project_newwin, APTR, window, struct IntuiMessage *) nsurl_unref(url); } if (error != NSERROR_OK) { - warn_user(messages_get_errorcode(error), 0); + amiga_warn_user(messages_get_errorcode(error), 0); } } @@ -228,7 +228,7 @@ HOOKF(void, ami_menu_item_project_about, APTR, window, struct IntuiMessage *) nsurl_unref(url); } if (error != NSERROR_OK) { - warn_user(messages_get_errorcode(error), 0); + amiga_warn_user(messages_get_errorcode(error), 0); } } diff --git a/amiga/misc.c b/amiga/misc.c index 8618fd8b2..2c233584d 100755 --- a/amiga/misc.c +++ b/amiga/misc.c @@ -141,7 +141,7 @@ nserror amiga_warn_user(const char *warning, const char *detail) return NSERROR_OK; } -int32 ami_warn_user_multi(const char *body, const char *opt1, const char *opt2, struct Window *win) +int32 amiga_warn_user_multi(const char *body, const char *opt1, const char *opt2, struct Window *win) { int res = 0; diff --git a/amiga/misc.h b/amiga/misc.h index e8f58fad8..fab4492b4 100644 --- a/amiga/misc.h +++ b/amiga/misc.h @@ -46,7 +46,7 @@ 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 ami_warn_user_multi(const char *body, +int32 amiga_warn_user_multi(const char *body, const char *opt1, const char *opt2, struct Window *win); #endif diff --git a/amiga/plotters.c b/amiga/plotters.c index 9c3c3c7f1..23a73f84a 100644 --- a/amiga/plotters.c +++ b/amiga/plotters.c @@ -163,10 +163,10 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height, bool for gg->bm = ami_rtg_allocbitmap(width, height, 32, 0, friend, RGBFB_A8R8G8B8); } - if(!gg->bm) warn_user("NoMemory",""); + if(!gg->bm) amiga_warn_user("NoMemory",""); gg->rp = AllocVecTagList(sizeof(struct RastPort), NULL); - if(!gg->rp) warn_user("NoMemory",""); + if(!gg->rp) amiga_warn_user("NoMemory",""); InitRastPort(gg->rp); gg->rp->BitMap = gg->bm; @@ -179,12 +179,12 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height, bool for InstallLayerHook(gg->rp->Layer,LAYERS_NOBACKFILL); gg->rp->AreaInfo = AllocVecTagList(sizeof(struct AreaInfo), NULL); - if((!gg->areabuf) || (!gg->rp->AreaInfo)) warn_user("NoMemory",""); + if((!gg->areabuf) || (!gg->rp->AreaInfo)) amiga_warn_user("NoMemory",""); InitArea(gg->rp->AreaInfo,gg->areabuf, AREA_SIZE/5); gg->rp->TmpRas = AllocVecTagList(sizeof(struct TmpRas), NULL); - if((!gg->tmprasbuf) || (!gg->rp->TmpRas)) warn_user("NoMemory",""); + if((!gg->tmprasbuf) || (!gg->rp->TmpRas)) amiga_warn_user("NoMemory",""); InitTmpRas(gg->rp->TmpRas, gg->tmprasbuf, width*height); diff --git a/amiga/print.c b/amiga/print.c index 908b026e6..f3fd2115f 100644 --- a/amiga/print.c +++ b/amiga/print.c @@ -408,7 +408,7 @@ void ami_print(struct hlcache_handle *c, int copies) if(OpenDevice("printer.device", nsoption_int(printer_unit), (struct IORequest *)ami_print_info.PReq, 0)) { - warn_user("CompError","printer.device"); + amiga_warn_user("CompError","printer.device"); return; } @@ -422,7 +422,7 @@ void ami_print(struct hlcache_handle *c, int copies) if(!print_set_up(c, &amiprinter, ami_print_info.ps, &height)) { - warn_user("PrintError","print_set_up() returned false"); + amiga_warn_user("PrintError","print_set_up() returned false"); ami_print_close_device(); return; } diff --git a/amiga/theme.c b/amiga/theme.c index 399a11663..8076bdf0a 100644 --- a/amiga/theme.c +++ b/amiga/theme.c @@ -140,7 +140,7 @@ void ami_theme_init(void) if(!lock) { - warn_user("ThemeApplyErr",nsoption_charp(theme)); + amiga_warn_user("ThemeApplyErr",nsoption_charp(theme)); strcpy(themefile,"PROGDIR:Resources/Themes/Default/Theme"); nsoption_set_charp(theme, (char *)strdup("PROGDIR:Resources/Themes/Default")); } @@ -447,7 +447,7 @@ void gui_window_stop_throbber(struct gui_window *g) if(g == g->shared->gw) { if(ami_gui_get_space_box(g->shared->objects[GID_THROBBER], &bbox) != NSERROR_OK) { - warn_user("NoMemory", ""); + amiga_warn_user("NoMemory", ""); return; } @@ -479,7 +479,7 @@ static void ami_throbber_update(void *p) if(g->shared->gw == g) { if(ami_gui_get_space_box(g->shared->objects[GID_THROBBER], &bbox) != NSERROR_OK) { - warn_user("NoMemory", ""); + amiga_warn_user("NoMemory", ""); return; } #ifdef __amigaos4__ diff --git a/amiga/tree.c b/amiga/tree.c index 48b152199..f147b5e5c 100644 --- a/amiga/tree.c +++ b/amiga/tree.c @@ -151,7 +151,7 @@ static void ami_tree_resized(struct tree *tree, int width, int height, void *dat if(twin->win) { if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) { - warn_user("NoMemory", ""); + amiga_warn_user("NoMemory", ""); return; } @@ -193,7 +193,7 @@ static void ami_tree_get_window_dimensions(int *width, int *height, void *data) struct IBox *bbox; if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) { - warn_user("NoMemory", ""); + amiga_warn_user("NoMemory", ""); return; } @@ -232,7 +232,7 @@ static void ami_tree_redraw_req_dr(void *p) GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&pos_y); if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) { - warn_user("NoMemory", ""); + amiga_warn_user("NoMemory", ""); return; } @@ -291,7 +291,7 @@ static void ami_tree_redraw_req(void *p) GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&pos_y); if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) { - warn_user("NoMemory", ""); + amiga_warn_user("NoMemory", ""); return; } @@ -377,7 +377,7 @@ static void ami_tree_draw(struct treeview_window *twin) GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&y); if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) { - warn_user("NoMemory", ""); + amiga_warn_user("NoMemory", ""); return; } @@ -401,7 +401,7 @@ static void ami_tree_scroll_visible(int y, int height, void *data) GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&sy); if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) { - warn_user("NoMemory", ""); + amiga_warn_user("NoMemory", ""); return; } @@ -980,7 +980,7 @@ BOOL ami_tree_event(struct treeview_window *twin) drag_y_move = 0; if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) { - warn_user("NoMemory", ""); + amiga_warn_user("NoMemory", ""); break; } @@ -1046,7 +1046,7 @@ BOOL ami_tree_event(struct treeview_window *twin) case WMHI_MOUSEBUTTONS: if(ami_gui_get_space_box((Object *)twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) { - warn_user("NoMemory", ""); + amiga_warn_user("NoMemory", ""); break; } @@ -1458,7 +1458,7 @@ struct treeview_window *ami_tree_create(int flags, if(!twin) { - warn_user("NoMemory", 0); + amiga_warn_user("NoMemory", 0); return NULL; }