[pulseaudio-discuss] [PATCH 1/7] Fixup #include directives according to Coding Style

Maarten Bosmans mkbosmans at gmail.com
Wed Mar 9 01:00:20 PST 2011


Use #include "header.h" if functionality of header.h is implemented
and #include <header.h> if functionality of header.h is used.
---
 src/pulse/browser.c             |    2 +-
 src/pulse/context.c             |   13 +++++--------
 src/pulse/ext-device-manager.c  |    5 ++---
 src/pulse/ext-stream-restore.c  |    5 ++---
 src/pulse/introspect.c          |    3 +--
 src/pulse/scache.c              |    4 ++--
 src/pulse/stream.c              |    4 ++--
 src/pulse/subscribe.c           |    1 -
 src/pulsecore/asyncq.c          |    5 +++--
 src/pulsecore/protocol-esound.c |    3 +--
 src/pulsecore/resampler.c       |    2 +-
 src/pulsecore/sample-util.c     |    2 +-
 src/pulsecore/sconv-s16le.c     |    3 +--
 src/pulsecore/sconv.c           |    6 +++---
 src/pulsecore/sconv_sse.c       |    3 +--
 src/pulsecore/svolume_arm.c     |    2 +-
 src/pulsecore/svolume_c.c       |    2 +-
 src/pulsecore/svolume_mmx.c     |    2 +-
 src/pulsecore/svolume_sse.c     |    2 +-
 src/tests/cpulimit-test.c       |    2 +-
 src/utils/pax11publish.c        |    2 +-
 21 files changed, 32 insertions(+), 41 deletions(-)

diff --git a/src/pulse/browser.c b/src/pulse/browser.c
index 4cf5d0c..d059228 100644
--- a/src/pulse/browser.c
+++ b/src/pulse/browser.c
@@ -20,7 +20,7 @@
 ***/
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
 #include <string.h>
diff --git a/src/pulse/context.c b/src/pulse/context.c
index 8f632b5..1480af5 100644
--- a/src/pulse/context.c
+++ b/src/pulse/context.c
@@ -53,6 +53,11 @@
 #include <pulse/i18n.h>
 #include <pulse/mainloop.h>
 #include <pulse/timeval.h>
+#include <pulse/fork-detect.h>
+#include <pulse/client-conf.h>
+#ifdef HAVE_X11
+#include <pulse/client-conf-x11.h>
+#endif
 
 #include <pulsecore/core-error.h>
 #include <pulsecore/native-common.h>
@@ -71,14 +76,6 @@
 #include <pulsecore/proplist-util.h>
 
 #include "internal.h"
