From 80d68a9784a7b3936280b98e88c61fad2c8cec99 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Sat, 13 May 2017 21:08:42 +0200 Subject: Clean up debug board logging and other crap --- content/fetch.c | 1 - content/fetchers/httplib_kolibri.c | 19 ++----------------- frontends/kolibrios/Makefile | 4 ++-- frontends/kolibrios/Makefile.defaults | 2 +- frontends/kolibrios/fb/font_freetype.c | 2 +- frontends/kolibrios/fb/gui.c | 20 ++++++++------------ 6 files changed, 14 insertions(+), 34 deletions(-) diff --git a/content/fetch.c b/content/fetch.c index 872cf0ff0..2887d3ad8 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -605,7 +605,6 @@ fetch_start(nsurl *url, /* exported interface documented in content/fetch.h */ void fetch_abort(struct fetch *f) { - debug_board_printf("---- fetch.c : fetch_abort for fetch 0x%x\n", f); assert(f); NSLOG(fetch, DEBUG, "fetch %p, fetcher %p, url '%s'", f, f->fetcher_handle, diff --git a/content/fetchers/httplib_kolibri.c b/content/fetchers/httplib_kolibri.c index 3361b0460..d3f268983 100644 --- a/content/fetchers/httplib_kolibri.c +++ b/content/fetchers/httplib_kolibri.c @@ -38,18 +38,14 @@ void add_to_poll(struct httpfetcher *newfetcher) { if(head == NULL) { head = newfetcher; - LOG("-=- head was NULL. head is now : 0x%x", head); assert(head->next == NULL); } else { while(t->next != NULL) { - LOG("-=- Passing through httpfetcher : 0x%x", t); t = t->next; } - LOG("-=- Adding after httpfetcher : 0x%x", t); t->next = newfetcher; } - LOG("-=- done: newfetcher 0x%x, newfetcher->handle 0x%x", newfetcher, newfetcher->handle); } void remove_from_poll(struct http_msg *donehttp) { @@ -58,21 +54,13 @@ void remove_from_poll(struct http_msg *donehttp) { /* STOP; */ while(t) { - LOG("------- t = 0x%x, t->handle = 0x%x", t, t->handle); - /* STOP; */ - if (t->handle == donehttp) { - LOG(" -- t->handle == donehttp"); if(t == head) { - LOG("--- t == head"); p = t->next; head = p; - LOG("-=- Setting head to 0x%x", p); break; } else { - LOG("--- t != head"); - LOG("-=- p is 0x%x", p); p->next = t->next; break; } @@ -88,7 +76,6 @@ bool init_fetcher(lwc_string *scheme) { assert(lwc_string_isequal(scheme, corestring_lwc_http, &supported_scheme) == lwc_error_ok); LOG("Initializing http library!"); - debug_board_printf("fetcher_init: Initializing http library!\n"); if(kolibri_http_init() == 0) LOG("[INFO] Loaded http.obj library successfully.\n"); else { @@ -258,7 +245,6 @@ void poll_fetch(lwc_string *scheme) { continue; } else { - LOG("---- finding header 'location' for fetch 0x%x", t->owner); fetch_msg msg; int lenloc = 0; char *tmp = http_find_header_field_asm(t->handle, "location"); @@ -273,7 +259,6 @@ void poll_fetch(lwc_string *scheme) { LOG("---- [3xx] : Redirect to %s", msg.data.redirect); fetch_send_callback(&msg, t->owner); t->headercbdone = true; - LOG("---- call Remove t->handle = 0x%x", t->handle); remove_from_poll(t->handle); /* t = t->next; */ t = head; @@ -300,7 +285,7 @@ void poll_fetch(lwc_string *scheme) { } else if(ret == -1) { /* If data was received send it to netsurf core with FETCH_DATA */ - /* LOG("Doing a data callback; so far : %u vs %u!", t->datalen_cb_done, t->handle->content_received); */ + LOG("Doing a data callback; so far : %u vs %u!", t->datalen_cb_done, t->handle->content_received); if(t->handle->content_received > t->datalen_cb_done) { fetch_msg msg; @@ -338,7 +323,7 @@ void poll_fetch(lwc_string *scheme) { continue; } - LOG("Main loop: t going from 0x%x to 0x%x", t->owner, t->next != NULL ? t->next->owner : "0"); + LOG("Main loop: t going from 0x%x to 0x%x", t->owner, t->next != NULL ? t->next->owner : NULL); t = t->next; } diff --git a/frontends/kolibrios/Makefile b/frontends/kolibrios/Makefile index 0a7da7ff7..716166c66 100644 --- a/frontends/kolibrios/Makefile +++ b/frontends/kolibrios/Makefile @@ -5,8 +5,8 @@ KOL_OTHER_INCLUDES := -I$(HOME)/kolibrios/contrib/sdk/sources/libpng/ -I$(HOME)/ CFLAGS += $(KOL_OTHER_INCLUDES) $(DMACROS) -std=c99 -g -CFLAGS += '-DNETSURF_KOLIBRI_FONTPATH="$(NETSURF_KOLIBRI_FONTPATH)"' -CFLAGS += '-DKOLIBRIOS_RESPATH="$(NETSURF_KOLIBRI_RESPATH)"' +# CFLAGS += '-DNETSURF_KOLIBRI_FONTPATH="$(NETSURF_KOLIBRI_FONTPATH)"' +# CFLAGS += '-DKOLIBRIOS_RESPATH="$(NETSURF_KOLIBRI_RESPATH)"' CFLAGS += '-DNETSURF_USE_KOLIBRI_HTTPLIB' ########################################################################## # Only for FB compat with kolibri. Get rid soon. diff --git a/frontends/kolibrios/Makefile.defaults b/frontends/kolibrios/Makefile.defaults index c727c6451..ef51b6cf4 100644 --- a/frontends/kolibrios/Makefile.defaults +++ b/frontends/kolibrios/Makefile.defaults @@ -24,7 +24,7 @@ NETSURF_USE_ROSPRITE := NO # Library to use for font plotting # Valid options: internal, freetype NETSURF_KOLIBRI_FONTLIB := freetype -NETSURF_KOLIBRI_FONTPATH := /usbhd0/1/bin/res/ +# NETSURF_KOLIBRI_FONTPATH := /usbhd0/1/bin/res/ # Default freetype font files NETSURF_KOLIBRI_FONT_SANS_SERIF := sans.ttf diff --git a/frontends/kolibrios/fb/font_freetype.c b/frontends/kolibrios/fb/font_freetype.c index 68a54a384..b12bc9903 100644 --- a/frontends/kolibrios/fb/font_freetype.c +++ b/frontends/kolibrios/fb/font_freetype.c @@ -119,7 +119,7 @@ fb_new_face(const char *option, const char *resname, const char *fontname) fb_faceid_t *newf; FT_Error error; FT_Face aface; - char buf[PATH_MAX]; + char buf[PATH_MAX]; newf = calloc(1, sizeof(fb_faceid_t)); diff --git a/frontends/kolibrios/fb/gui.c b/frontends/kolibrios/fb/gui.c index 90388acda..6d21b737e 100644 --- a/frontends/kolibrios/fb/gui.c +++ b/frontends/kolibrios/fb/gui.c @@ -60,11 +60,6 @@ #define NSFB_TOOLBAR_DEFAULT_LAYOUT "blfsrutc" -/* #undef LOG */ -/* #define LOG(format, args...) \ */ -/* debug_board_printf(format, ##args); \ */ -/* debug_board_printf("\n"); \ */ - fbtk_widget_t *fbtk; static bool fb_complete = false; @@ -493,6 +488,7 @@ process_cmdline(int argc, char** argv) } /* Remove me! */ + /* feurl = "file:///usbhd0/1/bin/res/text.html"; */ feurl = "http://board.kolibrios.org"; /* NS on KolibriOS does not support option parsing (yet) */ @@ -2140,16 +2136,16 @@ int main(int argc, char** argv) /* Initialize heap so that we can do memory allocations */ unsigned int heapsize = heap_init(); - debug_board_printf("[SYSTEM] Initialized heap (Size = %u bytes)\n", heapsize); + LOG("[SYSTEM] Initialized heap (Size = %u bytes)\n", heapsize); assert(heapsize != 0); /* fix args */ -#define MKARGV(i,opt) argv[i] = (char *) malloc(strlen(opt) + 1); strcpy(argv[i], opt); -#define ARGC 3 -MKARGV(1, "-V"); -MKARGV(2, "/tmp0/1/netsurf.log"); -MKARGV(ARGC, "\0"); - argc = ARGC; +/* #define MKARGV(i,opt) argv[i] = (char *) malloc(strlen(opt) + 1); strcpy(argv[i], opt); */ +/* #define ARGC 3 */ +/* MKARGV(1, "-V"); */ +/* MKARGV(2, "/tmp0/1/netsurf.log"); */ +/* MKARGV(ARGC, "\0"); */ +/* argc = ARGC; */ /* args fixed */ /* The only restriction is that the kolibrios-netsurf binary and the res/ directory should be in the same directory. */ -- cgit v1.2.3