[glib] Cleanups



commit 1d22b64843c83631bcd0e5255930f3a4e990961e
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri May 14 08:38:07 2010 -0400

    Cleanups
    
    Sort #includes a bit better, and don't include platform-specific
    headers in gio.h.

 gio/gcredentials.c               |    9 +++++----
 gio/gdbus-tool.c                 |    4 ++--
 gio/gdbusauth.c                  |   11 ++++++-----
 gio/gdbusauthmechanismexternal.c |    9 ++++-----
 gio/gdbusauthmechanismsha1.c     |   18 ++++++++----------
 gio/gdbusconnection.c            |   10 ++++++----
 gio/gdbusmessage.c               |   11 ++++++-----
 gio/gdbusprivate.c               |    8 ++------
 gio/gdbusproxywatching.c         |    1 -
 gio/gdbusserver.c                |    4 +++-
 gio/gio.h                        |    1 -
 11 files changed, 42 insertions(+), 44 deletions(-)
---
diff --git a/gio/gcredentials.c b/gio/gcredentials.c
index feedbf7..bcea1a4 100644
--- a/gio/gcredentials.c
+++ b/gio/gcredentials.c
@@ -23,10 +23,6 @@
 #include "config.h"
 
 #include <stdlib.h>
-#include <gobject/gvaluecollector.h>
-
-#include "gcredentials.h"
-#include "gioerror.h"
 
 #ifdef __linux__
 #define __USE_GNU
@@ -36,6 +32,11 @@
 #include <string.h>
 #endif
 
+#include <gobject/gvaluecollector.h>
+
+#include "gcredentials.h"
+#include "gioerror.h"
+
 #include "glibintl.h"
 #include "gioalias.h"
 
diff --git a/gio/gdbus-tool.c b/gio/gdbus-tool.c
index 5b54893..73b028f 100644
--- a/gio/gdbus-tool.c
+++ b/gio/gdbus-tool.c
@@ -22,11 +22,11 @@
 
 #include "config.h"
 
+#include <stdlib.h>
 #include <string.h>
+#include <stdio.h>
 
 #include <gio/gio.h>
-#include <stdio.h>
-#include <stdlib.h>
 
 #include <gi18n.h>
 
diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c
index a94fcfa..d46f32a 100644
--- a/gio/gdbusauth.c
+++ b/gio/gdbusauth.c
@@ -22,11 +22,14 @@
 
 #include "config.h"
 
+#include <sys/types.h>
+#include <sys/socket.h>
+
 #include "gdbusauth.h"
+
 #include "gdbusauthmechanismanon.h"
 #include "gdbusauthmechanismexternal.h"
 #include "gdbusauthmechanismsha1.h"
-
 #include "gdbusauthobserver.h"
 
 #include "gdbuserror.h"
@@ -36,16 +39,14 @@
 #include "gdbusprivate.h"
 
 #ifdef G_OS_UNIX
-#include <gio/gunixconnection.h>
+#include "gunixconnection.h"
 #include "gunixcredentialsmessage.h"
-#include <sys/types.h>
-#include <sys/socket.h>
 #endif
 
 #include "glibintl.h"
 #include "gioalias.h"
 
-#define DEBUG_ENABLED 1
+#define DEBUG_ENABLED 0
 
 static void
 debug_print (const gchar *message, ...)
diff --git a/gio/gdbusauthmechanismexternal.c b/gio/gdbusauthmechanismexternal.c
index 0ec56b9..9cd3b78 100644
--- a/gio/gdbusauthmechanismexternal.c
+++ b/gio/gdbusauthmechanismexternal.c
@@ -23,17 +23,16 @@
 #include "config.h"
 
 #include <string.h>
+#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 
 #include "gdbusauthmechanismexternal.h"
 #include "gcredentials.h"
 #include "gdbuserror.h"
 #include "gioenumtypes.h"
 
-#ifdef G_OS_UNIX
-#include <sys/types.h>
-#include <unistd.h>
-#endif
-
 #include "glibintl.h"
 #include "gioalias.h"
 