-
-#include "client-conf.h"
-#include "fork-detect.h"
-
-#ifdef HAVE_X11
-#include "client-conf-x11.h"
-#endif
-
 #include "context.h"
 
 void pa_command_extension(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
diff --git a/src/pulse/ext-device-manager.c b/src/pulse/ext-device-manager.c
index 57cb57c..7b78c24 100644
--- a/src/pulse/ext-device-manager.c
+++ b/src/pulse/ext-device-manager.c
@@ -27,14 +27,13 @@
 #include <pulse/context.h>
 #include <pulse/gccmacro.h>
 #include <pulse/xmalloc.h>
+#include <pulse/fork-detect.h>
+#include <pulse/operation.h>
 
 #include <pulsecore/macro.h>
 #include <pulsecore/pstream-util.h>
 
 #include "internal.h"
-#include "operation.h"
-#include "fork-detect.h"
-
 #include "ext-device-manager.h"
 
 enum {
diff --git a/src/pulse/ext-stream-restore.c b/src/pulse/ext-stream-restore.c
index 10e9fd5..7bc1a61 100644
--- a/src/pulse/ext-stream-restore.c
+++ b/src/pulse/ext-stream-restore.c
@@ -25,14 +25,13 @@
 
 #include <pulse/context.h>
 #include <pulse/gccmacro.h>
+#include <pulse/fork-detect.h>
+#include <pulse/operation.h>
 
 #include <pulsecore/macro.h>
 #include <pulsecore/pstream-util.h>
 
 #include "internal.h"
-#include "operation.h"
-#include "fork-detect.h"
-
 #include "ext-stream-restore.h"
 
 enum {
diff --git a/src/pulse/introspect.c b/src/pulse/introspect.c
index 2a81788..de91585 100644
--- a/src/pulse/introspect.c
+++ b/src/pulse/introspect.c
@@ -29,14 +29,13 @@
 #include <pulse/context.h>
 #include <pulse/gccmacro.h>
 #include <pulse/xmalloc.h>
+#include <pulse/fork-detect.h>
 
 #include <pulsecore/macro.h>
 #include <pulsecore/core-util.h>
 #include <pulsecore/pstream-util.h>
 
 #include "internal.h"
-#include "fork-detect.h"
-
 #include "introspect.h"
 
 /*** Statistics ***/
diff --git a/src/pulse/scache.c b/src/pulse/scache.c
index cb8d7c5..6ed80a6 100644
--- a/src/pulse/scache.c
+++ b/src/pulse/scache.c
@@ -28,14 +28,14 @@
 #include <string.h>
 
 #include <pulse/utf8.h>
-#include <pulse/scache.h>
+#include <pulse/fork-detect.h>
 
 #include <pulsecore/pstream-util.h>
 #include <pulsecore/macro.h>
 #include <pulsecore/proplist-util.h>
 
-#include "fork-detect.h"
 #include "internal.h"
+#include "scache.h"
 
 int pa_stream_connect_upload(pa_stream *s, size_t length) {
     pa_tagstruct *t;
diff --git a/src/pulse/stream.c b/src/pulse/stream.c
index ea468a5..ef27fe5 100644
--- a/src/pulse/stream.c
+++ b/src/pulse/stream.c
@@ -29,10 +29,10 @@
 #include <string.h>
 
 #include <pulse/def.h>
-#include <pulse/stream.h>
 #include <pulse/timeval.h>
 #include <pulse/rtclock.h>
 #include <pulse/xmalloc.h>
+#include <pulse/fork-detect.h>
 
 #include <pulsecore/pstream-util.h>
 #include <pulsecore/log.h>
@@ -41,8 +41,8 @@
 #include <pulsecore/core-rtclock.h>
 #include <pulsecore/core-util.h>
 
-#include "fork-detect.h"
 #include "internal.h"
+#include "stream.h"
 
 #define AUTO_TIMING_INTERVAL_START_USEC (10*PA_USEC_PER_MSEC)
 #define AUTO_TIMING_INTERVAL_END_USEC (1500*PA_USEC_PER_MSEC)
diff --git a/src/pulse/subscribe.c b/src/pulse/subscribe.c
index 203bc92..52d0af3 100644
--- a/src/pulse/subscribe.c
+++ b/src/pulse/subscribe.c
@@ -31,7 +31,6 @@
 #include <pulsecore/pstream-util.h>
 
 #include "internal.h"
-
 #include "subscribe.h"
 
 void pa_command_subscribe_event(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) {
diff --git a/src/pulsecore/asyncq.c b/src/pulsecore/asyncq.c
index e62d0c1..8c2d58a 100644
--- a/src/pulsecore/asyncq.c
+++ b/src/pulsecore/asyncq.c
@@ -26,6 +26,8 @@
 #include <unistd.h>
 #include <errno.h>
 
+#include <pulse/xmalloc.h>
+
 #include <pulsecore/atomic.h>
 #include <pulsecore/log.h>
 #include <pulsecore/thread.h>
@@ -33,10 +35,9 @@
 #include <pulsecore/core-util.h>
 #include <pulsecore/llist.h>
 #include <pulsecore/flist.h>
-#include <pulse/xmalloc.h>
+#include <pulsecore/fdsem.h>
 
 #include "asyncq.h"
-#include "fdsem.h"
 
 #define ASYNCQ_SIZE 256
 
diff --git a/src/pulsecore/protocol-esound.c b/src/pulsecore/protocol-esound.c
index 045c5c9..66fd73c 100644
--- a/src/pulsecore/protocol-esound.c
+++ b/src/pulsecore/protocol-esound.c
@@ -55,8 +55,7 @@
 #include <pulsecore/macro.h>
 #include <pulsecore/thread-mq.h>
 #include <pulsecore/shared.h>
-
-#include "endianmacros.h"
+#include <pulsecore/endianmacros.h>
 
 #include "protocol-esound.h"
 
diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
index e520221..312e75e 100644
--- a/src/pulsecore/resampler.c
+++ b/src/pulsecore/resampler.c
@@ -36,11 +36,11 @@
 #include <pulsecore/log.h>
 #include <pulsecore/macro.h>
 #include <pulsecore/strbuf.h>
+#include <pulsecore/remap.h>
 
 #include "ffmpeg/avcodec.h"
 
 #include "resampler.h"
-#include "remap.h"
 
 /* Number of samples of extra space we allow the resamplers to return */
 #define EXTRA_FRAMES 128
diff --git a/src/pulsecore/sample-util.c b/src/pulsecore/sample-util.c
index ee1da60..62b7c46 100644
--- a/src/pulsecore/sample-util.c
+++ b/src/pulsecore/sample-util.c
@@ -37,9 +37,9 @@
 #include <pulsecore/macro.h>
 #include <pulsecore/g711.h>
 #include <pulsecore/core-util.h>
+#include <pulsecore/endianmacros.h>
 
 #include "sample-util.h"
-#include "endianmacros.h"
 
 #define PA_SILENCE_MAX (PA_PAGE_SIZE*16)
 
diff --git a/src/pulsecore/sconv-s16le.c b/src/pulsecore/sconv-s16le.c
index 0fefdf1..43587f3 100644
--- a/src/pulsecore/sconv-s16le.c
+++ b/src/pulsecore/sconv-s16le.c
@@ -31,8 +31,7 @@
 #include <pulsecore/sconv.h>
 #include <pulsecore/macro.h>
 #include <pulsecore/log.h>
-
-#include "endianmacros.h"
+#include <pulsecore/endianmacros.h>
 
 #include "sconv-s16le.h"
 
diff --git a/src/pulsecore/sconv.c b/src/pulsecore/sconv.c
index 301f08b..988d4b3 100644
--- a/src/pulsecore/sconv.c
+++ b/src/pulsecore/sconv.c
@@ -29,10 +29,10 @@
 
 #include <pulsecore/g711.h>
 #include <pulsecore/macro.h>
+#include <pulsecore/endianmacros.h>
 
-#include "endianmacros.h"
-#include "sconv-s16le.h"
-#include "sconv-s16be.h"
+#include <pulsecore/sconv-s16le.h>
+#include <pulsecore/sconv-s16be.h>
 
 #include "sconv.h"
 
diff --git a/src/pulsecore/sconv_sse.c b/src/pulsecore/sconv_sse.c
index ac57f01..26daa22 100644
--- a/src/pulsecore/sconv_sse.c
+++ b/src/pulsecore/sconv_sse.c
@@ -29,8 +29,7 @@
 
 #include <pulsecore/g711.h>
 #include <pulsecore/macro.h>
-
-#include "endianmacros.h"
+#include <pulsecore/endianmacros.h>
 
 #include "cpu-x86.h"
 #include "sconv.h"
diff --git a/src/pulsecore/svolume_arm.c b/src/pulsecore/svolume_arm.c
index 9262f33..4d55143 100644
--- a/src/pulsecore/svolume_arm.c
+++ b/src/pulsecore/svolume_arm.c
@@ -29,11 +29,11 @@
 #include <pulsecore/macro.h>
 #include <pulsecore/g711.h>
 #include <pulsecore/core-util.h>
+#include <pulsecore/endianmacros.h>
 
 #include "cpu-arm.h"
 
 #include "sample-util.h"
-#include "endianmacros.h"
 
 #if defined (__arm__) && defined (HAVE_ARMV6)
 
diff --git a/src/pulsecore/svolume_c.c b/src/pulsecore/svolume_c.c
index dfe7ccb..e55d0d7 100644
--- a/src/pulsecore/svolume_c.c
+++ b/src/pulsecore/svolume_c.c
@@ -28,9 +28,9 @@
 #include <pulsecore/macro.h>
 #include <pulsecore/g711.h>
 #include <pulsecore/core-util.h>
+#include <pulsecore/endianmacros.h>
 
 #include "sample-util.h"
-#include "endianmacros.h"
 
 static void pa_volume_u8_c(uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
     unsigned channel;
diff --git a/src/pulsecore/svolume_mmx.c b/src/pulsecore/svolume_mmx.c
index e0d0561..88a2759 100644
--- a/src/pulsecore/svolume_mmx.c
+++ b/src/pulsecore/svolume_mmx.c
@@ -31,11 +31,11 @@
 #include <pulsecore/macro.h>
 #include <pulsecore/g711.h>
 #include <pulsecore/core-util.h>
+#include <pulsecore/endianmacros.h>
 
 #include "cpu-x86.h"
 
 #include "sample-util.h"
-#include "endianmacros.h"
 
 #if defined (__i386__) || defined (__amd64__)
 /* in s: 2 int16_t samples
diff --git a/src/pulsecore/svolume_sse.c b/src/pulsecore/svolume_sse.c
index 43504cf..0f10dbe 100644
--- a/src/pulsecore/svolume_sse.c
+++ b/src/pulsecore/svolume_sse.c
@@ -31,11 +31,11 @@
 #include <pulsecore/macro.h>
 #include <pulsecore/g711.h>
 #include <pulsecore/core-util.h>
+#include <pulsecore/endianmacros.h>
 
 #include "cpu-x86.h"
 
 #include "sample-util.h"
-#include "endianmacros.h"
 
 #if defined (__i386__) || defined (__amd64__)
 
diff --git a/src/tests/cpulimit-test.c b/src/tests/cpulimit-test.c
index 8ef93e5..ac1ef8f 100644
--- a/src/tests/cpulimit-test.c
+++ b/src/tests/cpulimit-test.c
@@ -34,7 +34,7 @@
 #include <pulse/mainloop-signal.h>
 #endif
 
-#include "../daemon/cpulimit.h"
+#include <daemon/cpulimit.h>
 
 /* A simple example for testing the cpulimit subsystem */
 
diff --git a/src/utils/pax11publish.c b/src/utils/pax11publish.c
index 7b5558d..468a712 100644
--- a/src/utils/pax11publish.c
+++ b/src/utils/pax11publish.c
@@ -32,6 +32,7 @@
 
 #include <pulse/util.h>
 #include <pulse/i18n.h>
+#include <pulse/client-conf.h>
 
 #include <pulsecore/macro.h>
 #include <pulsecore/core-util.h>
@@ -40,7 +41,6 @@
 #include <pulsecore/native-common.h>
 #include <pulsecore/x11prop.h>
 
-#include "../pulse/client-conf.h"
 
 int main(int argc, char *argv[]) {
     const char *dname = NULL, *sink = NULL, *source = NULL, *server = NULL, *cookie_file = PA_NATIVE_COOKIE_FILE;
-- 
1.7.1




More information about the pulseaudio-discuss mailing list