about summary refs log tree commit diff
path: root/surf.c
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2015-11-22 02:03:26 +0100
committerQuentin Rameau <quinq@fifth.space>2015-11-22 02:03:26 +0100
commitfef80cd56ccca7e0816d39e85cf6c0f3f09b8c3c (patch)
treedae82f07381b5a862b276b66f653ce9ed2410558 /surf.c
parentUse char instead of gchar and make them const when possible (diff)
downloadsurf-fef80cd56ccca7e0816d39e85cf6c0f3f09b8c3c.tar.gz
surf-fef80cd56ccca7e0816d39e85cf6c0f3f09b8c3c.tar.bz2
surf-fef80cd56ccca7e0816d39e85cf6c0f3f09b8c3c.zip
Un(g)boolify to separate GTK dependant code from the rest
Diffstat (limited to 'surf.c')
-rw-r--r--surf.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/surf.c b/surf.c
index 23fd452..610aff2 100644
--- a/surf.c
+++ b/surf.c
@@ -56,8 +56,8 @@ enum {
 };
 
 typedef union {
-	gboolean b;
-	gint i;
+	int b;
+	int i;
 	const void *v;
 } Arg;
 
@@ -69,8 +69,7 @@ typedef struct Client {
 	WebKitHitTestResult *mousepos;
 	GTlsCertificateFlags tlsflags;
 	Window xid;
-	gint progress;
-	gboolean fullscreen;
+	int progress, fullscreen;
 	const char *title, *targeturi;
 	const char *needle;
 	struct Client *next;
@@ -122,7 +121,7 @@ static void runscript(Client *c);
 static void evalscript(Client *c, const char *jsstr, ...);
 static void updatewinid(Client *c);
 static void handleplumb(Client *c, const char *uri);
-static void newwindow(Client *c, const Arg *a, gboolean noembed);
+static void newwindow(Client *c, const Arg *a, int noembed);
 static void spawn(Client *c, const Arg *a);
 static void destroyclient(Client *c);
 static void cleanup(void);
@@ -185,7 +184,7 @@ static char togglestats[10];
 static char pagestats[2];
 static Atom atoms[AtomLast];
 static Window embed;
-static gboolean showxid = FALSE;
+static int showxid;
 static int cookiepolicy;
 static Display *dpy;
 static Client *clients;
@@ -1235,8 +1234,7 @@ pasteuri(GtkClipboard *clipboard, const char *text, gpointer d)
 void
 reload(Client *c, const Arg *a)
 {
-	gboolean nocache = *(gboolean *)a;
-	if (nocache)
+	if (a->b)
 		webkit_web_view_reload_bypass_cache(c->view);
 	else
 		webkit_web_view_reload(c->view);
@@ -1542,7 +1540,7 @@ main(int argc, char *argv[])
 		die("surf-"VERSION", ©2009-2015 surf engineers, "
 		    "see LICENSE for details\n");
 	case 'x':
-		showxid = TRUE;
+		showxid = 1;
 		break;
 	case 'z':
 		zoomlevel = strtof(EARGF(usage()), NULL);