summaryrefslogtreecommitdiff
path: root/atari/gui.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-05-28 16:08:46 +0100
committerVincent Sanders <vince@kyllikki.org>2015-05-28 16:08:46 +0100
commitc105738fa36bb2400adc47399c5b878d252d1c86 (patch)
tree138eeb449e1bf51ee1726b5f820740aada0ccd0b /atari/gui.c
parent20f2c86a511f7913cf858e7bd3668b0b59663ba0 (diff)
downloadnetsurf-c105738fa36bb2400adc47399c5b878d252d1c86.tar.gz
netsurf-c105738fa36bb2400adc47399c5b878d252d1c86.tar.bz2
Change LOG() macro to be varadic
This changes the LOG macro to be varadic removing the need for all callsites to have double bracketing and allows for future improvement on how we use the logging macros. The callsites were changed with coccinelle and the changes checked by hand. Compile tested for several frontends but not all. A formatting annotation has also been added which allows the compiler to check the parameters and types passed to the logging.
Diffstat (limited to 'atari/gui.c')
-rw-r--r--atari/gui.c52
1 files changed, 25 insertions, 27 deletions
diff --git a/atari/gui.c b/atari/gui.c
index daf342ae2..23d31420d 100644
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -150,11 +150,11 @@ static void atari_poll(void)
evnt_multi_fast(&aes_event_in, aes_msg_out, &aes_event_out);
if(gemtk_wm_dispatch_event(&aes_event_in, &aes_event_out, aes_msg_out) == 0) {
if( (aes_event_out.emo_events & MU_MESAG) != 0 ) {
- LOG(("WM: %d\n", aes_msg_out[0]));
+ LOG("WM: %d\n", aes_msg_out[0]);
switch(aes_msg_out[0]) {
case MN_SELECTED:
- LOG(("Menu Item: %d\n",aes_msg_out[4]));
+ LOG("Menu Item: %d\n", aes_msg_out[4]);
deskmenu_dispatch_item(aes_msg_out[3], aes_msg_out[4]);
break;
@@ -206,15 +206,13 @@ gui_window_create(struct browser_window *bw,
gui_window_create_flags flags)
{
struct gui_window *gw=NULL;
- LOG(( "gw: %p, BW: %p, existing %p, flags: %d\n" , gw, bw, existing,
- (int)flags
- ));
+ LOG("gw: %p, BW: %p, existing %p, flags: %d\n", gw, bw, existing, (int)flags);
gw = calloc(1, sizeof(struct gui_window));
if (gw == NULL)
return NULL;
- LOG(("new window: %p, bw: %p\n", gw, bw));
+ LOG("new window: %p, bw: %p\n", gw, bw);
window_create(gw, bw, existing, WIDGET_STATUSBAR|WIDGET_TOOLBAR|WIDGET_RESIZE\
|WIDGET_SCROLL);
if (gw->root->win) {
@@ -266,7 +264,7 @@ void gui_window_destroy(struct gui_window *gw)
if (gw == NULL)
return;
- LOG(("%s\n", __FUNCTION__ ));
+ LOG("%s\n", __FUNCTION__);
if (input_window == gw) {
gui_set_input_gui_window(NULL);
@@ -445,7 +443,7 @@ static void gui_window_set_scroll(struct gui_window *w, int sx, int sy)
|| (!browser_window_has_content(w->browser->bw)))
return;
- LOG(("scroll (gui_window: %p) %d, %d\n", w, sx, sy));
+ LOG("scroll (gui_window: %p) %d, %d\n", w, sx, sy);
window_scroll_by(w->root, sx, sy);
return;
@@ -772,7 +770,7 @@ static void gui_401login_open(nsurl *url, const char *realm,
char * out = NULL;
bres = login_form_do( url, (char*)realm, &out);
if (bres) {
- LOG(("url: %s, realm: %s, auth: %s\n", url, realm, out ));
+ LOG("url: %s, realm: %s, auth: %s\n", url, realm, out);
urldb_set_auth_details(url, realm, out);
}
if (out != NULL) {
@@ -790,7 +788,7 @@ gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
void *cbpw)
{
struct sslcert_session_data *data;
- LOG((""));
+ LOG("");
// TODO: localize string
int b = form_alert(1, "[2][SSL Verify failed, continue?][Continue|Abort|Details...]");
@@ -813,7 +811,7 @@ gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
void gui_set_input_gui_window(struct gui_window *gw)
{
- LOG(("Setting input window from: %p to %p\n", input_window, gw));
+ LOG("Setting input window from: %p to %p\n", input_window, gw);
input_window = gw;
}
@@ -824,7 +822,7 @@ struct gui_window * gui_get_input_window(void)
static void gui_quit(void)
{
- LOG((""));
+ LOG("");
struct gui_window * gw = window_list;
struct gui_window * tmp = window_list;
@@ -856,9 +854,9 @@ static void gui_quit(void)
rsrc_free();
- LOG(("Shutting down plotter"));
+ LOG("Shutting down plotter");
plot_finalise();
- LOG(("done"));
+ LOG("done");
}
/**
@@ -870,7 +868,7 @@ process_cmdline(int argc, char** argv)
int opt;
bool set_default_dimensions = true;
- LOG(("argc %d, argv %p", argc, argv));
+ LOG("argc %d, argv %p", argc, argv);
if ((nsoption_int(window_width) != 0) && (nsoption_int(window_height) != 0)) {
@@ -963,7 +961,7 @@ static nserror set_defaults(struct nsoption_s *defaults)
/* Set defaults for absent option strings */
nsoption_setnull_charp(cookie_file, strdup("cookies"));
if (nsoption_charp(cookie_file) == NULL) {
- LOG(("Failed initialising string options"));
+ LOG("Failed initialising string options");
return NSERROR_BAD_PARAMETER;
}
return NSERROR_OK;
@@ -980,7 +978,7 @@ static void gui_init(int argc, char** argv)
OBJECT * cursors;
atari_find_resource(buf, "netsurf.rsc", "./res/netsurf.rsc");
- LOG(("Using RSC file: %s ", (char*)&buf));
+ LOG("Using RSC file: %s ", (char *)&buf);
if (rsrc_load(buf)==0) {
char msg[1024];
@@ -1016,15 +1014,15 @@ static void gui_init(int argc, char** argv)
create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_HELP,
cursors, &gem_cursors.help);
- LOG(("Enabling core select menu"));
+ LOG("Enabling core select menu");
nsoption_set_bool(core_select_menu, true);
- LOG(("Loading url.db from: %s", nsoption_charp(url_file) ));
+ LOG("Loading url.db from: %s", nsoption_charp(url_file));
if( strlen(nsoption_charp(url_file)) ) {
urldb_load(nsoption_charp(url_file));
}
- LOG(("Loading cookies from: %s", nsoption_charp(cookie_file) ));
+ LOG("Loading cookies from: %s", nsoption_charp(cookie_file));
if( strlen(nsoption_charp(cookie_file)) ) {
urldb_load_cookies(nsoption_charp(cookie_file));
}
@@ -1032,10 +1030,10 @@ static void gui_init(int argc, char** argv)
if (process_cmdline(argc,argv) != true)
die("unable to process command line.\n");
- LOG(("Initializing NKC..."));
+ LOG("Initializing NKC...");
nkc_init();
- LOG(("Initializing plotters..."));
+ LOG("Initializing plotters...");
plot_init(nsoption_charp(atari_font_driver));
aes_event_in.emi_m1leave = MO_LEAVE;
@@ -1172,18 +1170,18 @@ int main(int argc, char** argv)
nsoption_commandline(&argc, argv, NULL);
/* common initialisation */
- LOG(("Initialising core..."));
+ LOG("Initialising core...");
ret = netsurf_init(messages, store);
if (ret != NSERROR_OK) {
die("NetSurf failed to initialise");
}
- LOG(("Initializing GUI..."));
+ LOG("Initializing GUI...");
gui_init(argc, argv);
graf_mouse( ARROW , NULL);
- LOG(("Creating initial browser window..."));
+ LOG("Creating initial browser window...");
addr = option_homepage_url;
if (strncmp(addr, "file://", 7) && strncmp(addr, "http://", 7)) {
if (stat(addr, &stat_buf) == 0) {
@@ -1205,7 +1203,7 @@ int main(int argc, char** argv)
if (ret != NSERROR_OK) {
warn_user(messages_get_errorcode(ret), 0);
} else {
- LOG(("Entering Atari event mainloop..."));
+ LOG("Entering Atari event mainloop...");
while (!atari_quit) {
atari_poll();
}
@@ -1219,7 +1217,7 @@ int main(int argc, char** argv)
fclose(stdout);
fclose(stderr);
#endif
- LOG(("exit_gem"));
+ LOG("exit_gem");
exit_gem();
return 0;