From b23f55c81bca21de7841111ace809df0f6408d65 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 21 Jan 2017 16:49:14 +0000 Subject: fix warnings and errors in atari frontend --- frontends/atari/download.c | 2 +- frontends/atari/gemtk/guiwin.c | 94 ++++++++++++++++++------------------ frontends/atari/gemtk/objc.c | 2 + frontends/atari/gui.c | 14 +++--- frontends/atari/hotlist.c | 10 ++-- frontends/atari/plot/font_freetype.c | 5 +- frontends/atari/plot/font_internal.c | 2 +- frontends/atari/rootwin.c | 4 +- frontends/atari/settings.c | 4 +- frontends/atari/treeview.c | 21 ++++---- 10 files changed, 80 insertions(+), 78 deletions(-) (limited to 'frontends') diff --git a/frontends/atari/download.c b/frontends/atari/download.c index 3e7a68584..d756e6694 100644 --- a/frontends/atari/download.c +++ b/frontends/atari/download.c @@ -28,9 +28,9 @@ #include "utils/log.h" #include "utils/messages.h" -#include "utils/utils.h" #include "utils/nsoption.h" #include "utils/string.h" +#include "netsurf/inttypes.h" #include "netsurf/browser_window.h" #include "netsurf/download.h" #include "desktop/save_complete.h" diff --git a/frontends/atari/gemtk/guiwin.c b/frontends/atari/gemtk/guiwin.c index ea0f8f917..84c7af80f 100644 --- a/frontends/atari/gemtk/guiwin.c +++ b/frontends/atari/gemtk/guiwin.c @@ -127,7 +127,7 @@ error: */ static short preproc_wm(GUIWIN * gw, EVMULT_OUT *ev_out, short msg[8]) { - GRECT g, g_ro, g2; + GRECT g, g2; short retval = 1; int val = 1; struct gemtk_wm_scroll_info_s *slid; @@ -169,7 +169,6 @@ static short preproc_wm(GUIWIN * gw, EVMULT_OUT *ev_out, short msg[8]) slid = gemtk_wm_get_scroll_info(gw); gemtk_wm_get_grect(gw, GEMTK_WM_AREA_CONTENT, &g); - g_ro = g; switch(msg[4]) { @@ -471,67 +470,66 @@ static short preproc_mu_keybd(GUIWIN * gw, EVMULT_OUT *ev_out, short msg[8]) { short retval = 0; - if ((gw->toolbar != NULL) && (gw->toolbar_edit_obj > -1)) { + if ((gw->toolbar != NULL) && (gw->toolbar_edit_obj > -1)) { - short next_edit_obj = gw->toolbar_edit_obj; - short next_char = -1; - short edit_idx; - short r; + short next_edit_obj = gw->toolbar_edit_obj; + short next_char = -1; + short edit_idx; - DEBUG_PRINT(("%s, gw: %p, toolbar_edit_obj: %d\n", __FUNCTION__, gw, - gw->toolbar_edit_obj)); + DEBUG_PRINT(("%s, gw: %p, toolbar_edit_obj: %d\n", + __FUNCTION__, gw, + gw->toolbar_edit_obj)); - r = form_wkeybd(gw->toolbar, gw->toolbar_edit_obj, next_edit_obj, - ev_out->emo_kreturn, - &next_edit_obj, &next_char, gw->handle); + form_wkeybd(gw->toolbar, gw->toolbar_edit_obj, next_edit_obj, + ev_out->emo_kreturn, + &next_edit_obj, &next_char, gw->handle); - if (next_edit_obj != gw->toolbar_edit_obj) { + if (next_edit_obj != gw->toolbar_edit_obj) { gemtk_wm_set_toolbar_edit_obj(gw, next_edit_obj, - ev_out->emo_kreturn); - } else { - if (next_char > 13) { - r = objc_wedit(gw->toolbar, gw->toolbar_edit_obj, - ev_out->emo_kreturn, &edit_idx, - EDCHAR, gw->handle); - } - } - //retval = 1; - /*gemtk_wm_send_msg(gw, GEMTK_WM_WM_FORM_KEY, gw->toolbar_edit_obj, - ev_out->emo_kreturn, 0, 0);*/ - } + ev_out->emo_kreturn); + } else { + if (next_char > 13) { + objc_wedit(gw->toolbar, gw->toolbar_edit_obj, + ev_out->emo_kreturn, &edit_idx, + EDCHAR, gw->handle); + } + } + //retval = 1; + /*gemtk_wm_send_msg(gw, GEMTK_WM_WM_FORM_KEY, gw->toolbar_edit_obj, + ev_out->emo_kreturn, 0, 0);*/ + } - if((gw->form != NULL) && (gw->form_edit_obj > -1) ) { + if ((gw->form != NULL) && (gw->form_edit_obj > -1)) { - short next_edit_obj = gw->form_edit_obj; - short next_char = -1; - short edit_idx; - short r; + short next_edit_obj = gw->form_edit_obj; + short next_char = -1; + short edit_idx; - r = form_wkeybd(gw->form, gw->form_edit_obj, next_edit_obj, - ev_out->emo_kreturn, - &next_edit_obj, &next_char, gw->handle); + form_wkeybd(gw->form, gw->form_edit_obj, next_edit_obj, + ev_out->emo_kreturn, + &next_edit_obj, &next_char, gw->handle); - if (next_edit_obj != gw->form_edit_obj) { + if (next_edit_obj != gw->form_edit_obj) { if(gw->form_edit_obj != -1) { objc_wedit(gw->form, gw->form_edit_obj, - ev_out->emo_kreturn, &edit_idx, - EDEND, gw->handle); + ev_out->emo_kreturn, &edit_idx, + EDEND, gw->handle); } - gw->form_edit_obj = next_edit_obj; + gw->form_edit_obj = next_edit_obj; - objc_wedit(gw->form, gw->form_edit_obj, - ev_out->emo_kreturn, &edit_idx, - EDINIT, gw->handle); - } else { - if(next_char > 13) - r = objc_wedit(gw->form, gw->form_edit_obj, - ev_out->emo_kreturn, &edit_idx, - EDCHAR, gw->handle); - } - } - return(retval); + objc_wedit(gw->form, gw->form_edit_obj, + ev_out->emo_kreturn, &edit_idx, + EDINIT, gw->handle); + } else { + if(next_char > 13) + objc_wedit(gw->form, gw->form_edit_obj, + ev_out->emo_kreturn, &edit_idx, + EDCHAR, gw->handle); + } + } + return(retval); } /** diff --git a/frontends/atari/gemtk/objc.c b/frontends/atari/gemtk/objc.c index 855413e0b..3746892f4 100644 --- a/frontends/atari/gemtk/objc.c +++ b/frontends/atari/gemtk/objc.c @@ -49,6 +49,7 @@ char *gemtk_obj_get_text(OBJECT * tree, short idx) return (p); } +/* static void set_text(OBJECT *obj, short idx, char * text, int len) { char spare[255]; @@ -63,6 +64,7 @@ static void set_text(OBJECT *obj, short idx, char * text, int len) set_string(obj, idx, spare); } +*/ char gemtk_obj_set_str_safe(OBJECT * tree, short idx, const char *txt) { diff --git a/frontends/atari/gui.c b/frontends/atari/gui.c index 1cf51d31d..d4a6915cd 100644 --- a/frontends/atari/gui.c +++ b/frontends/atari/gui.c @@ -386,13 +386,13 @@ static void atari_window_reformat(struct gui_window *gw) static void gui_window_redraw_window(struct gui_window *gw) { - CMP_BROWSER b; - GRECT rect; - if (gw == NULL) - return; - b = gw->browser; - window_get_grect(gw->root, BROWSER_AREA_CONTENT, &rect); - window_schedule_redraw_grect(gw->root, &rect); + //CMP_BROWSER b; + GRECT rect; + if (gw == NULL) + return; + //b = gw->browser; + window_get_grect(gw->root, BROWSER_AREA_CONTENT, &rect); + window_schedule_redraw_grect(gw->root, &rect); } static void gui_window_update_box(struct gui_window *gw, const struct rect *rect) diff --git a/frontends/atari/hotlist.c b/frontends/atari/hotlist.c index ee9385d7d..da599161b 100644 --- a/frontends/atari/hotlist.c +++ b/frontends/atari/hotlist.c @@ -25,9 +25,9 @@ #include "utils/log.h" #include "utils/messages.h" -#include "utils/utils.h" #include "utils/nsoption.h" #include "utils/nsurl.h" +#include "netsurf/inttypes.h" #include "netsurf/keypress.h" #include "content/content.h" #include "desktop/hotlist.h" @@ -91,12 +91,12 @@ static void atari_hotlist_draw(struct core_window *cw, int x, static void atari_hotlist_keypress(struct core_window *cw, uint32_t ucs4) { - GUIWIN *gemtk_win; - GRECT area; + //GUIWIN *gemtk_win; + //GRECT area; LOG("ucs4: %"PRIu32 , ucs4); hotlist_keypress(ucs4); - gemtk_win = atari_treeview_get_gemtk_window(cw); - atari_treeview_get_grect(cw, TREEVIEW_AREA_CONTENT, &area); + //gemtk_win = atari_treeview_get_gemtk_window(cw); + //atari_treeview_get_grect(cw, TREEVIEW_AREA_CONTENT, &area); //gemtk_wm_exec_redraw(gemtk_win, &area); } diff --git a/frontends/atari/plot/font_freetype.c b/frontends/atari/plot/font_freetype.c index 8b535e3a3..17d3c3bfd 100644 --- a/frontends/atari/plot/font_freetype.c +++ b/frontends/atari/plot/font_freetype.c @@ -262,13 +262,14 @@ static FT_Glyph ft_getglyph(const plot_font_style_t *fstyle, uint32_t ucs4) FT_UInt glyph_index; FTC_ScalerRec srec; FT_Glyph glyph; - FT_Error error; + //FT_Error error; ftc_faceid_t *ft_face; ft_fill_scalar(fstyle, &srec); ft_face = (ftc_faceid_t *)srec.face_id; glyph_index = FTC_CMapCache_Lookup(ft_cmap_cache, srec.face_id, ft_face->cidx, ucs4); - error = FTC_ImageCache_LookupScaler(ft_image_cache, + //error = + FTC_ImageCache_LookupScaler(ft_image_cache, &srec, FT_LOAD_RENDER | FT_LOAD_FORCE_AUTOHINT | diff --git a/frontends/atari/plot/font_internal.c b/frontends/atari/plot/font_internal.c index 6a811e38b..3575bc3e1 100644 --- a/frontends/atari/plot/font_internal.c +++ b/frontends/atari/plot/font_internal.c @@ -161,7 +161,7 @@ static int pixel_pos( FONT_PLOTTER self, const plot_font_style_t * fstyle,const static void draw_glyph1(FONT_PLOTTER self, GRECT *inloc, uint8_t *chrp, int pitch, uint32_t colour ) { size_t bmpstride; - GRECT clip; + //GRECT clip; uint32_t * fontdata; int xloop,yloop; int stride = pitch / 8; diff --git a/frontends/atari/rootwin.c b/frontends/atari/rootwin.c index dd41e175d..aa8e08047 100644 --- a/frontends/atari/rootwin.c +++ b/frontends/atari/rootwin.c @@ -680,12 +680,12 @@ void window_close_search(ROOTWIN *rootwin) struct browser_window *bw; struct gui_window *gw; GRECT area; - OBJECT *obj; + //OBJECT *obj; gw = rootwin->active_gui_window; bw = gw->browser->bw; - obj = gemtk_obj_get_tree(TOOLBAR); + //obj = gemtk_obj_get_tree(TOOLBAR); if (gw->search != NULL) { nsatari_search_session_destroy(gw->search); diff --git a/frontends/atari/settings.c b/frontends/atari/settings.c index e186a8167..ed1fb2e45 100644 --- a/frontends/atari/settings.c +++ b/frontends/atari/settings.c @@ -593,7 +593,7 @@ static void form_event(int index, int external) else tmp_option_memory_cache_size += 1; - if( tmp_option_memory_cache_size < 0 ) + if( tmp_option_memory_cache_size == 0) tmp_option_memory_cache_size = 1; if( tmp_option_memory_cache_size > 999 ) tmp_option_memory_cache_size = 999; @@ -610,7 +610,7 @@ static void form_event(int index, int external) else tmp_option_disc_cache_size += 1; - if( tmp_option_disc_cache_size < 0 ) + if( tmp_option_disc_cache_size == 0 ) tmp_option_disc_cache_size = 1; if( tmp_option_disc_cache_size > 9999 ) tmp_option_disc_cache_size = 9999; diff --git a/frontends/atari/treeview.c b/frontends/atari/treeview.c index 78da2b097..93aef6eb6 100644 --- a/frontends/atari/treeview.c +++ b/frontends/atari/treeview.c @@ -366,11 +366,11 @@ static void __CDECL on_keybd_event(struct core_window *cw, EVMULT_OUT *ev_out, } -static void __CDECL on_redraw_event(struct core_window *cw, EVMULT_OUT *ev_out, - short msg[8]) +static void __CDECL on_redraw_event(struct core_window *cw, + EVMULT_OUT *ev_out, + short msg[8]) { GRECT work, clip; - struct gemtk_wm_scroll_info_s *slid; struct atari_treeview_window *tv = (struct atari_treeview_window *)cw; if (tv == NULL) @@ -381,7 +381,7 @@ static void __CDECL on_redraw_event(struct core_window *cw, EVMULT_OUT *ev_out, atari_treeview_get_grect(cw, TREEVIEW_AREA_CONTENT, &work); //dbg_grect("treeview work: ", &work); - slid = gemtk_wm_get_scroll_info(tv->window); + gemtk_wm_get_scroll_info(tv->window); clip = work; @@ -390,10 +390,10 @@ static void __CDECL on_redraw_event(struct core_window *cw, EVMULT_OUT *ev_out, return; } - if (atari_treeview_is_iconified(cw) == true) { - atari_treeview_redraw_icon(cw, &clip); - return; - } + if (atari_treeview_is_iconified(cw) == true) { + atari_treeview_redraw_icon(cw, &clip); + return; + } /* make redraw coords relative to content viewport */ clip.g_x -= work.g_x; @@ -425,8 +425,9 @@ static void __CDECL on_redraw_event(struct core_window *cw, EVMULT_OUT *ev_out, } } -static void __CDECL on_mbutton_event(struct core_window *cw, EVMULT_OUT *ev_out, - short msg[8]) +static void __CDECL on_mbutton_event(struct core_window *cw, + EVMULT_OUT *ev_out, + short msg[8]) { struct atari_treeview_window *tv = (struct atari_treeview_window *)cw; struct gemtk_wm_scroll_info_s *slid; -- cgit v1.2.3