diff --git a/gio/gdbusauthmechanismsha1.c b/gio/gdbusauthmechanismsha1.c
index 405698e..020aaba 100644
--- a/gio/gdbusauthmechanismsha1.c
+++ b/gio/gdbusauthmechanismsha1.c
@@ -23,6 +23,14 @@
 #include "config.h"
 
 #include <string.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <glib/gstdio.h>
 
 #include "gdbusauthmechanismsha1.h"
 #include "gcredentials.h"
@@ -30,16 +38,6 @@
 #include "gioenumtypes.h"
 #include "gioerror.h"
 
-#ifdef G_OS_UNIX
-#include <unistd.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#endif
-
-#include <errno.h>
-
-#include <glib/gstdio.h>
-
 #include "glibintl.h"
 #include "gioalias.h"
 
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index c3d17af..277199e 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -101,6 +101,10 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 
 #include "gdbusauth.h"
 #include "gdbusutils.h"
@@ -121,10 +125,8 @@
 #include "gsimpleasyncresult.h"
 
 #ifdef G_OS_UNIX
-#include <gio/gunixconnection.h>
-#include <gio/gunixfdmessage.h>
-#include <unistd.h>
-#include <sys/types.h>
+#include "gunixconnection.h"
+#include "gunixfdmessage.h"
 #endif
 
 #include "glibintl.h"
diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c
index bfc46f0..0f1e0d2 100644
--- a/gio/gdbusmessage.c
+++ b/gio/gdbusmessage.c
@@ -23,6 +23,12 @@
 #include "config.h"
 
 #include <string.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 
 #include "gdbusutils.h"
 #include "gdbusmessage.h"
@@ -39,11 +45,6 @@
 
 #ifdef G_OS_UNIX
 #include "gunixfdlist.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <errno.h>
 #endif
 
 #include "glibintl.h"
diff --git a/gio/gdbusprivate.c b/gio/gdbusprivate.c
index da06fe5..d85c97f 100644
--- a/gio/gdbusprivate.c
+++ b/gio/gdbusprivate.c
@@ -24,11 +24,7 @@
 
 #include <stdlib.h>
 #include <string.h>
-
-#ifdef G_OS_UNIX
-#include <gio/gunixconnection.h>
-#include <gio/gunixfdmessage.h>
-#include "gunixcredentialsmessage.h"
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
@@ -45,9 +41,9 @@
 #include "gsocketcontrolmessage.h"
 
 #ifdef G_OS_UNIX
-#include <unistd.h>
 #include "gunixfdmessage.h"
 #include "gunixconnection.h"
+#include "gunixcredentialsmessage.h"
 #endif
 
 #include "glibintl.h"
diff --git a/gio/gdbusproxywatching.c b/gio/gdbusproxywatching.c
index 2edcb82..17ab078 100644
--- a/gio/gdbusproxywatching.c
+++ b/gio/gdbusproxywatching.c
@@ -31,7 +31,6 @@
 #include "gdbuserror.h"
 #include "gdbusprivate.h"
 #include "gdbusproxy.h"
-#include "gdbusnamewatching.h"
 #include "gcancellable.h"
 
 #include "glibintl.h"
diff --git a/gio/gdbusserver.c b/gio/gdbusserver.c
index b6bd931..cb1c595 100644
--- a/gio/gdbusserver.c
+++ b/gio/gdbusserver.c
@@ -25,6 +25,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 
 #include "giotypes.h"
 #include "gdbusaddress.h"
@@ -39,7 +42,6 @@
 #include "gsocketservice.h"
 
 #ifdef G_OS_UNIX
-#include <unistd.h>
 #include "gunixsocketaddress.h"
 #endif
 
diff --git a/gio/gio.h b/gio/gio.h
index ca55cd6..dd5c811 100644
--- a/gio/gio.h
+++ b/gio/gio.h
@@ -110,7 +110,6 @@
 #include <gio/gdbusmethodinvocation.h>
 #include <gio/gdbusserver.h>
 #include <gio/gcredentials.h>
-#include <gio/gunixcredentialsmessage.h>
 #include <gio/gdbusauthobserver.h>
 
 #undef __GIO_GIO_H_INSIDE__



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]