summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2016-02-03 23:07:05 +0100
committerBenjamin Otte <otte@redhat.com>2016-02-03 23:07:05 +0100
commita2ac9524bc8d7be4224331e02aa3ad2d54527e88 (patch)
treee072eeed7c655a59bdf49bf73971df98d6dbbad4
parent9708ecdd5bfdfdd10f8cf811bd229d250bbbf725 (diff)
downloadgtk+-a2ac9524bc8d7be4224331e02aa3ad2d54527e88.tar.gz
broadway: Define variables where they are used
Avoids gcc warnings about unused variables.
-rw-r--r--gdk/broadway/broadwayd.c3
-rw-r--r--gdk/broadway/gdkbroadway-server.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/gdk/broadway/broadwayd.c b/gdk/broadway/broadwayd.c
index 143f438c2c..9cbde83ae6 100644
--- a/gdk/broadway/broadwayd.c
+++ b/gdk/broadway/broadwayd.c
@@ -416,7 +416,6 @@ main (int argc, char *argv[])
GInetAddress *inet;
GSocketAddress *address;
GSocketService *listener;
- char *path, *basename;
char *http_address = NULL;
char *unixsocket_address = NULL;
int http_port = 0;
@@ -478,6 +477,8 @@ main (int argc, char *argv[])
#ifdef G_OS_UNIX
else if (display[0] == ':' && g_ascii_isdigit(display[1]))
{
+ char *path, *basename;
+
port = strtol (display + strlen (":"), NULL, 10);
basename = g_strdup_printf ("broadway%d.socket", port + 1);
path = g_build_filename (g_get_user_runtime_dir (), basename, NULL);
diff --git a/gdk/broadway/gdkbroadway-server.c b/gdk/broadway/gdkbroadway-server.c
index acfb2dedd5..deb1692a50 100644
--- a/gdk/broadway/gdkbroadway-server.c
+++ b/gdk/broadway/gdkbroadway-server.c
@@ -95,7 +95,6 @@ GdkBroadwayServer *
_gdk_broadway_server_new (const char *display, GError **error)
{
GdkBroadwayServer *server;
- char *basename;
GSocketClient *client;
GSocketConnection *connection;
GInetAddress *inet;
@@ -103,7 +102,6 @@ _gdk_broadway_server_new (const char *display, GError **error)
GPollableInputStream *pollable;
GInputStream *in;
GSource *source;
- char *path;
char *local_socket_type = NULL;
int port;
@@ -128,6 +126,8 @@ _gdk_broadway_server_new (const char *display, GError **error)
#ifdef G_OS_UNIX
else if (display[0] == ':' && g_ascii_isdigit(display[1]))
{
+ char *path, *basename;
+
port = strtol (display + strlen (":"), NULL, 10);
basename = g_strdup_printf ("broadway%d.socket", port + 1);
path = g_build_filename (g_get_user_runtime_dir (), basename, NULL);