Quoth pancake:
> surf.c: In function ‘gotheaders’:
> surf.c:337:11: warning: variable ‘uri’ set but not used
> [-Wunused-but-set-variable]

Good spot. My gcc doesn't catch that, but you're right, it is 
unused. I'm attaching a patch that removes use of that variable, 
plus removes a couple of unused arguments from functions (found with 
-Wextra).

> surf.c: At top level:
> surf.c:800:1: warning: ‘eval’ defined but not used [-Wunused-function]

I think eval is probably useful to keep as a hook, though. For 
config.h funkiness or something else someone wants to do. I don't 
have strong feelings on the matter, though.

Nick
diff -r ee772272a082 surf.c
--- a/surf.c	Thu May 31 11:46:24 2012 +0200
+++ b/surf.c	Mon Jun 11 15:09:17 2012 +0100
@@ -151,7 +151,7 @@
 }
 
 void
-evalscript(WebKitWebFrame *frame, JSContextRef js, char *script, char* scriptname) {
+evalscript(JSContextRef js, char *script, char* scriptname) {
 	JSStringRef jsscript, jsscriptname;
 	JSValueRef exception = NULL;
 
@@ -163,12 +163,12 @@
 }
 
 void
-runscript(WebKitWebFrame *frame, JSContextRef js) {
+runscript(WebKitWebFrame *frame) {
 	char *script;
 	GError *error;
 
 	if(g_file_get_contents(scriptfile, &script, NULL, &error)) {
-		evalscript(frame, webkit_web_frame_get_global_context(frame), script, scriptfile);
+		evalscript(webkit_web_frame_get_global_context(frame), script, scriptfile);
 	}
 }
 
@@ -334,10 +334,8 @@
 
 void
 gotheaders(SoupMessage *msg, gpointer v) {
-	SoupURI *uri;
 	GSList *l, *p;
 
-	uri = soup_message_get_uri(msg);
 	for(p = l = soup_cookies_from_response(msg); p;
 		p = g_slist_next(p))  {
 		setcookie((SoupCookie *)p->data);
@@ -524,7 +522,7 @@
 	gdk_window_add_filter(GTK_WIDGET(c->win)->window, processx, c);
 	webkit_web_view_set_full_content_zoom(c->view, TRUE);
 	frame = webkit_web_view_get_main_frame(c->view);
-	runscript(frame, webkit_web_frame_get_global_context(frame));
+	runscript(frame);
 	settings = webkit_web_view_get_settings(c->view);
 	if(!(ua = getenv("SURF_USERAGENT")))
 		ua = useragent;
@@ -799,7 +797,7 @@
 void
 eval(Client *c, const Arg *arg) {
 	WebKitWebFrame *frame = webkit_web_view_get_main_frame(c->view);
-	evalscript(frame, webkit_web_frame_get_global_context(frame), ((char **)arg->v)[0], "");
+	evalscript(webkit_web_frame_get_global_context(frame), ((char **)arg->v)[0], "");
 }
 
 void
@@ -842,7 +840,7 @@
 
 void
 windowobjectcleared(GtkWidget *w, WebKitWebFrame *frame, JSContextRef js, JSObjectRef win, Client *c) {
-	runscript(frame, js);
+	runscript(frame);
 }
 
 void

Reply via email to