summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaarten Bosmans <mkbosmans@gmail.com>2011-06-13 15:04:33 +0200
committerColin Guthrie <colin@mageia.org>2011-06-22 23:12:20 +0100
commitdd9265ac78b56c378bc7ca47920be9d9d93392b7 (patch)
treeafe6f2d056e765c35e27bf856dc0633f5bb3c0c3
parent9ffa9382dd8627aa12f1cffd67c96a6dacb4420f (diff)
Remove unnecessary #includes
-rw-r--r--src/daemon/caps.c3
-rw-r--r--src/daemon/cmdline.c2
-rw-r--r--src/daemon/cpulimit.c3
-rw-r--r--src/daemon/dumpmodules.c1
-rw-r--r--src/daemon/main.c6
-rw-r--r--src/modules/alsa/alsa-mixer.c10
-rw-r--r--src/modules/alsa/alsa-mixer.h4
-rw-r--r--src/modules/alsa/alsa-sink.c3
-rw-r--r--src/modules/alsa/alsa-source.c4
-rw-r--r--src/modules/alsa/alsa-util.c2
-rw-r--r--src/modules/alsa/alsa-util.h4
-rw-r--r--src/modules/alsa/module-alsa-sink.c1
-rw-r--r--src/modules/alsa/module-alsa-source.c16
-rw-r--r--src/modules/bluetooth/bluetooth-util.c2
-rw-r--r--src/modules/bluetooth/bluetooth-util.h2
-rw-r--r--src/modules/bluetooth/module-bluetooth-device.c1
-rw-r--r--src/modules/bluetooth/module-bluetooth-discover.c2
-rw-r--r--src/modules/dbus/iface-card-profile.h1
-rw-r--r--src/modules/echo-cancel/adrian-aec.h4
-rw-r--r--src/modules/echo-cancel/adrian.c4
-rw-r--r--src/modules/echo-cancel/module-echo-cancel.c5
-rw-r--r--src/modules/gconf/module-gconf.c2
-rw-r--r--src/modules/jack/module-jack-sink.c4
-rw-r--r--src/modules/jack/module-jack-source.c4
-rw-r--r--src/modules/jack/module-jackdbus-detect.c2
-rw-r--r--src/modules/macosx/module-bonjour-publish.c2
-rw-r--r--src/modules/macosx/module-coreaudio-device.c2
-rw-r--r--src/modules/module-always-sink.c3
-rw-r--r--src/modules/module-augment-properties.c3
-rw-r--r--src/modules/module-card-restore.c4
-rw-r--r--src/modules/module-cli.c1
-rw-r--r--src/modules/module-combine-sink.c2
-rw-r--r--src/modules/module-combine.c1
-rw-r--r--src/modules/module-console-kit.c7
-rw-r--r--src/modules/module-cork-music-on-phone.c2
-rw-r--r--src/modules/module-default-device-restore.c2
-rw-r--r--src/modules/module-detect.c2
-rw-r--r--src/modules/module-device-manager.c4
-rw-r--r--src/modules/module-device-restore.c7
-rw-r--r--src/modules/module-equalizer-sink.c4
-rw-r--r--src/modules/module-esound-compat-spawnfd.c1
-rw-r--r--src/modules/module-esound-compat-spawnpid.c2
-rw-r--r--src/modules/module-esound-sink.c4
-rw-r--r--src/modules/module-filter-apply.c1
-rw-r--r--src/modules/module-filter-heuristics.c3
-rw-r--r--src/modules/module-hal-detect.c4
-rw-r--r--src/modules/module-intended-roles.c5
-rw-r--r--src/modules/module-ladspa-sink.c5
-rw-r--r--src/modules/module-loopback.c1
-rw-r--r--src/modules/module-null-sink.c6
-rw-r--r--src/modules/module-null-source.c6
-rw-r--r--src/modules/module-pipe-sink.c2
-rw-r--r--src/modules/module-pipe-source.c2
-rw-r--r--src/modules/module-position-event-sounds.c3
-rw-r--r--src/modules/module-protocol-stub.c2
-rw-r--r--src/modules/module-remap-sink.c3
-rw-r--r--src/modules/module-rygel-media-server.c3
-rw-r--r--src/modules/module-sine-source.c6
-rw-r--r--src/modules/module-sine.c2
-rw-r--r--src/modules/module-solaris.c5
-rw-r--r--src/modules/module-stream-restore.c3
-rw-r--r--src/modules/module-suspend-on-idle.c1
-rw-r--r--src/modules/module-tunnel.c2
-rw-r--r--src/modules/module-virtual-sink.c4
-rw-r--r--src/modules/module-virtual-source.c6
-rw-r--r--src/modules/module-waveout.c3
-rw-r--r--src/modules/module-zeroconf-discover.c5
-rw-r--r--src/modules/module-zeroconf-publish.c3
-rw-r--r--src/modules/oss/module-oss.c4
-rw-r--r--src/modules/oss/oss-util.c1
-rw-r--r--src/modules/raop/module-raop-discover.c5
-rw-r--r--src/modules/raop/module-raop-sink.c7
-rw-r--r--src/modules/raop/raop_client.c5
-rw-r--r--src/modules/raop/raop_client.h2
-rw-r--r--src/modules/reserve-monitor.h1
-rw-r--r--src/modules/rtp/module-rtp-recv.c4
-rw-r--r--src/modules/rtp/module-rtp-send.c2
-rw-r--r--src/modules/rtp/rtp.c1
-rw-r--r--src/modules/rtp/rtsp_client.c3
-rw-r--r--src/modules/rtp/rtsp_client.h2
-rw-r--r--src/modules/rtp/sap.c1
-rw-r--r--src/modules/udev-util.h2
-rw-r--r--src/modules/x11/module-x11-bell.c4
-rw-r--r--src/modules/x11/module-x11-cork-request.c2
-rw-r--r--src/modules/x11/module-x11-publish.c5
-rw-r--r--src/modules/x11/module-x11-xsmp.c5
-rw-r--r--src/pulse/client-conf.c1
-rw-r--r--src/pulse/context.c7
-rw-r--r--src/pulse/error.c6
-rw-r--r--src/pulse/error.h1
-rw-r--r--src/pulse/ext-device-manager.c1
-rw-r--r--src/pulse/ext-device-manager.h1
-rw-r--r--src/pulse/ext-stream-restore.c1
-rw-r--r--src/pulse/ext-stream-restore.h1
-rw-r--r--src/pulse/format.h1
-rw-r--r--src/pulse/glib-mainloop.c1
-rw-r--r--src/pulse/i18n.h1
-rw-r--r--src/pulse/introspect.c3
-rw-r--r--src/pulse/mainloop-api.c1
-rw-r--r--src/pulse/mainloop-api.h1
-rw-r--r--src/pulse/mainloop-signal.c2
-rw-r--r--src/pulse/mainloop.c2
-rw-r--r--src/pulse/proplist.c1
-rw-r--r--src/pulse/rtclock.h3
-rw-r--r--src/pulse/sample.c1
-rw-r--r--src/pulse/sample.h1
-rw-r--r--src/pulse/scache.c1
-rw-r--r--src/pulse/simple.c1
-rw-r--r--src/pulse/subscribe.c2
-rw-r--r--src/pulse/thread-mainloop.c1
-rw-r--r--src/pulse/util.c2
-rw-r--r--src/pulse/util.h1
-rw-r--r--src/pulse/volume.c1
-rw-r--r--src/pulsecore/arpa-inet.c1
-rw-r--r--src/pulsecore/asyncmsgq.c4
-rw-r--r--src/pulsecore/auth-cookie.c1
-rw-r--r--src/pulsecore/authkey.c2
-rw-r--r--src/pulsecore/avahi-wrap.c1
-rw-r--r--src/pulsecore/cli-command.c1
-rw-r--r--src/pulsecore/cli-text.c3
-rw-r--r--src/pulsecore/cli.c7
-rw-r--r--src/pulsecore/core-error.c2
-rw-r--r--src/pulsecore/core-error.h1
-rw-r--r--src/pulsecore/core-scache.c2
-rw-r--r--src/pulsecore/core-subscribe.c1
-rw-r--r--src/pulsecore/core.c4
-rw-r--r--src/pulsecore/core.h2
-rw-r--r--src/pulsecore/cpu-arm.c1
-rw-r--r--src/pulsecore/creds.h4
-rw-r--r--src/pulsecore/database-simple.c2
-rw-r--r--src/pulsecore/dbus-shared.c5
-rw-r--r--src/pulsecore/dbus-util.h4
-rw-r--r--src/pulsecore/dllmain.c1
-rw-r--r--src/pulsecore/fdsem.c1
-rw-r--r--src/pulsecore/fdsem.h1
-rw-r--r--src/pulsecore/flist.c1
-rw-r--r--src/pulsecore/hashmap.c2
-rw-r--r--src/pulsecore/hook-list.c2
-rw-r--r--src/pulsecore/hook-list.h3
-rw-r--r--src/pulsecore/idxset.c1
-rw-r--r--src/pulsecore/iochannel.c1
-rw-r--r--src/pulsecore/ioline.c1
-rw-r--r--src/pulsecore/ioline.h3
-rw-r--r--src/pulsecore/lock-autospawn.c2
-rw-r--r--src/pulsecore/log.c2
-rw-r--r--src/pulsecore/ltdl-helper.c1
-rw-r--r--src/pulsecore/macro.h2
-rw-r--r--src/pulsecore/memblock.c3
-rw-r--r--src/pulsecore/memblock.h2
-rw-r--r--src/pulsecore/memchunk.c1
-rw-r--r--src/pulsecore/modargs.c4
-rw-r--r--src/pulsecore/modargs.h2
-rw-r--r--src/pulsecore/modinfo.c1
-rw-r--r--src/pulsecore/module.c3
-rw-r--r--src/pulsecore/msgobject.h2
-rw-r--r--src/pulsecore/mutex-posix.c2
-rw-r--r--src/pulsecore/object.c2
-rw-r--r--src/pulsecore/object.h1
-rw-r--r--src/pulsecore/once.h1
-rw-r--r--src/pulsecore/parseaddr.c1
-rw-r--r--src/pulsecore/pid.c1
-rw-r--r--src/pulsecore/play-memblockq.c3
-rw-r--r--src/pulsecore/play-memchunk.c5
-rw-r--r--src/pulsecore/prioq.h2
-rw-r--r--src/pulsecore/protocol-esound.c2
-rw-r--r--src/pulsecore/protocol-http.c1
-rw-r--r--src/pulsecore/protocol-native.c2
-rw-r--r--src/pulsecore/protocol-simple.c2
-rw-r--r--src/pulsecore/pstream.c3
-rw-r--r--src/pulsecore/random.c1
-rw-r--r--src/pulsecore/remap_mmx.c2
-rw-r--r--src/pulsecore/remap_sse.c2
-rw-r--r--src/pulsecore/rtpoll.c1
-rw-r--r--src/pulsecore/sample-util.c1
-rw-r--r--src/pulsecore/sample-util.h2
-rw-r--r--src/pulsecore/sconv-s16le.c2
-rw-r--r--src/pulsecore/sconv.c1
-rw-r--r--src/pulsecore/sconv.h1
-rw-r--r--src/pulsecore/sconv_sse.c1
-rw-r--r--src/pulsecore/shared.c1
-rw-r--r--src/pulsecore/shmasyncq.h1
-rw-r--r--src/pulsecore/sink-input.c1
-rw-r--r--src/pulsecore/sink.h3
-rw-r--r--src/pulsecore/sndfile-util.c1
-rw-r--r--src/pulsecore/socket-util.c4
-rw-r--r--src/pulsecore/sound-file-stream.c2
-rw-r--r--src/pulsecore/sound-file.c1
-rw-r--r--src/pulsecore/source.c1
-rw-r--r--src/pulsecore/source.h4
-rw-r--r--src/pulsecore/svolume_arm.c3
-rw-r--r--src/pulsecore/svolume_c.c1
-rw-r--r--src/pulsecore/svolume_mmx.c3
-rw-r--r--src/pulsecore/svolume_orc.c1
-rw-r--r--src/pulsecore/svolume_sse.c3
-rw-r--r--src/pulsecore/tagstruct.h1
-rw-r--r--src/pulsecore/thread-mq.c7
-rw-r--r--src/pulsecore/thread-posix.c2
-rw-r--r--src/pulsecore/thread-win32.c1
-rw-r--r--src/pulsecore/thread.h2
-rw-r--r--src/pulsecore/time-smoother.c1
-rw-r--r--src/pulsecore/tokenizer.c1
-rw-r--r--src/tests/asyncmsgq-test.c3
-rw-r--r--src/tests/asyncq-test.c2
-rw-r--r--src/tests/channelmap-test.c1
-rw-r--r--src/tests/cpulimit-test.c1
-rw-r--r--src/tests/extended-test.c2
-rw-r--r--src/tests/get-binary-name-test.c1
-rw-r--r--src/tests/interpol-test.c1
-rw-r--r--src/tests/mainloop-test.c1
-rw-r--r--src/tests/mcalign-test.c2
-rw-r--r--src/tests/mix-test.c1
-rw-r--r--src/tests/once-test.c2
-rw-r--r--src/tests/pacat-simple.c1
-rw-r--r--src/tests/parec-simple.c1
-rw-r--r--src/tests/queue-test.c3
-rw-r--r--src/tests/remix-test.c3
-rw-r--r--src/tests/resampler-test.c1
-rw-r--r--src/tests/rtstutter.c1
-rw-r--r--src/tests/strlist-test.c1
-rw-r--r--src/tests/sync-playback.c2
-rw-r--r--src/tests/thread-mainloop-test.c1
-rw-r--r--src/tests/voltest.c2
-rw-r--r--src/utils/pabrowse.c1
-rw-r--r--src/utils/pacmd.c1
-rw-r--r--src/utils/pactl.c1
-rw-r--r--src/utils/pasuspender.c1
-rw-r--r--src/utils/pax11publish.c1
227 files changed, 76 insertions, 472 deletions
diff --git a/src/daemon/caps.c b/src/daemon/caps.c
index 76b62e03..74ccb1c8 100644
--- a/src/daemon/caps.c
+++ b/src/daemon/caps.c
@@ -26,15 +26,12 @@
#include <unistd.h>
#include <errno.h>
-#include <string.h>
#include <sys/types.h>
#include <pulse/i18n.h>
#include <pulsecore/macro.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/log.h>
-#include <pulsecore/core-util.h>
#ifdef HAVE_SYS_CAPABILITY_H
#include <sys/capability.h>
diff --git a/src/daemon/cmdline.c b/src/daemon/cmdline.c
index 4854affc..ec37d46b 100644
--- a/src/daemon/cmdline.c
+++ b/src/daemon/cmdline.c
@@ -23,11 +23,9 @@
#include <config.h>
#endif
-#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <getopt.h>
-#include <sys/stat.h>
#include <pulse/xmalloc.h>
#include <pulse/i18n.h>
diff --git a/src/daemon/cpulimit.c b/src/daemon/cpulimit.c
index 9e22d7e8..3a972975 100644
--- a/src/daemon/cpulimit.c
+++ b/src/daemon/cpulimit.c
@@ -23,11 +23,9 @@
#include <config.h>
#endif
-#include <pulse/error.h>
#include <pulse/rtclock.h>
#include <pulse/timeval.h>
-#include <pulsecore/core-rtclock.h>
#include <pulsecore/core-util.h>
#include <pulsecore/core-error.h>
#include <pulsecore/log.h>
@@ -40,7 +38,6 @@
#include <errno.h>
#include <stdio.h>
#include <string.h>
-#include <sys/time.h>
#include <unistd.h>
#include <signal.h>
diff --git a/src/daemon/dumpmodules.c b/src/daemon/dumpmodules.c
index d0504dc5..68ab5bba 100644
--- a/src/daemon/dumpmodules.c
+++ b/src/daemon/dumpmodules.c
@@ -25,7 +25,6 @@
#endif
#include <string.h>
-#include <getopt.h>
#include <stdio.h>
#include <ltdl.h>
diff --git a/src/daemon/main.c b/src/daemon/main.c
index 53166560..90ed5ce0 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -33,7 +33,6 @@
#include <stddef.h>
#include <ltdl.h>
#include <limits.h>
-#include <fcntl.h>
#include <unistd.h>
#include <locale.h>
#include <sys/types.h>
@@ -74,7 +73,6 @@
#include <pulsecore/core-error.h>
#include <pulsecore/core-rtclock.h>
#include <pulsecore/core.h>
-#include <pulsecore/memblock.h>
#include <pulsecore/module.h>
#include <pulsecore/cli-command.h>
#include <pulsecore/log.h>
@@ -82,12 +80,8 @@
#include <pulsecore/sioman.h>
#include <pulsecore/cli-text.h>
#include <pulsecore/pid.h>
-#include <pulsecore/namereg.h>
#include <pulsecore/random.h>
#include <pulsecore/macro.h>
-#include <pulsecore/mutex.h>
-#include <pulsecore/thread.h>
-#include <pulsecore/once.h>
#include <pulsecore/shm.h>
#include <pulsecore/memtrap.h>
#include <pulsecore/strlist.h>
diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
index dada1223..348f037f 100644
--- a/src/modules/alsa/alsa-mixer.c
+++ b/src/modules/alsa/alsa-mixer.c
@@ -25,27 +25,25 @@
#endif
#include <sys/types.h>
-#include <limits.h>
#include <asoundlib.h>
+#include <math.h>
#ifdef HAVE_VALGRIND_MEMCHECK_H
#include <valgrind/memcheck.h>
#endif
+#include <pulse/mainloop-api.h>
#include <pulse/sample.h>
-#include <pulse/xmalloc.h>
#include <pulse/timeval.h>
#include <pulse/util.h>
+#include <pulse/volume.h>
+#include <pulse/xmalloc.h>
#include <pulse/i18n.h>
#include <pulse/utf8.h>
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
#include <pulsecore/core-util.h>
-#include <pulsecore/atomic.h>
-#include <pulsecore/core-error.h>
-#include <pulsecore/once.h>
-#include <pulsecore/thread.h>
#include <pulsecore/conf-parser.h>
#include <pulsecore/strbuf.h>
diff --git a/src/modules/alsa/alsa-mixer.h b/src/modules/alsa/alsa-mixer.h
index e1cf1f81..d92d3e98 100644
--- a/src/modules/alsa/alsa-mixer.h
+++ b/src/modules/alsa/alsa-mixer.h
@@ -26,16 +26,12 @@
#include <asoundlib.h>
#include <pulse/sample.h>
-#include <pulse/volume.h>
#include <pulse/mainloop-api.h>
#include <pulse/channelmap.h>
-#include <pulse/proplist.h>
#include <pulse/volume.h>
#include <pulsecore/llist.h>
#include <pulsecore/rtpoll.h>
-#include <pulsecore/core.h>
-#include <pulsecore/log.h>
typedef struct pa_alsa_fdlist pa_alsa_fdlist;
typedef struct pa_alsa_mixer_pdata pa_alsa_mixer_pdata;
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index a042c2d1..97492ab3 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -35,7 +35,7 @@
#include <pulse/i18n.h>
#include <pulse/rtclock.h>
#include <pulse/timeval.h>
-#include <pulse/util.h>
+#include <pulse/volume.h>
#include <pulse/xmalloc.h>
#include <pulsecore/core.h>
@@ -49,7 +49,6 @@
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
#include <pulsecore/thread.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/thread-mq.h>
#include <pulsecore/rtpoll.h>
#include <pulsecore/time-smoother.h>
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index fb96ed01..f847b1ee 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -31,10 +31,9 @@
#include <pulse/i18n.h>
#include <pulse/rtclock.h>
#include <pulse/timeval.h>
-#include <pulse/util.h>
+#include <pulse/volume.h>
#include <pulse/xmalloc.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/core.h>
#include <pulsecore/module.h>
#include <pulsecore/memchunk.h>
@@ -46,7 +45,6 @@
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
#include <pulsecore/thread.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/thread-mq.h>
#include <pulsecore/rtpoll.h>
#include <pulsecore/time-smoother.h>
diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index 6435db00..883c26f9 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -25,7 +25,6 @@
#endif
#include <sys/types.h>
-#include <limits.h>
#include <asoundlib.h>
#include <pulse/sample.h>
@@ -40,7 +39,6 @@
#include <pulsecore/core-util.h>
#include <pulsecore/atomic.h>
#include <pulsecore/core-error.h>
-#include <pulsecore/once.h>
#include <pulsecore/thread.h>
#include <pulsecore/conf-parser.h>
#include <pulsecore/core-rtclock.h>
diff --git a/src/modules/alsa/alsa-util.h b/src/modules/alsa/alsa-util.h
index 9e29fd46..ee5e781e 100644
--- a/src/modules/alsa/alsa-util.h
+++ b/src/modules/alsa/alsa-util.h
@@ -26,13 +26,9 @@
#include <asoundlib.h>
#include <pulse/sample.h>
-#include <pulse/volume.h>
-#include <pulse/mainloop-api.h>
#include <pulse/channelmap.h>
#include <pulse/proplist.h>
-#include <pulse/volume.h>
-#include <pulsecore/llist.h>
#include <pulsecore/rtpoll.h>
#include <pulsecore/core.h>
#include <pulsecore/log.h>
diff --git a/src/modules/alsa/module-alsa-sink.c b/src/modules/alsa/module-alsa-sink.c
index 465c8b9e..6e64ab31 100644
--- a/src/modules/alsa/module-alsa-sink.c
+++ b/src/modules/alsa/module-alsa-sink.c
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#include <pulsecore/core.h>
#include <pulsecore/module.h>
#include <pulsecore/sink.h>
#include <pulsecore/modargs.h>
diff --git a/src/modules/alsa/module-alsa-source.c b/src/modules/alsa/module-alsa-source.c
index 478a2e8c..5ecd1e34 100644
--- a/src/modules/alsa/module-alsa-source.c
+++ b/src/modules/alsa/module-alsa-source.c
@@ -32,26 +32,10 @@
#include <valgrind/memcheck.h>
#endif
-#include <pulse/xmalloc.h>
-#include <pulse/util.h>
-#include <pulse/timeval.h>
-
-#include <pulsecore/core-error.h>
-#include <pulsecore/core-rtclock.h>
-#include <pulsecore/core.h>
#include <pulsecore/module.h>
-#include <pulsecore/memchunk.h>
-#include <pulsecore/sink.h>
#include <pulsecore/modargs.h>
-#include <pulsecore/core-util.h>
-#include <pulsecore/sample-util.h>
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
-#include <pulsecore/thread.h>
-#include <pulsecore/core-error.h>
-#include <pulsecore/thread-mq.h>
-#include <pulsecore/rtpoll.h>
-#include <pulsecore/time-smoother.h>
#include "alsa-util.h"
#include "alsa-source.h"
diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index 597a39d0..b24fe7a3 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -23,6 +23,8 @@
#include <config.h>
#endif
+#include <pulse/xmalloc.h>
+
#include <pulsecore/core-util.h>
#include <pulsecore/shared.h>
#include <pulsecore/dbus-shared.h>
diff --git a/src/modules/bluetooth/bluetooth-util.h b/src/modules/bluetooth/bluetooth-util.h
index 2054f6e7..248ca47d 100644
--- a/src/modules/bluetooth/bluetooth-util.h
+++ b/src/modules/bluetooth/bluetooth-util.h
@@ -25,9 +25,7 @@
#include <dbus/dbus.h>
#include <pulsecore/llist.h>
-#include <pulsecore/strlist.h>
#include <pulsecore/macro.h>
-#include <pulsecore/core-util.h>
#define PA_BLUETOOTH_ERROR_NOT_SUPPORTED "org.bluez.Error.NotSupported"
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 0639afd6..288ad2fd 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -48,7 +48,6 @@
#include <pulsecore/time-smoother.h>
#include <pulsecore/namereg.h>
#include <pulsecore/dbus-shared.h>
-#include <pulsecore/llist.h>
#include "module-bluetooth-device-symdef.h"
#include "ipc.h"
diff --git a/src/modules/bluetooth/module-bluetooth-discover.c b/src/modules/bluetooth/module-bluetooth-discover.c
index fc68fcde..7b27f6bb 100644
--- a/src/modules/bluetooth/module-bluetooth-discover.c
+++ b/src/modules/bluetooth/module-bluetooth-discover.c
@@ -25,14 +25,12 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <pulse/xmalloc.h>
#include <pulsecore/module.h>
#include <pulsecore/core-util.h>
#include <pulsecore/modargs.h>
#include <pulsecore/macro.h>
-#include <pulsecore/llist.h>
#include <pulsecore/core-util.h>
#include <pulsecore/dbus-shared.h>
diff --git a/src/modules/dbus/iface-card-profile.h b/src/modules/dbus/iface-card-profile.h
index a09767f8..8ffb4b9c 100644
--- a/src/modules/dbus/iface-card-profile.h
+++ b/src/modules/dbus/iface-card-profile.h
@@ -28,7 +28,6 @@
* documentation.
*/
-#include <pulsecore/core-scache.h>
#include <pulsecore/protocol-dbus.h>
#include "iface-card.h"
diff --git a/src/modules/echo-cancel/adrian-aec.h b/src/modules/echo-cancel/adrian-aec.h
index 0efe53ee..d024b3c5 100644
--- a/src/modules/echo-cancel/adrian-aec.h
+++ b/src/modules/echo-cancel/adrian-aec.h
@@ -17,9 +17,11 @@
#include <config.h>
#endif
-#include <pulsecore/macro.h>
+#include <pulse/gccmacro.h>
#include <pulse/xmalloc.h>
+#include <pulsecore/macro.h>
+
#define WIDEB 2
// use double if your CPU does software-emulation of float
diff --git a/src/modules/echo-cancel/adrian.c b/src/modules/echo-cancel/adrian.c
index 08df2edd..ab3858a4 100644
--- a/src/modules/echo-cancel/adrian.c
+++ b/src/modules/echo-cancel/adrian.c
@@ -29,8 +29,10 @@
#include <config.h>
#endif
+#include <pulse/xmalloc.h>
+
#include <pulsecore/modargs.h>
-#include <pulsecore/endianmacros.h>
+
#include "echo-cancel.h"
/* should be between 10-20 ms */
diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
index e5ee5b13..b84bf1db 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -31,7 +31,6 @@
#endif
#include <stdio.h>
-#include <math.h>
#include "echo-cancel.h"
@@ -42,17 +41,13 @@
#include <pulsecore/atomic.h>
#include <pulsecore/macro.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/namereg.h>
#include <pulsecore/sink.h>
#include <pulsecore/module.h>
#include <pulsecore/core-rtclock.h>
#include <pulsecore/core-util.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
-#include <pulsecore/thread.h>
-#include <pulsecore/thread-mq.h>
#include <pulsecore/rtpoll.h>
#include <pulsecore/sample-util.h>
#include <pulsecore/ltdl-helper.h>
diff --git a/src/modules/gconf/module-gconf.c b/src/modules/gconf/module-gconf.c
index 5f31d688..3bad9113 100644
--- a/src/modules/gconf/module-gconf.c
+++ b/src/modules/gconf/module-gconf.c
@@ -30,12 +30,10 @@
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
-#include <fcntl.h>
#include <pulse/xmalloc.h>
#include <pulsecore/module.h>
#include <pulsecore/core.h>
-#include <pulsecore/llist.h>
#include <pulsecore/core-util.h>
#include <pulsecore/log.h>
#include <pulse/mainloop-api.h>
diff --git a/src/modules/jack/module-jack-sink.c b/src/modules/jack/module-jack-sink.c
index dfb5be1a..35b0385d 100644
--- a/src/modules/jack/module-jack-sink.c
+++ b/src/modules/jack/module-jack-sink.c
@@ -24,19 +24,15 @@
#endif
#include <stdlib.h>
-#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
-#include <fcntl.h>
#include <unistd.h>
-#include <limits.h>
#include <jack/jack.h>
#include <pulse/xmalloc.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/sink.h>
#include <pulsecore/module.h>
#include <pulsecore/core-util.h>
diff --git a/src/modules/jack/module-jack-source.c b/src/modules/jack/module-jack-source.c
index 8453bd97..13109f3e 100644
--- a/src/modules/jack/module-jack-source.c
+++ b/src/modules/jack/module-jack-source.c
@@ -24,19 +24,15 @@
#endif
#include <stdlib.h>
-#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
-#include <fcntl.h>
#include <unistd.h>
-#include <limits.h>
#include <jack/jack.h>
#include <pulse/xmalloc.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/source.h>
#include <pulsecore/module.h>
#include <pulsecore/core-util.h>
diff --git a/src/modules/jack/module-jackdbus-detect.c b/src/modules/jack/module-jackdbus-detect.c
index c3dd7bb2..864f96b1 100644
--- a/src/modules/jack/module-jackdbus-detect.c
+++ b/src/modules/jack/module-jackdbus-detect.c
@@ -27,6 +27,8 @@
#include <config.h>
#endif
+#include <pulse/xmalloc.h>
+
#include <pulsecore/log.h>
#include <pulsecore/modargs.h>
#include <pulsecore/core-util.h>
diff --git a/src/modules/macosx/module-bonjour-publish.c b/src/modules/macosx/module-bonjour-publish.c
index 095a1d29..667b6b73 100644
--- a/src/modules/macosx/module-bonjour-publish.c
+++ b/src/modules/macosx/module-bonjour-publish.c
@@ -41,10 +41,8 @@
#include <pulsecore/native-common.h>
#include <pulsecore/core-util.h>
#include <pulsecore/log.h>
-#include <pulsecore/core-subscribe.h>
#include <pulsecore/dynarray.h>
#include <pulsecore/modargs.h>
-#include <pulsecore/endianmacros.h>
#include <pulsecore/protocol-native.h>
#include "module-bonjour-publish-symdef.h"
diff --git a/src/modules/macosx/module-coreaudio-device.c b/src/modules/macosx/module-coreaudio-device.c
index 393ce7f8..d2762819 100644
--- a/src/modules/macosx/module-coreaudio-device.c
+++ b/src/modules/macosx/module-coreaudio-device.c
@@ -29,9 +29,7 @@
#endif
#include <pulse/xmalloc.h>
-#include <pulse/util.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/sink.h>
#include <pulsecore/source.h>
#include <pulsecore/module.h>
diff --git a/src/modules/module-always-sink.c b/src/modules/module-always-sink.c
index 3d7de9c6..4c871da4 100644
--- a/src/modules/module-always-sink.c
+++ b/src/modules/module-always-sink.c
@@ -27,10 +27,9 @@
#include <pulse/i18n.h>
#include <pulsecore/core.h>
-#include <pulsecore/sink-input.h>
+#include <pulsecore/sink.h>
#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
-#include <pulsecore/namereg.h>
#include <pulsecore/core-util.h>
#include "module-always-sink-symdef.h"
diff --git a/src/modules/module-augment-properties.c b/src/modules/module-augment-properties.c
index c3f5c088..bfc637aa 100644
--- a/src/modules/module-augment-properties.c
+++ b/src/modules/module-augment-properties.c
@@ -28,10 +28,7 @@
#include <time.h>
#include <pulse/xmalloc.h>
-#include <pulse/volume.h>
-#include <pulse/channelmap.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/module.h>
#include <pulsecore/core-util.h>
#include <pulsecore/modargs.h>
diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c
index f1c19307..fc5df5f6 100644
--- a/src/modules/module-card-restore.c
+++ b/src/modules/module-card-restore.c
@@ -29,12 +29,10 @@
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
-#include <ctype.h>
+#include <pulse/gccmacro.h>
#include <pulse/xmalloc.h>
-#include <pulse/volume.h>
#include <pulse/timeval.h>
-#include <pulse/util.h>
#include <pulse/rtclock.h>
#include <pulsecore/core-error.h>
diff --git a/src/modules/module-cli.c b/src/modules/module-cli.c
index 90ce3b63..7788a756 100644
--- a/src/modules/module-cli.c
+++ b/src/modules/module-cli.c
@@ -36,7 +36,6 @@
#include <pulsecore/modargs.h>
#include <pulsecore/macro.h>
#include <pulsecore/core-util.h>
-#include <pulsecore/core-error.h>
#include "module-cli-symdef.h"
diff --git a/src/modules/module-combine-sink.c b/src/modules/module-combine-sink.c
index 72ee83cf..5d29af4b 100644
--- a/src/modules/module-combine-sink.c
+++ b/src/modules/module-combine-sink.c
@@ -41,11 +41,9 @@
#include <pulsecore/core-util.h>
#include <pulsecore/modargs.h>
#include <pulsecore/namereg.h>
-#include <pulsecore/mutex.h>
#include <pulsecore/thread.h>
#include <pulsecore/thread-mq.h>
#include <pulsecore/rtpoll.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/time-smoother.h>
#include <pulsecore/strlist.h>
diff --git a/src/modules/module-combine.c b/src/modules/module-combine.c
index 58128849..251df494 100644
--- a/src/modules/module-combine.c
+++ b/src/modules/module-combine.c
@@ -28,7 +28,6 @@
#include <pulsecore/module.h>
#include <pulsecore/log.h>
-#include <pulsecore/core-util.h>
#include "module-combine-symdef.h"
diff --git a/src/modules/module-console-kit.c b/src/modules/module-console-kit.c
index d52cc244..4c5857cf 100644
--- a/src/modules/module-console-kit.c
+++ b/src/modules/module-console-kit.c
@@ -25,24 +25,17 @@
#include <stdio.h>
#include <unistd.h>
-#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <pulse/xmalloc.h>
-#include <pulse/timeval.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/module.h>
#include <pulsecore/log.h>
#include <pulsecore/hashmap.h>
#include <pulsecore/idxset.h>
-#include <pulsecore/core-util.h>
-#include <pulsecore/namereg.h>
-#include <pulsecore/core-scache.h>
#include <pulsecore/modargs.h>
#include <pulsecore/dbus-shared.h>
diff --git a/src/modules/module-cork-music-on-phone.c b/src/modules/module-cork-music-on-phone.c
index 5e6aa64b..4c9c1788 100644
--- a/src/modules/module-cork-music-on-phone.c
+++ b/src/modules/module-cork-music-on-phone.c
@@ -23,6 +23,8 @@
#include <config.h>
#endif
+#include <pulse/xmalloc.h>
+
#include <pulsecore/macro.h>
#include <pulsecore/hashmap.h>
#include <pulsecore/hook-list.h>
diff --git a/src/modules/module-default-device-restore.c b/src/modules/module-default-device-restore.c
index 0c4aea33..f28bddb7 100644
--- a/src/modules/module-default-device-restore.c
+++ b/src/modules/module-default-device-restore.c
@@ -28,7 +28,7 @@
#include <pulse/rtclock.h>
#include <pulse/timeval.h>
-#include <pulse/util.h>
+#include <pulse/xmalloc.h>
#include <pulsecore/core-util.h>
#include <pulsecore/module.h>
diff --git a/src/modules/module-detect.c b/src/modules/module-detect.c
index 2a90eb63..bb4994c6 100644
--- a/src/modules/module-detect.c
+++ b/src/modules/module-detect.c
@@ -34,8 +34,6 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include <pulse/xmalloc.h>
-
#include <pulsecore/core-error.h>
#include <pulsecore/module.h>
#include <pulsecore/modargs.h>
diff --git a/src/modules/module-device-manager.c b/src/modules/module-device-manager.c
index ea92cd0e..67baef31 100644
--- a/src/modules/module-device-manager.c
+++ b/src/modules/module-device-manager.c
@@ -30,12 +30,10 @@
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
-#include <ctype.h>
+#include <pulse/gccmacro.h>
#include <pulse/xmalloc.h>
-#include <pulse/volume.h>
#include <pulse/timeval.h>
-#include <pulse/util.h>
#include <pulse/rtclock.h>
#include <pulsecore/core-error.h>
diff --git a/src/modules/module-device-restore.c b/src/modules/module-device-restore.c
index 495a9112..7d94ffa4 100644
--- a/src/modules/module-device-restore.c
+++ b/src/modules/module-device-restore.c
@@ -30,12 +30,11 @@
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
-#include <ctype.h>
+#include <pulse/gccmacro.h>
#include <pulse/xmalloc.h>
#include <pulse/volume.h>
#include <pulse/timeval.h>
-#include <pulse/util.h>
#include <pulse/rtclock.h>
#include <pulse/format.h>
#include <pulse/internal.h>
@@ -46,8 +45,8 @@
#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
#include <pulsecore/core-subscribe.h>
-#include <pulsecore/sink-input.h>
-#include <pulsecore/source-output.h>
+#include <pulsecore/sink.h>
+#include <pulsecore/source.h>
#include <pulsecore/namereg.h>
#include <pulsecore/protocol-native.h>
#include <pulsecore/pstream.h>
diff --git a/src/modules/module-equalizer-sink.c b/src/modules/module-equalizer-sink.c
index e20ee4ab..e7d8790a 100644
--- a/src/modules/module-equalizer-sink.c
+++ b/src/modules/module-equalizer-sink.c
@@ -36,7 +36,6 @@
#include <math.h>
#include <string.h>
#include <stdint.h>
-#include <time.h>
//#undef __SSE2__
#ifdef __SSE2__
@@ -52,15 +51,12 @@
#include <pulsecore/core-rtclock.h>
#include <pulsecore/aupdate.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/namereg.h>
#include <pulsecore/sink.h>
#include <pulsecore/module.h>
#include <pulsecore/core-util.h>
#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
-#include <pulsecore/thread.h>
-#include <pulsecore/thread-mq.h>
#include <pulsecore/rtpoll.h>
#include <pulsecore/sample-util.h>
#include <pulsecore/shared.h>
diff --git a/src/modules/module-esound-compat-spawnfd.c b/src/modules/module-esound-compat-spawnfd.c
index 56cda4df..617d5a14 100644
--- a/src/modules/module-esound-compat-spawnfd.c
+++ b/src/modules/module-esound-compat-spawnfd.c
@@ -24,7 +24,6 @@
#endif
#include <unistd.h>
-#include <string.h>
#include <errno.h>
#include <pulsecore/core-error.h>
diff --git a/src/modules/module-esound-compat-spawnpid.c b/src/modules/module-esound-compat-spawnpid.c
index 5925f591..94ebdaad 100644
--- a/src/modules/module-esound-compat-spawnpid.c
+++ b/src/modules/module-esound-compat-spawnpid.c
@@ -25,13 +25,11 @@
#endif
#include <unistd.h>
-#include <string.h>
#include <errno.h>
#include <signal.h>
#include <pulsecore/core-error.h>
#include <pulsecore/module.h>
-#include <pulsecore/core-util.h>
#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
diff --git a/src/modules/module-esound-sink.c b/src/modules/module-esound-sink.c
index 5a1391d7..d79054f8 100644
--- a/src/modules/module-esound-sink.c
+++ b/src/modules/module-esound-sink.c
@@ -24,13 +24,10 @@
#endif
#include <stdlib.h>
-#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
-#include <fcntl.h>
#include <unistd.h>
-#include <limits.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
@@ -57,7 +54,6 @@
#include <pulsecore/iochannel.h>
#include <pulsecore/sink.h>
#include <pulsecore/module.h>
-#include <pulsecore/core-rtclock.h>
#include <pulsecore/core-util.h>
#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
diff --git a/src/modules/module-filter-apply.c b/src/modules/module-filter-apply.c
index e9c9f65b..c742373a 100644
--- a/src/modules/module-filter-apply.c
+++ b/src/modules/module-filter-apply.c
@@ -26,6 +26,7 @@
#include <pulse/timeval.h>
#include <pulse/rtclock.h>
#include <pulse/i18n.h>
+#include <pulse/xmalloc.h>
#include <pulsecore/macro.h>
#include <pulsecore/hashmap.h>
diff --git a/src/modules/module-filter-heuristics.c b/src/modules/module-filter-heuristics.c
index 1285c46e..222787fc 100644
--- a/src/modules/module-filter-heuristics.c
+++ b/src/modules/module-filter-heuristics.c
@@ -23,8 +23,9 @@
#include <config.h>
#endif
+#include <pulse/xmalloc.h>
+
#include <pulsecore/macro.h>
-#include <pulsecore/hashmap.h>
#include <pulsecore/hook-list.h>
#include <pulsecore/core.h>
#include <pulsecore/core-util.h>
diff --git a/src/modules/module-hal-detect.c b/src/modules/module-hal-detect.c
index 941ac3a4..62f0f203 100644
--- a/src/modules/module-hal-detect.c
+++ b/src/modules/module-hal-detect.c
@@ -31,19 +31,15 @@
#include <errno.h>
#include <stdlib.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <pulse/xmalloc.h>
-#include <pulse/timeval.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/module.h>
#include <pulsecore/log.h>
#include <pulsecore/hashmap.h>
#include <pulsecore/idxset.h>
#include <pulsecore/core-util.h>
#include <pulsecore/namereg.h>
-#include <pulsecore/core-scache.h>
#include <pulsecore/modargs.h>
#include <pulsecore/dbus-shared.h>
diff --git a/src/modules/module-intended-roles.c b/src/modules/module-intended-roles.c
index 2f9bba4b..9ba893b2 100644
--- a/src/modules/module-intended-roles.c
+++ b/src/modules/module-intended-roles.c
@@ -24,16 +24,11 @@
#endif
#include <pulse/xmalloc.h>
-#include <pulse/volume.h>
-#include <pulse/timeval.h>
-#include <pulse/util.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/module.h>
#include <pulsecore/core-util.h>
#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
-#include <pulsecore/core-subscribe.h>
#include <pulsecore/sink-input.h>
#include <pulsecore/source-output.h>
#include <pulsecore/namereg.h>
diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c
index 6489f3f7..9cce269d 100644
--- a/src/modules/module-ladspa-sink.c
+++ b/src/modules/module-ladspa-sink.c
@@ -26,18 +26,17 @@
#include <config.h>
#endif
+#include <math.h>
+
#include <pulse/xmalloc.h>
#include <pulse/i18n.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/namereg.h>
#include <pulsecore/sink.h>
#include <pulsecore/module.h>
#include <pulsecore/core-util.h>
#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
-#include <pulsecore/thread.h>
-#include <pulsecore/thread-mq.h>
#include <pulsecore/rtpoll.h>
#include <pulsecore/sample-util.h>
#include <pulsecore/ltdl-helper.h>
diff --git a/src/modules/module-loopback.c b/src/modules/module-loopback.c
index 936133fc..cf88267d 100644
--- a/src/modules/module-loopback.c
+++ b/src/modules/module-loopback.c
@@ -25,7 +25,6 @@
#endif
#include <stdio.h>
-#include <math.h>
#include <pulse/xmalloc.h>
diff --git a/src/modules/module-null-sink.c b/src/modules/module-null-sink.c
index eeb6f6ca..1db639ff 100644
--- a/src/modules/module-null-sink.c
+++ b/src/modules/module-null-sink.c
@@ -24,13 +24,9 @@
#endif
#include <stdlib.h>
-#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>
-#include <string.h>
-#include <fcntl.h>
#include <unistd.h>
-#include <limits.h>
#include <pulse/rtclock.h>
#include <pulse/timeval.h>
@@ -40,9 +36,7 @@
#include <pulsecore/macro.h>
#include <pulsecore/sink.h>
#include <pulsecore/module.h>
-#include <pulsecore/core-rtclock.h>
#include <pulsecore/core-util.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
#include <pulsecore/thread.h>
diff --git a/src/modules/module-null-source.c b/src/modules/module-null-source.c
index 358ffc65..b2981c34 100644
--- a/src/modules/module-null-source.c
+++ b/src/modules/module-null-source.c
@@ -25,20 +25,14 @@
#endif
#include <stdlib.h>
-#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>
-#include <string.h>
-#include <fcntl.h>
#include <unistd.h>
-#include <limits.h>
#include <pulse/rtclock.h>
#include <pulse/timeval.h>
#include <pulse/xmalloc.h>
-#include <pulsecore/core-error.h>
-#include <pulsecore/core-rtclock.h>
#include <pulsecore/core-util.h>
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
diff --git a/src/modules/module-pipe-sink.c b/src/modules/module-pipe-sink.c
index 6623aef4..91e01f99 100644
--- a/src/modules/module-pipe-sink.c
+++ b/src/modules/module-pipe-sink.c
@@ -27,10 +27,8 @@
#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>
-#include <string.h>
#include <fcntl.h>
#include <unistd.h>
-#include <limits.h>
#include <sys/ioctl.h>
#ifdef HAVE_SYS_FILIO_H
diff --git a/src/modules/module-pipe-source.c b/src/modules/module-pipe-source.c
index c50536ef..a941f088 100644
--- a/src/modules/module-pipe-source.c
+++ b/src/modules/module-pipe-source.c
@@ -27,10 +27,8 @@
#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>
-#include <string.h>
#include <fcntl.h>
#include <unistd.h>
-#include <limits.h>
#include <sys/ioctl.h>
#ifdef HAVE_SYS_FILIO_H
diff --git a/src/modules/module-position-event-sounds.c b/src/modules/module-position-event-sounds.c
index 3cba0f37..091453a4 100644
--- a/src/modules/module-position-event-sounds.c
+++ b/src/modules/module-position-event-sounds.c
@@ -24,18 +24,15 @@
#endif
#include <unistd.h>
-#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
-#include <ctype.h>
#include <pulse/xmalloc.h>
#include <pulse/volume.h>
#include <pulse/channelmap.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/module.h>
#include <pulsecore/core-util.h>
#include <pulsecore/modargs.h>
diff --git a/src/modules/module-protocol-stub.c b/src/modules/module-protocol-stub.c
index 29cb419d..e1bf3977 100644
--- a/src/modules/module-protocol-stub.c
+++ b/src/modules/module-protocol-stub.c
@@ -24,11 +24,9 @@
#include <config.h>
#endif
-#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
-#include <limits.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
diff --git a/src/modules/module-remap-sink.c b/src/modules/module-remap-sink.c
index 79627f7a..2822a7fc 100644
--- a/src/modules/module-remap-sink.c
+++ b/src/modules/module-remap-sink.c
@@ -25,15 +25,12 @@
#include <pulse/xmalloc.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/namereg.h>
#include <pulsecore/sink.h>
#include <pulsecore/module.h>
#include <pulsecore/core-util.h>
#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
-#include <pulsecore/thread.h>
-#include <pulsecore/thread-mq.h>
#include <pulsecore/rtpoll.h>
#include "module-remap-sink-symdef.h"
diff --git a/src/modules/module-rygel-media-server.c b/src/modules/module-rygel-media-server.c
index f34142cd..22930749 100644
--- a/src/modules/module-rygel-media-server.c
+++ b/src/modules/module-rygel-media-server.c
@@ -28,8 +28,8 @@
#include <string.h>
#include <unistd.h>
+#include <pulse/gccmacro.h>
#include <pulse/xmalloc.h>
-#include <pulse/util.h>
#include <pulse/i18n.h>
#include <pulse/utf8.h>
@@ -39,7 +39,6 @@
#include <pulsecore/log.h>
#include <pulsecore/modargs.h>
#include <pulsecore/dbus-shared.h>
-#include <pulsecore/endianmacros.h>
#include <pulsecore/namereg.h>
#include <pulsecore/mime-type.h>
#include <pulsecore/strbuf.h>
diff --git a/src/modules/module-sine-source.c b/src/modules/module-sine-source.c
index 955834f1..20a68680 100644
--- a/src/modules/module-sine-source.c
+++ b/src/modules/module-sine-source.c
@@ -24,22 +24,16 @@
#endif
#include <stdlib.h>
-#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>
-#include <string.h>
-#include <fcntl.h>
#include <unistd.h>
-#include <limits.h>
#include <pulse/rtclock.h>
#include <pulse/timeval.h>
#include <pulse/xmalloc.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/source.h>
#include <pulsecore/module.h>
-#include <pulsecore/core-rtclock.h>
#include <pulsecore/core-util.h>
#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
diff --git a/src/modules/module-sine.c b/src/modules/module-sine.c
index cee01f1a..c6d73039 100644
--- a/src/modules/module-sine.c
+++ b/src/modules/module-sine.c
@@ -24,7 +24,6 @@
#endif
#include <stdio.h>
-#include <math.h>
#include <pulse/xmalloc.h>
@@ -33,7 +32,6 @@
#include <pulsecore/modargs.h>
#include <pulsecore/namereg.h>
#include <pulsecore/log.h>
-#include <pulsecore/core-util.h>
#include "module-sine-symdef.h"
diff --git a/src/modules/module-solaris.c b/src/modules/module-solaris.c
index ee06b3be..0e4e4017 100644
--- a/src/modules/module-solaris.c
+++ b/src/modules/module-solaris.c
@@ -28,12 +28,9 @@
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
-#include <string.h>
#include <fcntl.h>
#include <unistd.h>
-#include <limits.h>
#include <sys/ioctl.h>
-#include <sys/stat.h>
#include <sys/types.h>
#include <signal.h>
@@ -41,14 +38,12 @@
#include <sys/conf.h>
#include <sys/audio.h>
-#include <pulse/error.h>
#include <pulse/mainloop-signal.h>
#include <pulse/xmalloc.h>
#include <pulse/timeval.h>
#include <pulse/util.h>
#include <pulse/rtclock.h>
-#include <pulsecore/iochannel.h>
#include <pulsecore/sink.h>
#include <pulsecore/source.h>
#include <pulsecore/module.h>
diff --git a/src/modules/module-stream-restore.c b/src/modules/module-stream-restore.c
index 310517e2..19c09bb6 100644
--- a/src/modules/module-stream-restore.c
+++ b/src/modules/module-stream-restore.c
@@ -30,12 +30,11 @@
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
-#include <ctype.h>
+#include <pulse/gccmacro.h>
#include <pulse/xmalloc.h>
#include <pulse/volume.h>
#include <pulse/timeval.h>
-#include <pulse/util.h>
#include <pulse/rtclock.h>
#include <pulsecore/core-error.h>
diff --git a/src/modules/module-suspend-on-idle.c b/src/modules/module-suspend-on-idle.c
index 00692702..e7242628 100644
--- a/src/modules/module-suspend-on-idle.c
+++ b/src/modules/module-suspend-on-idle.c
@@ -33,7 +33,6 @@
#include <pulsecore/source-output.h>
#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
-#include <pulsecore/namereg.h>
#include "module-suspend-on-idle-symdef.h"
diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c
index 1b2d3a1a..4b1ae7df 100644
--- a/src/modules/module-tunnel.c
+++ b/src/modules/module-tunnel.c
@@ -42,12 +42,10 @@
#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
#include <pulsecore/core-subscribe.h>
-#include <pulsecore/sink-input.h>
#include <pulsecore/pdispatch.h>
#include <pulsecore/pstream.h>
#include <pulsecore/pstream-util.h>
#include <pulsecore/socket-client.h>
-#include <pulsecore/socket-util.h>
#include <pulsecore/time-smoother.h>
#include <pulsecore/thread.h>
#include <pulsecore/thread-mq.h>
diff --git a/src/modules/module-virtual-sink.c b/src/modules/module-virtual-sink.c
index fe269304..a6be2446 100644
--- a/src/modules/module-virtual-sink.c
+++ b/src/modules/module-virtual-sink.c
@@ -27,18 +27,16 @@
#include <config.h>
#endif
+#include <pulse/gccmacro.h>
#include <pulse/xmalloc.h>
#include <pulse/i18n.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/namereg.h>
#include <pulsecore/sink.h>
#include <pulsecore/module.h>
#include <pulsecore/core-util.h>
#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
-#include <pulsecore/thread.h>
-#include <pulsecore/thread-mq.h>
#include <pulsecore/rtpoll.h>
#include <pulsecore/sample-util.h>
#include <pulsecore/ltdl-helper.h>
diff --git a/src/modules/module-virtual-source.c b/src/modules/module-virtual-source.c
index 680e71a1..e15f4b94 100644
--- a/src/modules/module-virtual-source.c
+++ b/src/modules/module-virtual-source.c
@@ -25,23 +25,17 @@
#endif
#include <stdio.h>
-#include <math.h>
#include <pulse/xmalloc.h>
#include <pulse/i18n.h>
#include <pulsecore/macro.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/namereg.h>
#include <pulsecore/sink.h>
#include <pulsecore/module.h>
-#include <pulsecore/core-rtclock.h>
#include <pulsecore/core-util.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
-#include <pulsecore/thread.h>
-#include <pulsecore/thread-mq.h>
#include <pulsecore/rtpoll.h>
#include <pulsecore/sample-util.h>
#include <pulsecore/ltdl-helper.h>
diff --git a/src/modules/module-waveout.c b/src/modules/module-waveout.c
index 9f119c59..cb02723c 100644
--- a/src/modules/module-waveout.c
+++ b/src/modules/module-waveout.c
@@ -27,11 +27,8 @@
#include <windows.h>
#include <mmsystem.h>
-#include <pulse/mainloop-api.h>
-
#include <pulse/xmalloc.h>
#include <pulse/timeval.h>
-#include <pulse/rtclock.h>
#include <pulsecore/sink.h>
#include <pulsecore/source.h>
diff --git a/src/modules/module-zeroconf-discover.c b/src/modules/module-zeroconf-discover.c
index 1fdc1f46..cd076aab 100644
--- a/src/modules/module-zeroconf-discover.c
+++ b/src/modules/module-zeroconf-discover.c
@@ -36,14 +36,9 @@
#include <avahi-common/malloc.h>
#include <pulse/xmalloc.h>
-#include <pulse/util.h>
-#include <pulsecore/sink.h>
-#include <pulsecore/source.h>
-#include <pulsecore/native-common.h>
#include <pulsecore/core-util.h>
#include <pulsecore/log.h>
-#include <pulsecore/core-subscribe.h>
#include <pulsecore/hashmap.h>
#include <pulsecore/modargs.h>
#include <pulsecore/namereg.h>
diff --git a/src/modules/module-zeroconf-publish.c b/src/modules/module-zeroconf-publish.c
index d72d2647..0c20cf6c 100644
--- a/src/modules/module-zeroconf-publish.c
+++ b/src/modules/module-zeroconf-publish.c
@@ -25,7 +25,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
#include <avahi-client/client.h>
@@ -43,11 +42,9 @@
#include <pulsecore/native-common.h>
#include <pulsecore/core-util.h>
#include <pulsecore/log.h>
-#include <pulsecore/core-subscribe.h>
#include <pulsecore/dynarray.h>
#include <pulsecore/modargs.h>
#include <pulsecore/avahi-wrap.h>
-#include <pulsecore/endianmacros.h>
#include <pulsecore/protocol-native.h>
#include "module-zeroconf-publish-symdef.h"
diff --git a/src/modules/oss/module-oss.c b/src/modules/oss/module-oss.c
index dea5628f..2a99d119 100644
--- a/src/modules/oss/module-oss.c
+++ b/src/modules/oss/module-oss.c
@@ -45,14 +45,10 @@
#include <sys/soundcard.h>
#include <sys/ioctl.h>
#include <stdlib.h>
-#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>
-#include <string.h>
#include <fcntl.h>
#include <unistd.h>
-#include <limits.h>
-#include <signal.h>
#include <pulse/xmalloc.h>
#include <pulse/util.h>
diff --git a/src/modules/oss/oss-util.c b/src/modules/oss/oss-util.c
index 966a6ca1..04899afe 100644
--- a/src/modules/oss/oss-util.c
+++ b/src/modules/oss/oss-util.c
@@ -31,7 +31,6 @@
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
#include <pulse/xmalloc.h>
diff --git a/src/modules/raop/module-raop-discover.c b/src/modules/raop/module-raop-discover.c
index adba8e4f..da1e82b3 100644
--- a/src/modules/raop/module-raop-discover.c
+++ b/src/modules/raop/module-raop-discover.c
@@ -37,14 +37,9 @@
#include <avahi-common/malloc.h>
#include <pulse/xmalloc.h>
-#include <pulse/util.h>
-#include <pulsecore/sink.h>
-#include <pulsecore/source.h>
-#include <pulsecore/native-common.h>
#include <pulsecore/core-util.h>
#include <pulsecore/log.h>
-#include <pulsecore/core-subscribe.h>
#include <pulsecore/hashmap.h>
#include <pulsecore/modargs.h>
#include <pulsecore/namereg.h>
diff --git a/src/modules/raop/module-raop-sink.c b/src/modules/raop/module-raop-sink.c
index 89d8cb8c..3f362b20 100644
--- a/src/modules/raop/module-raop-sink.c
+++ b/src/modules/raop/module-raop-sink.c
@@ -25,13 +25,10 @@
#endif
#include <stdlib.h>
-#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
-#include <fcntl.h>
#include <unistd.h>
-#include <limits.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
@@ -46,19 +43,15 @@
#include <pulse/xmalloc.h>
#include <pulsecore/core-error.h>
-#include <pulsecore/iochannel.h>
#include <pulsecore/sink.h>
#include <pulsecore/module.h>
-#include <pulsecore/core-rtclock.h>
#include <pulsecore/core-util.h>
#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
#include <pulsecore/socket-client.h>
-#include <pulsecore/authkey.h>
#include <pulsecore/thread-mq.h>
#include <pulsecore/thread.h>
#include <pulsecore/time-smoother.h>
-#include <pulsecore/socket-util.h>
#include <pulsecore/poll.h>
#include "module-raop-sink-symdef.h"
diff --git a/src/modules/raop/raop_client.c b/src/modules/raop/raop_client.c
index 05c7b169..4d2ad6ea 100644
--- a/src/modules/raop/raop_client.c
+++ b/src/modules/raop/raop_client.c
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
@@ -45,12 +44,12 @@
#include <pulsecore/core-error.h>
#include <pulsecore/core-util.h>
+#include <pulsecore/iochannel.h>
#include <pulsecore/socket-util.h>
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
-#include <pulsecore/strbuf.h>
+#include <pulsecore/memchunk.h>
#include <pulsecore/random.h>
-#include <pulsecore/poll.h>
#include "raop_client.h"
#include "rtsp_client.h"
diff --git a/src/modules/raop/raop_client.h b/src/modules/raop/raop_client.h
index 5ad3e3fa..ce81f392 100644
--- a/src/modules/raop/raop_client.h
+++ b/src/modules/raop/raop_client.h
@@ -22,8 +22,6 @@
USA.
***/
-#include <pulse/mainloop-api.h>
-#include <pulsecore/iochannel.h>
#include <pulsecore/core.h>
typedef struct pa_raop_client pa_raop_client;
diff --git a/src/modules/reserve-monitor.h b/src/modules/reserve-monitor.h
index 421a52e0..3408680f 100644
--- a/src/modules/reserve-monitor.h
+++ b/src/modules/reserve-monitor.h
@@ -28,7 +28,6 @@
***/
#include <dbus/dbus.h>
-#include <inttypes.h>
#ifdef __cplusplus
extern "C" {
diff --git a/src/modules/rtp/module-rtp-recv.c b/src/modules/rtp/module-rtp-recv.c
index fb3bccb4..7025c15a 100644
--- a/src/modules/rtp/module-rtp-recv.c
+++ b/src/modules/rtp/module-rtp-recv.c
@@ -30,6 +30,7 @@
#include <errno.h>
#include <string.h>
#include <unistd.h>
+#include <math.h>
#include <pulse/rtclock.h>
#include <pulse/timeval.h>
@@ -48,9 +49,8 @@
#include <pulsecore/namereg.h>
#include <pulsecore/sample-util.h>
#include <pulsecore/macro.h>
-#include <pulsecore/atomic.h>
-#include <pulsecore/atomic.h>
#include <pulsecore/socket-util.h>
+#include <pulsecore/atomic.h>
#include <pulsecore/once.h>
#include <pulsecore/poll.h>
#include <pulsecore/arpa-inet.h>
diff --git a/src/modules/rtp/module-rtp-send.c b/src/modules/rtp/module-rtp-send.c
index e0fed997..7131629c 100644
--- a/src/modules/rtp/module-rtp-send.c
+++ b/src/modules/rtp/module-rtp-send.c
@@ -27,7 +27,6 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <errno.h>
-#include <string.h>
#include <unistd.h>
#include <pulse/rtclock.h>
@@ -37,7 +36,6 @@
#include <pulsecore/core-error.h>
#include <pulsecore/module.h>
-#include <pulsecore/llist.h>
#include <pulsecore/source.h>
#include <pulsecore/source-output.h>
#include <pulsecore/memblockq.h>
diff --git a/src/modules/rtp/rtp.c b/src/modules/rtp/rtp.c
index 22e491bf..05c736a7 100644
--- a/src/modules/rtp/rtp.c
+++ b/src/modules/rtp/rtp.c
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
diff --git a/src/modules/rtp/rtsp_client.c b/src/modules/rtp/rtsp_client.c
index 8a5a1d75..ecf85b89 100644
--- a/src/modules/rtp/rtsp_client.c
+++ b/src/modules/rtp/rtsp_client.c
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
@@ -39,12 +38,10 @@
#include <pulsecore/core-error.h>
#include <pulsecore/core-util.h>
-#include <pulsecore/socket-util.h>
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
#include <pulsecore/strbuf.h>
#include <pulsecore/ioline.h>
-#include <pulsecore/poll.h>
#include <pulsecore/arpa-inet.h>
#include "rtsp_client.h"
diff --git a/src/modules/rtp/rtsp_client.h b/src/modules/rtp/rtsp_client.h
index b229f261..a56b9324 100644
--- a/src/modules/rtp/rtsp_client.h
+++ b/src/modules/rtp/rtsp_client.h
@@ -27,8 +27,6 @@
#include <sys/types.h>
#include <netdb.h>
-#include <pulsecore/memblockq.h>
-#include <pulsecore/memchunk.h>
#include <pulsecore/socket-client.h>
#include <pulse/mainloop-api.h>
diff --git a/src/modules/rtp/sap.c b/src/modules/rtp/sap.c
index 87c8b8f6..4d8bf668 100644
--- a/src/modules/rtp/sap.c
+++ b/src/modules/rtp/sap.c
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#include <time.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/src/modules/udev-util.h b/src/modules/udev-util.h
index 8523bc4d..a978178f 100644
--- a/src/modules/udev-util.h
+++ b/src/modules/udev-util.h
@@ -23,7 +23,7 @@
***/
-#include <pulsecore/core.h>
+#include <pulse/proplist.h>
int pa_udev_get_info(int card_idx, pa_proplist *p);
char* pa_udev_get_property(int card_idx, const char *name);
diff --git a/src/modules/x11/module-x11-bell.c b/src/modules/x11/module-x11-bell.c
index ac303c3b..37ab2e78 100644
--- a/src/modules/x11/module-x11-bell.c
+++ b/src/modules/x11/module-x11-bell.c
@@ -25,18 +25,14 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <X11/Xlib.h>
#include <X11/XKBlib.h>
#include <pulse/xmalloc.h>
-#include <pulsecore/iochannel.h>
-#include <pulsecore/sink.h>
#include <pulsecore/core-scache.h>
#include <pulsecore/modargs.h>
-#include <pulsecore/namereg.h>
#include <pulsecore/log.h>
#include <pulsecore/x11wrap.h>
diff --git a/src/modules/x11/module-x11-cork-request.c b/src/modules/x11/module-x11-cork-request.c
index c1380c27..0e67db00 100644
--- a/src/modules/x11/module-x11-cork-request.c
+++ b/src/modules/x11/module-x11-cork-request.c
@@ -25,7 +25,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
#include <X11/Xlib.h>
@@ -33,7 +32,6 @@
#include <X11/XF86keysym.h>
#include <X11/keysym.h>
-#include <pulse/util.h>
#include <pulse/xmalloc.h>
#include <pulsecore/module.h>
diff --git a/src/modules/x11/module-x11-publish.c b/src/modules/x11/module-x11-publish.c
index 6544e07d..716fe0b8 100644
--- a/src/modules/x11/module-x11-publish.c
+++ b/src/modules/x11/module-x11-publish.c
@@ -30,14 +30,10 @@
#include <xcb/xcb.h>
-#include <pulse/util.h>
#include <pulse/xmalloc.h>
#include <pulsecore/module.h>
-#include <pulsecore/sink.h>
-#include <pulsecore/core-scache.h>
#include <pulsecore/modargs.h>
-#include <pulsecore/namereg.h>
#include <pulsecore/log.h>
#include <pulsecore/x11wrap.h>
#include <pulsecore/core-util.h>
@@ -45,7 +41,6 @@
#include <pulsecore/auth-cookie.h>
#include <pulsecore/x11prop.h>
#include <pulsecore/strlist.h>
-#include <pulsecore/shared.h>
#include <pulsecore/protocol-native.h>
#include "module-x11-publish-symdef.h"
diff --git a/src/modules/x11/module-x11-xsmp.c b/src/modules/x11/module-x11-xsmp.c
index 47a4e93e..6a6116ff 100644
--- a/src/modules/x11/module-x11-xsmp.c
+++ b/src/modules/x11/module-x11-xsmp.c
@@ -33,13 +33,8 @@
#include <pulse/xmalloc.h>
#include <pulse/util.h>
-#include <pulsecore/iochannel.h>
-#include <pulsecore/sink.h>
-#include <pulsecore/core-scache.h>
#include <pulsecore/modargs.h>
-#include <pulsecore/namereg.h>
#include <pulsecore/log.h>
-#include <pulsecore/core-util.h>
#include <pulsecore/x11wrap.h>
#include "module-x11-xsmp-symdef.h"
diff --git a/src/pulse/client-conf.c b/src/pulse/client-conf.c
index 18fafe34..e899af19 100644
--- a/src/pulse/client-conf.c
+++ b/src/pulse/client-conf.c
@@ -27,7 +27,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
-#include <string.h>
#include <pulse/xmalloc.h>
#include <pulse/i18n.h>
diff --git a/src/pulse/context.c b/src/pulse/context.c
index 5dd780bd..e8f30328 100644
--- a/src/pulse/context.c
+++ b/src/pulse/context.c
@@ -32,23 +32,17 @@
#include <sys/stat.h>
#include <errno.h>
#include <signal.h>
-#include <limits.h>
-#include <locale.h>
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
-#ifdef HAVE_SYS_UN_H
-#include <sys/un.h>
-#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#include <pulse/version.h>
#include <pulse/xmalloc.h>
-#include <pulse/utf8.h>
#include <pulse/util.h>
#include <pulse/i18n.h>
#include <pulse/mainloop.h>
@@ -70,7 +64,6 @@
#include <pulsecore/core-util.h>
#include <pulsecore/log.h>
#include <pulsecore/socket.h>
-#include <pulsecore/socket-util.h>
#include <pulsecore/creds.h>
#include <pulsecore/macro.h>
#include <pulsecore/proplist-util.h>
diff --git a/src/pulse/error.c b/src/pulse/error.c
index e8276990..19a759c2 100644
--- a/src/pulse/error.c
+++ b/src/pulse/error.c
@@ -27,14 +27,10 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
-#include <pulse/xmalloc.h>
+#include <pulse/def.h>
#include <pulse/i18n.h>
-#include <pulsecore/core-util.h>
-#include <pulsecore/native-common.h>
-
#include "error.h"
const char*pa_strerror(int error) {
diff --git a/src/pulse/error.h b/src/pulse/error.h
index ea535608..788db845 100644
--- a/src/pulse/error.h
+++ b/src/pulse/error.h
@@ -23,7 +23,6 @@
USA.
***/
-#include <inttypes.h>
#include <pulse/cdecl.h>
#include <pulse/version.h>
diff --git a/src/pulse/ext-device-manager.c b/src/pulse/ext-device-manager.c
index 7b78c24e..f2ea63a5 100644
--- a/src/pulse/ext-device-manager.c
+++ b/src/pulse/ext-device-manager.c
@@ -25,7 +25,6 @@
#endif
#include <pulse/context.h>
-#include <pulse/gccmacro.h>
#include <pulse/xmalloc.h>
#include <pulse/fork-detect.h>
#include <pulse/operation.h>
diff --git a/src/pulse/ext-device-manager.h b/src/pulse/ext-device-manager.h
index df0ab92f..1e41ebd7 100644
--- a/src/pulse/ext-device-manager.h
+++ b/src/pulse/ext-device-manager.h
@@ -23,6 +23,7 @@
USA.
***/
+#include <pulse/cdecl.h>
#include <pulse/context.h>
#include <pulse/version.h>
diff --git a/src/pulse/ext-stream-restore.c b/src/pulse/ext-stream-restore.c
index 7bc1a612..1f72c1c4 100644
--- a/src/pulse/ext-stream-restore.c
+++ b/src/pulse/ext-stream-restore.c
@@ -24,7 +24,6 @@
#endif
#include <pulse/context.h>
-#include <pulse/gccmacro.h>
#include <pulse/fork-detect.h>
#include <pulse/operation.h>
diff --git a/src/pulse/ext-stream-restore.h b/src/pulse/ext-stream-restore.h
index 54516f63..acb16a83 100644
--- a/src/pulse/ext-stream-restore.h
+++ b/src/pulse/ext-stream-restore.h
@@ -22,6 +22,7 @@
USA.
***/
+#include <pulse/cdecl.h>
#include <pulse/context.h>
#include <pulse/version.h>
#include <pulse/volume.h>
diff --git a/src/pulse/format.h b/src/pulse/format.h
index 06e1fe62..821149ca 100644
--- a/src/pulse/format.h
+++ b/src/pulse/format.h
@@ -25,6 +25,7 @@
***/
#include <pulse/cdecl.h>
+#include <pulse/gccmacro.h>
#include <pulse/proplist.h>
#include <pulse/sample.h>
#include <pulse/channelmap.h>
diff --git a/src/pulse/glib-mainloop.c b/src/pulse/glib-mainloop.c
index 2e5f2f92..35c9c6a2 100644
--- a/src/pulse/glib-mainloop.c
+++ b/src/pulse/glib-mainloop.c
@@ -26,7 +26,6 @@
#include <pulse/xmalloc.h>
#include <pulse/timeval.h>
-#include <pulsecore/idxset.h>
#include <pulsecore/core-util.h>
#include <pulsecore/log.h>
#include <pulsecore/llist.h>
diff --git a/src/pulse/i18n.h b/src/pulse/i18n.h
index f91c0bf9..fac3c7b2 100644
--- a/src/pulse/i18n.h
+++ b/src/pulse/i18n.h
@@ -23,7 +23,6 @@
***/
#include <pulse/cdecl.h>
-#include <pulse/gccmacro.h>
#include <pulse/version.h>
PA_C_DECL_BEGIN
diff --git a/src/pulse/introspect.c b/src/pulse/introspect.c
index 014eadfc..27a298cf 100644
--- a/src/pulse/introspect.c
+++ b/src/pulse/introspect.c
@@ -24,10 +24,7 @@
#include <config.h>
#endif
-#include <string.h>
-
#include <pulse/context.h>
-#include <pulse/gccmacro.h>
#include <pulse/xmalloc.h>
#include <pulse/fork-detect.h>
diff --git a/src/pulse/mainloop-api.c b/src/pulse/mainloop-api.c
index 4b862f9a..c1f76046 100644
--- a/src/pulse/mainloop-api.c
+++ b/src/pulse/mainloop-api.c
@@ -26,7 +26,6 @@
#include <stdlib.h>
#include <pulse/xmalloc.h>
-#include <pulse/gccmacro.h>
#include <pulse/i18n.h>
#include <pulsecore/macro.h>
diff --git a/src/pulse/mainloop-api.h b/src/pulse/mainloop-api.h
index 212ff3cc..eb2e8421 100644
--- a/src/pulse/mainloop-api.h
+++ b/src/pulse/mainloop-api.h
@@ -26,7 +26,6 @@
#include <sys/time.h>
#include <pulse/cdecl.h>
-#include <pulse/sample.h>
#include <pulse/version.h>
/** \file
diff --git a/src/pulse/mainloop-signal.c b/src/pulse/mainloop-signal.c
index 70c0122c..393d1f7d 100644
--- a/src/pulse/mainloop-signal.c
+++ b/src/pulse/mainloop-signal.c
@@ -30,14 +30,12 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <fcntl.h>
#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif
#include <pulse/xmalloc.h>
-#include <pulse/gccmacro.h>
#include <pulse/i18n.h>
#include <pulsecore/core-error.h>
diff --git a/src/pulse/mainloop.c b/src/pulse/mainloop.c
index f02d31a1..3ef387b6 100644
--- a/src/pulse/mainloop.c
+++ b/src/pulse/mainloop.c
@@ -25,10 +25,8 @@
#endif
#include <stdio.h>
-#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
-#include <string.h>
#include <fcntl.h>
#include <errno.h>
diff --git a/src/pulse/proplist.c b/src/pulse/proplist.c
index faa98b79..75445e06 100644
--- a/src/pulse/proplist.c
+++ b/src/pulse/proplist.c
@@ -28,7 +28,6 @@
#include <pulse/xmalloc.h>
#include <pulse/utf8.h>
-#include <pulse/i18n.h>
#include <pulsecore/hashmap.h>
#include <pulsecore/strbuf.h>
diff --git a/src/pulse/rtclock.h b/src/pulse/rtclock.h
index 6459d92d..cba20e31 100644
--- a/src/pulse/rtclock.h
+++ b/src/pulse/rtclock.h
@@ -23,8 +23,7 @@
***/
#include <pulse/cdecl.h>
-#include <pulse/def.h>
-#include <pulse/gccmacro.h>
+#include <pulse/sample.h>
/** \file
* Monotonic clock utilities. */
diff --git a/src/pulse/sample.c b/src/pulse/sample.c
index 50d55210..8365e93e 100644
--- a/src/pulse/sample.c
+++ b/src/pulse/sample.c
@@ -25,7 +25,6 @@
#endif
#include <stdio.h>
-#include <math.h>
#include <string.h>
#include <pulse/timeval.h>
diff --git a/src/pulse/sample.h b/src/pulse/sample.h
index c9e6fc48..8d9ef1d0 100644
--- a/src/pulse/sample.h
+++ b/src/pulse/sample.h
@@ -26,7 +26,6 @@
#include <inttypes.h>
#include <sys/types.h>
#include <sys/param.h>
-#include <math.h>
#include <pulse/gccmacro.h>
#include <pulse/cdecl.h>
diff --git a/src/pulse/scache.c b/src/pulse/scache.c
index 6ed80a68..3fad82a1 100644
--- a/src/pulse/scache.c
+++ b/src/pulse/scache.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include <stdio.h>
-#include <string.h>
#include <pulse/utf8.h>
#include <pulse/fork-detect.h>
diff --git a/src/pulse/simple.c b/src/pulse/simple.c
index 9ed7a653..3524296a 100644
--- a/src/pulse/simple.c
+++ b/src/pulse/simple.c
@@ -32,7 +32,6 @@
#include <pulse/thread-mainloop.h>
#include <pulse/xmalloc.h>
-#include <pulsecore/native-common.h>
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
diff --git a/src/pulse/subscribe.c b/src/pulse/subscribe.c
index 52d0af35..a6ad238c 100644
--- a/src/pulse/subscribe.c
+++ b/src/pulse/subscribe.c
@@ -25,8 +25,6 @@
#include <stdio.h>
-#include <pulse/gccmacro.h>
-
#include <pulsecore/macro.h>
#include <pulsecore/pstream-util.h>
diff --git a/src/pulse/thread-mainloop.c b/src/pulse/thread-mainloop.c
index ef4ef56e..b07ad789 100644
--- a/src/pulse/thread-mainloop.c
+++ b/src/pulse/thread-mainloop.c
@@ -36,7 +36,6 @@
#include <pulse/i18n.h>
#include <pulsecore/log.h>
-#include <pulsecore/hashmap.h>
#include <pulsecore/thread.h>
#include <pulsecore/mutex.h>
#include <pulsecore/macro.h>
diff --git a/src/pulse/util.c b/src/pulse/util.c
index 48ccf295..ba1d2a08 100644
--- a/src/pulse/util.c
+++ b/src/pulse/util.c
@@ -58,8 +58,6 @@
#include <pulse/timeval.h>
#include <pulsecore/socket.h>
-#include <pulsecore/core-error.h>
-#include <pulsecore/log.h>
#include <pulsecore/core-util.h>
#include <pulsecore/macro.h>
#include <pulsecore/usergroup.h>
diff --git a/src/pulse/util.h b/src/pulse/util.h
index ad85653d..e490d56d 100644
--- a/src/pulse/util.h
+++ b/src/pulse/util.h
@@ -26,7 +26,6 @@
#include <stddef.h>
#include <pulse/cdecl.h>
-#include <pulse/gccmacro.h>
#include <pulse/version.h>
/** \file
diff --git a/src/pulse/volume.c b/src/pulse/volume.c
index 134c007d..82e57572 100644
--- a/src/pulse/volume.c
+++ b/src/pulse/volume.c
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <string.h>
+#include <math.h>
#include <pulse/i18n.h>
diff --git a/src/pulsecore/arpa-inet.c b/src/pulsecore/arpa-inet.c
index 3d6f316a..c927ca0b 100644
--- a/src/pulsecore/arpa-inet.c
+++ b/src/pulsecore/arpa-inet.c
@@ -27,7 +27,6 @@
#include <errno.h>
-#include <pulsecore/core-util.h>
#include <pulsecore/macro.h>
#include <pulsecore/socket.h>
diff --git a/src/pulsecore/asyncmsgq.c b/src/pulsecore/asyncmsgq.c
index c211d9b0..408416c9 100644
--- a/src/pulsecore/asyncmsgq.c
+++ b/src/pulsecore/asyncmsgq.c
@@ -28,13 +28,11 @@
#include <pulse/xmalloc.h>
-#include <pulsecore/atomic.h>
#include <pulsecore/macro.h>
#include <pulsecore/log.h>
-#include <pulsecore/thread.h>
#include <pulsecore/semaphore.h>
#include <pulsecore/macro.h>
-#include <pulsecore/core-util.h>
+#include <pulsecore/mutex.h>
#include <pulsecore/flist.h>
#include "asyncmsgq.h"
diff --git a/src/pulsecore/auth-cookie.c b/src/pulsecore/auth-cookie.c
index 2f45eca0..0897502f 100644
--- a/src/pulsecore/auth-cookie.c
+++ b/src/pulsecore/auth-cookie.c
@@ -26,7 +26,6 @@
#include <sys/types.h>
#include <pulse/xmalloc.h>
-#include <pulse/util.h>
#include <pulsecore/refcnt.h>
#include <pulsecore/macro.h>
diff --git a/src/pulsecore/authkey.c b/src/pulsecore/authkey.c
index a590a65e..398e5b1b 100644
--- a/src/pulsecore/authkey.c
+++ b/src/pulsecore/authkey.c
@@ -29,9 +29,7 @@
#include <string.h>
#include <errno.h>
#include <stdio.h>
-#include <inttypes.h>
#include <stdlib.h>
-#include <limits.h>
#include <sys/stat.h>
#include <pulse/util.h>
diff --git a/src/pulsecore/avahi-wrap.c b/src/pulsecore/avahi-wrap.c
index f1f08bcc..997d81ff 100644
--- a/src/pulsecore/avahi-wrap.c
+++ b/src/pulsecore/avahi-wrap.c
@@ -26,7 +26,6 @@
#include <pulse/timeval.h>
#include <pulse/xmalloc.h>
-#include <pulsecore/log.h>
#include <pulsecore/macro.h>
#include "avahi-wrap.h"
diff --git a/src/pulsecore/cli-command.c b/src/pulsecore/cli-command.c
index 1db19cef..e5c18065 100644
--- a/src/pulsecore/cli-command.c
+++ b/src/pulsecore/cli-command.c
@@ -48,7 +48,6 @@
#include <pulsecore/namereg.h>
#include <pulsecore/cli-text.h>
#include <pulsecore/core-scache.h>
-#include <pulsecore/sample-util.h>
#include <pulsecore/sound-file.h>
#include <pulsecore/play-memchunk.h>
#include <pulsecore/sound-file-stream.h>
diff --git a/src/pulsecore/cli-text.c b/src/pulsecore/cli-text.c
index e6018da2..5498744c 100644
--- a/src/pulsecore/cli-text.c
+++ b/src/pulsecore/cli-text.c
@@ -23,8 +23,6 @@
#include <config.h>
#endif
-#include <string.h>
-
#include <pulse/volume.h>
#include <pulse/xmalloc.h>
#include <pulse/timeval.h>
@@ -36,7 +34,6 @@
#include <pulsecore/sink-input.h>
#include <pulsecore/source-output.h>
#include <pulsecore/strbuf.h>
-#include <pulsecore/sample-util.h>
#include <pulsecore/core-scache.h>
#include <pulsecore/macro.h>
#include <pulsecore/core-util.h>
diff --git a/src/pulsecore/cli.c b/src/pulsecore/cli.c
index 54514e7f..53aa6511 100644
--- a/src/pulsecore/cli.c
+++ b/src/pulsecore/cli.c
@@ -24,21 +24,16 @@
#endif
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
#include <pulse/xmalloc.h>
+#include <pulsecore/core-util.h>
#include <pulsecore/ioline.h>
#include <pulsecore/module.h>
-#include <pulsecore/sink.h>
-#include <pulsecore/source.h>
#include <pulsecore/client.h>
-#include <pulsecore/sink-input.h>
-#include <pulsecore/source-output.h>
#include <pulsecore/tokenizer.h>
#include <pulsecore/strbuf.h>
-#include <pulsecore/namereg.h>
#include <pulsecore/cli-text.h>
#include <pulsecore/cli-command.h>
#include <pulsecore/log.h>
diff --git a/src/pulsecore/core-error.c b/src/pulsecore/core-error.c
index c4408069..4d930a09 100644
--- a/src/pulsecore/core-error.c
+++ b/src/pulsecore/core-error.c
@@ -32,8 +32,6 @@
#include <pulse/utf8.h>
#include <pulse/xmalloc.h>
-#include <pulsecore/core-util.h>
-#include <pulsecore/native-common.h>
#include <pulsecore/thread.h>
#include <pulsecore/macro.h>
#include <pulsecore/log.h>
diff --git a/src/pulsecore/core-error.h b/src/pulsecore/core-error.h
index e7bc4fca..e2950916 100644
--- a/src/pulsecore/core-error.h
+++ b/src/pulsecore/core-error.h
@@ -23,7 +23,6 @@
USA.
***/
-#include <inttypes.h>
#include <pulse/cdecl.h>
/** \file
diff --git a/src/pulsecore/core-scache.c b/src/pulsecore/core-scache.c
index 1aed9077..4f2a44dc 100644
--- a/src/pulsecore/core-scache.c
+++ b/src/pulsecore/core-scache.c
@@ -25,7 +25,6 @@
#endif
#include <stdlib.h>
-#include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>
@@ -51,7 +50,6 @@
#include <pulse/rtclock.h>
#include <pulsecore/sink-input.h>
-#include <pulsecore/sample-util.h>
#include <pulsecore/play-memchunk.h>
#include <pulsecore/core-subscribe.h>
#include <pulsecore/namereg.h>
diff --git a/src/pulsecore/core-subscribe.c b/src/pulsecore/core-subscribe.c
index 54fb7ec2..e13e6ea2 100644
--- a/src/pulsecore/core-subscribe.c
+++ b/src/pulsecore/core-subscribe.c
@@ -27,7 +27,6 @@
#include <pulse/xmalloc.h>
-#include <pulsecore/queue.h>
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
diff --git a/src/pulsecore/core.c b/src/pulsecore/core.c
index 626ae65f..2a68fdf4 100644
--- a/src/pulsecore/core.c
+++ b/src/pulsecore/core.c
@@ -33,14 +33,10 @@
#include <pulse/xmalloc.h>
#include <pulsecore/module.h>
-#include <pulsecore/sink.h>
-#include <pulsecore/source.h>
-#include <pulsecore/namereg.h>
#include <pulsecore/core-rtclock.h>
#include <pulsecore/core-util.h>
#include <pulsecore/core-scache.h>
#include <pulsecore/core-subscribe.h>
-#include <pulsecore/shared.h>
#include <pulsecore/random.h>
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
diff --git a/src/pulsecore/core.h b/src/pulsecore/core.h
index 6b25fbad..61c86903 100644
--- a/src/pulsecore/core.h
+++ b/src/pulsecore/core.h
@@ -43,7 +43,6 @@ typedef enum pa_suspend_cause {
#include <pulsecore/hashmap.h>
#include <pulsecore/memblock.h>
#include <pulsecore/resampler.h>
-#include <pulsecore/queue.h>
#include <pulsecore/llist.h>
#include <pulsecore/hook-list.h>
#include <pulsecore/asyncmsgq.h>
@@ -51,7 +50,6 @@ typedef enum pa_suspend_cause {
#include <pulsecore/sink.h>
#include <pulsecore/source.h>
#include <pulsecore/core-subscribe.h>
-#include <pulsecore/sink-input.h>
#include <pulsecore/msgobject.h>
typedef enum pa_server_type {
diff --git a/src/pulsecore/cpu-arm.c b/src/pulsecore/cpu-arm.c
index 0287043e..078fb04f 100644
--- a/src/pulsecore/cpu-arm.c
+++ b/src/pulsecore/cpu-arm.c
@@ -26,7 +26,6 @@
#include <stdint.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
#include <pulse/xmalloc.h>
diff --git a/src/pulsecore/creds.h b/src/pulsecore/creds.h
index 9e6fb124..aa1d5608 100644
--- a/src/pulsecore/creds.h
+++ b/src/pulsecore/creds.h
@@ -30,10 +30,6 @@
#include <pulsecore/socket.h>
-#ifdef HAVE_SYS_UN_H
-#include <sys/un.h>
-#endif
-
typedef struct pa_creds pa_creds;
#if defined(SCM_CREDENTIALS)
diff --git a/src/pulsecore/database-simple.c b/src/pulsecore/database-simple.c
index 237d0bdd..3538127d 100644
--- a/src/pulsecore/database-simple.c
+++ b/src/pulsecore/database-simple.c
@@ -25,9 +25,7 @@
#endif
#include <errno.h>
-#include <sys/stat.h>
#include <sys/types.h>
-#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
diff --git a/src/pulsecore/dbus-shared.c b/src/pulsecore/dbus-shared.c
index 20ef9b1e..34774072 100644
--- a/src/pulsecore/dbus-shared.c
+++ b/src/pulsecore/dbus-shared.c
@@ -24,11 +24,8 @@
#include <config.h>
#endif
-#include <stdarg.h>
-
#include <pulse/xmalloc.h>
-#include <pulse/timeval.h>
-#include <pulsecore/log.h>
+
#include <pulsecore/shared.h>
#include "dbus-shared.h"
diff --git a/src/pulsecore/dbus-util.h b/src/pulsecore/dbus-util.h
index f35e66cb..347f9f3e 100644
--- a/src/pulsecore/dbus-util.h
+++ b/src/pulsecore/dbus-util.h
@@ -24,10 +24,12 @@
#include <dbus/dbus.h>
-#include <pulsecore/llist.h>
+#include <pulse/gccmacro.h>
#include <pulse/mainloop-api.h>
#include <pulse/proplist.h>
+#include <pulsecore/llist.h>
+
/* A wrap connection is not shared or refcounted, it is available in client side */
typedef struct pa_dbus_wrap_connection pa_dbus_wrap_connection;
diff --git a/src/pulsecore/dllmain.c b/src/pulsecore/dllmain.c
index cb88c928..3ee89673 100644
--- a/src/pulsecore/dllmain.c
+++ b/src/pulsecore/dllmain.c
@@ -27,7 +27,6 @@
#include <stdlib.h>
#include <stdio.h>
-#include <string.h>
#include <windows.h>
#include <winsock2.h>
diff --git a/src/pulsecore/fdsem.c b/src/pulsecore/fdsem.c
index 62380451..14fcbd6b 100644
--- a/src/pulsecore/fdsem.c
+++ b/src/pulsecore/fdsem.c
@@ -32,7 +32,6 @@
#include <pulsecore/atomic.h>
#include <pulsecore/log.h>
-#include <pulsecore/thread.h>
#include <pulsecore/macro.h>
#include <pulsecore/core-util.h>
#include <pulsecore/core-error.h>
diff --git a/src/pulsecore/fdsem.h b/src/pulsecore/fdsem.h
index 48a77c49..90e8599a 100644
--- a/src/pulsecore/fdsem.h
+++ b/src/pulsecore/fdsem.h
@@ -23,7 +23,6 @@
***/
#include <sys/types.h>
-#include <pulse/def.h>
/* A simple, asynchronous semaphore which uses fds for sleeping. In
* the best case all functions are lock-free unless sleeping is
diff --git a/src/pulsecore/flist.c b/src/pulsecore/flist.c
index e342a579..add3aa20 100644
--- a/src/pulsecore/flist.c
+++ b/src/pulsecore/flist.c
@@ -30,7 +30,6 @@
#include <pulsecore/atomic.h>
#include <pulsecore/log.h>
-#include <pulsecore/thread.h>
#include <pulsecore/macro.h>
#include <pulsecore/core-util.h>
#include <pulsecore/macro.h>
diff --git a/src/pulsecore/hashmap.c b/src/pulsecore/hashmap.c
index 1fac97eb..e368512b 100644
--- a/src/pulsecore/hashmap.c
+++ b/src/pulsecore/hashmap.c
@@ -24,11 +24,9 @@
#endif
#include <stdlib.h>
-#include <string.h>
#include <pulse/xmalloc.h>
#include <pulsecore/idxset.h>
-#include <pulsecore/log.h>
#include <pulsecore/flist.h>
#include <pulsecore/macro.h>
diff --git a/src/pulsecore/hook-list.c b/src/pulsecore/hook-list.c
index d9b9917d..00981be3 100644
--- a/src/pulsecore/hook-list.c
+++ b/src/pulsecore/hook-list.c
@@ -23,6 +23,8 @@
#include <config.h>
#endif
+#include <pulse/xmalloc.h>
+
#include <pulsecore/macro.h>
#include "hook-list.h"
diff --git a/src/pulsecore/hook-list.h b/src/pulsecore/hook-list.h
index 86ce9d25..e4b70d3c 100644
--- a/src/pulsecore/hook-list.h
+++ b/src/pulsecore/hook-list.h
@@ -22,9 +22,6 @@
USA.
***/
-#include <pulse/xmalloc.h>
-#include <pulse/gccmacro.h>
-
#include <pulsecore/llist.h>
typedef struct pa_hook_slot pa_hook_slot;
diff --git a/src/pulsecore/idxset.c b/src/pulsecore/idxset.c
index 408011f6..2b6af90b 100644
--- a/src/pulsecore/idxset.c
+++ b/src/pulsecore/idxset.c
@@ -29,7 +29,6 @@
#include <string.h>
#include <pulse/xmalloc.h>
-#include <pulsecore/log.h>
#include <pulsecore/flist.h>
#include <pulsecore/macro.h>
diff --git a/src/pulsecore/iochannel.c b/src/pulsecore/iochannel.c
index f89b0670..4b0fb3a5 100644
--- a/src/pulsecore/iochannel.c
+++ b/src/pulsecore/iochannel.c
@@ -25,7 +25,6 @@
#endif
#include <stdlib.h>
-#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
diff --git a/src/pulsecore/ioline.c b/src/pulsecore/ioline.c
index 963f7d22..a18188df 100644
--- a/src/pulsecore/ioline.c
+++ b/src/pulsecore/ioline.c
@@ -32,6 +32,7 @@
#include <pulsecore/socket.h>
#include <pulsecore/core-error.h>
+#include <pulsecore/core-util.h>
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
#include <pulsecore/refcnt.h>
diff --git a/src/pulsecore/ioline.h b/src/pulsecore/ioline.h
index d973a3c7..12f6dead 100644
--- a/src/pulsecore/ioline.h
+++ b/src/pulsecore/ioline.h
@@ -22,8 +22,9 @@
USA.
***/
+#include <pulse/gccmacro.h>
+
#include <pulsecore/iochannel.h>
-#include <pulsecore/core-util.h>
/* An ioline wraps an iochannel for line based communication. A
* callback function is called whenever a new line has been recieved
diff --git a/src/pulsecore/lock-autospawn.c b/src/pulsecore/lock-autospawn.c
index a9c942fb..40aa5e92 100644
--- a/src/pulsecore/lock-autospawn.c
+++ b/src/pulsecore/lock-autospawn.c
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
@@ -32,6 +31,7 @@
#include <pthread.h>
#endif
+#include <pulse/gccmacro.h>
#include <pulse/i18n.h>
#include <pulse/xmalloc.h>
diff --git a/src/pulsecore/log.c b/src/pulsecore/log.c
index b12cbf0c..13038148 100644
--- a/src/pulsecore/log.c
+++ b/src/pulsecore/log.c
@@ -38,6 +38,7 @@
#include <syslog.h>
#endif
+#include <pulse/gccmacro.h>
#include <pulse/rtclock.h>
#include <pulse/utf8.h>
#include <pulse/xmalloc.h>
@@ -46,7 +47,6 @@
#include <pulsecore/macro.h>
#include <pulsecore/core-util.h>
-#include <pulsecore/core-rtclock.h>
#include <pulsecore/once.h>
#include <pulsecore/ratelimit.h>
diff --git a/src/pulsecore/ltdl-helper.c b/src/pulsecore/ltdl-helper.c
index 1a0e5558..bdb5a5dc 100644
--- a/src/pulsecore/ltdl-helper.c
+++ b/src/pulsecore/ltdl-helper.c
@@ -28,7 +28,6 @@
#include <ctype.h>
#include <pulse/xmalloc.h>
-#include <pulse/util.h>
#include <pulsecore/core-util.h>
#include <pulsecore/macro.h>
diff --git a/src/pulsecore/macro.h b/src/pulsecore/macro.h
index 9a5a2670..1207a108 100644
--- a/src/pulsecore/macro.h
+++ b/src/pulsecore/macro.h
@@ -31,8 +31,6 @@
#include <stdlib.h>
#include <string.h>
-#include <pulse/gccmacro.h>
-
#ifndef PACKAGE
#error "Please include config.h before including this file!"
#endif
diff --git a/src/pulsecore/memblock.c b/src/pulsecore/memblock.c
index bc804577..e34a7395 100644
--- a/src/pulsecore/memblock.c
+++ b/src/pulsecore/memblock.c
@@ -42,7 +42,10 @@
#include <pulsecore/log.h>
#include <pulsecore/hashmap.h>
#include <pulsecore/semaphore.h>
+#include <pulsecore/mutex.h>
#include <pulsecore/macro.h>
+#include <pulsecore/refcnt.h>
+#include <pulsecore/llist.h>
#include <pulsecore/flist.h>
#include <pulsecore/core-util.h>
#include <pulsecore/memtrap.h>
diff --git a/src/pulsecore/memblock.h b/src/pulsecore/memblock.h
index b1eab2a9..ca108ccd 100644
--- a/src/pulsecore/memblock.h
+++ b/src/pulsecore/memblock.h
@@ -27,8 +27,6 @@
#include <inttypes.h>
#include <pulse/def.h>
-#include <pulsecore/llist.h>
-#include <pulsecore/refcnt.h>
#include <pulsecore/atomic.h>
/* A pa_memblock is a reference counted memory block. PulseAudio
diff --git a/src/pulsecore/memchunk.c b/src/pulsecore/memchunk.c
index 34317fe5..cc242e4e 100644
--- a/src/pulsecore/memchunk.c
+++ b/src/pulsecore/memchunk.c
@@ -28,7 +28,6 @@
#include <string.h>
#include <errno.h>
-#include <pulse/xmalloc.h>
#include <pulsecore/macro.h>
#include <pulsecore/core-util.h>
diff --git a/src/pulsecore/modargs.c b/src/pulsecore/modargs.c
index 3106775f..45ffba23 100644
--- a/src/pulsecore/modargs.c
+++ b/src/pulsecore/modargs.c
@@ -31,10 +31,6 @@
#include <pulsecore/hashmap.h>
#include <pulsecore/idxset.h>
-#include <pulsecore/sample-util.h>
-#include <pulsecore/namereg.h>
-#include <pulsecore/sink.h>
-#include <pulsecore/source.h>
#include <pulsecore/core-util.h>
#include <pulsecore/macro.h>
diff --git a/src/pulsecore/modargs.h b/src/pulsecore/modargs.h
index 1ed66e9a..9a81e8d6 100644
--- a/src/pulsecore/modargs.h
+++ b/src/pulsecore/modargs.h
@@ -25,7 +25,7 @@
#include <inttypes.h>
#include <pulse/sample.h>
#include <pulse/channelmap.h>
-#include <pulsecore/core.h>
+#include <pulse/proplist.h>
#include <pulsecore/macro.h>
typedef struct pa_modargs pa_modargs;
diff --git a/src/pulsecore/modinfo.c b/src/pulsecore/modinfo.c
index b5ee9f56..860b8064 100644
--- a/src/pulsecore/modinfo.c
+++ b/src/pulsecore/modinfo.c
@@ -27,7 +27,6 @@
#include <pulse/xmalloc.h>
-#include <pulsecore/core-util.h>
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
#include <pulsecore/ltdl-helper.h>
diff --git a/src/pulsecore/module.c b/src/pulsecore/module.c
index 1b1e1126..8b3ff8f5 100644
--- a/src/pulsecore/module.c
+++ b/src/pulsecore/module.c
@@ -24,14 +24,11 @@
#include <config.h>
#endif
-#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
-#include <ctype.h>
-#include <pulse/timeval.h>
#include <pulse/xmalloc.h>
#include <pulse/proplist.h>
diff --git a/src/pulsecore/msgobject.h b/src/pulsecore/msgobject.h
index ee0ec1ed..9b5712b4 100644
--- a/src/pulsecore/msgobject.h
+++ b/src/pulsecore/msgobject.h
@@ -25,8 +25,6 @@
#include <sys/types.h>
-#include <pulse/xmalloc.h>
-#include <pulsecore/refcnt.h>
#include <pulsecore/macro.h>
#include <pulsecore/object.h>
#include <pulsecore/memchunk.h>
diff --git a/src/pulsecore/mutex-posix.c b/src/pulsecore/mutex-posix.c
index 0ff4bee6..634087d9 100644
--- a/src/pulsecore/mutex-posix.c
+++ b/src/pulsecore/mutex-posix.c
@@ -28,8 +28,6 @@
#include <pulse/xmalloc.h>
#include <pulsecore/macro.h>
-#include <pulsecore/log.h>
-#include <pulsecore/core-error.h>
#include "mutex.h"
diff --git a/src/pulsecore/object.c b/src/pulsecore/object.c
index 099d50d9..0dc8198a 100644
--- a/src/pulsecore/object.c
+++ b/src/pulsecore/object.c
@@ -24,8 +24,6 @@
#include <config.h>
#endif
-#include <pulsecore/core-util.h>
-
#include "object.h"
const char pa_object_type_id[] = "pa_object";
diff --git a/src/pulsecore/object.h b/src/pulsecore/object.h
index 4c120cd5..1ddce3b4 100644
--- a/src/pulsecore/object.h
+++ b/src/pulsecore/object.h
@@ -23,7 +23,6 @@
USA.
***/
-#include <string.h>
#include <sys/types.h>
#include <pulse/xmalloc.h>
diff --git a/src/pulsecore/once.h b/src/pulsecore/once.h
index 50ac18c1..edc81881 100644
--- a/src/pulsecore/once.h
+++ b/src/pulsecore/once.h
@@ -22,7 +22,6 @@
USA.
***/
-#include <pulsecore/mutex.h>
#include <pulsecore/atomic.h>
typedef struct pa_once {
diff --git a/src/pulsecore/parseaddr.c b/src/pulsecore/parseaddr.c
index 4b6cf9db..7ec068a4 100644
--- a/src/pulsecore/parseaddr.c
+++ b/src/pulsecore/parseaddr.c
@@ -27,7 +27,6 @@
#include <stdlib.h>
#include <pulse/xmalloc.h>
-#include <pulse/util.h>
#include <pulsecore/core-util.h>
#include <pulsecore/macro.h>
diff --git a/src/pulsecore/pid.c b/src/pulsecore/pid.c
index cb500779..50968dea 100644
--- a/src/pulsecore/pid.c
+++ b/src/pulsecore/pid.c
@@ -40,7 +40,6 @@
#endif
#include <pulse/xmalloc.h>
-#include <pulse/util.h>
#include <pulsecore/core-error.h>
#include <pulsecore/core-util.h>
diff --git a/src/pulsecore/play-memblockq.c b/src/pulsecore/play-memblockq.c
index 9455340d..b0932612 100644
--- a/src/pulsecore/play-memblockq.c
+++ b/src/pulsecore/play-memblockq.c
@@ -25,14 +25,11 @@
#include <stdlib.h>
#include <stdio.h>
-#include <string.h>
#include <pulse/xmalloc.h>
-#include <pulse/gccmacro.h>
#include <pulsecore/sink-input.h>
#include <pulsecore/thread-mq.h>
-#include <pulsecore/sample-util.h>
#include "play-memblockq.h"
diff --git a/src/pulsecore/play-memchunk.c b/src/pulsecore/play-memchunk.c
index 6fb89021..ee25958f 100644
--- a/src/pulsecore/play-memchunk.c
+++ b/src/pulsecore/play-memchunk.c
@@ -25,13 +25,8 @@
#include <stdlib.h>
#include <stdio.h>
-#include <string.h>
-
-#include <pulse/xmalloc.h>
-#include <pulse/gccmacro.h>
#include <pulsecore/sink-input.h>
-#include <pulsecore/thread-mq.h>
#include <pulsecore/play-memblockq.h>
#include "play-memchunk.h"
diff --git a/src/pulsecore/prioq.h b/src/pulsecore/prioq.h
index fd3550b7..4df5e04b 100644
--- a/src/pulsecore/prioq.h
+++ b/src/pulsecore/prioq.h
@@ -22,8 +22,6 @@
USA.
***/
-#include <inttypes.h>
-
#include <pulsecore/macro.h>
#include <pulsecore/idxset.h>
diff --git a/src/pulsecore/protocol-esound.c b/src/pulsecore/protocol-esound.c
index 484821c5..95355bf6 100644
--- a/src/pulsecore/protocol-esound.c
+++ b/src/pulsecore/protocol-esound.c
@@ -28,7 +28,6 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include <limits.h>
#include <pulse/rtclock.h>
#include <pulse/sample.h>
@@ -46,7 +45,6 @@
#include <pulsecore/source.h>
#include <pulsecore/core-scache.h>
#include <pulsecore/sample-util.h>
-#include <pulsecore/authkey.h>
#include <pulsecore/namereg.h>
#include <pulsecore/log.h>
#include <pulsecore/core-util.h>
diff --git a/src/pulsecore/protocol-http.c b/src/pulsecore/protocol-http.c
index 1de04345..d085e618 100644
--- a/src/pulsecore/protocol-http.c
+++ b/src/pulsecore/protocol-http.c
@@ -32,6 +32,7 @@
#include <pulse/xmalloc.h>
#include <pulse/timeval.h>
+#include <pulsecore/core-util.h>
#include <pulsecore/ioline.h>
#include <pulsecore/thread-mq.h>
#include <pulsecore/macro.h>
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 6c7c8979..6b981754 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -46,7 +46,6 @@
#include <pulsecore/tagstruct.h>
#include <pulsecore/pdispatch.h>
#include <pulsecore/pstream-util.h>
-#include <pulsecore/authkey.h>
#include <pulsecore/namereg.h>
#include <pulsecore/core-scache.h>
#include <pulsecore/core-subscribe.h>
@@ -54,7 +53,6 @@
#include <pulsecore/strlist.h>
#include <pulsecore/shared.h>
#include <pulsecore/sample-util.h>
-#include <pulsecore/llist.h>
#include <pulsecore/creds.h>
#include <pulsecore/core-util.h>
#include <pulsecore/ipacl.h>
diff --git a/src/pulsecore/protocol-simple.c b/src/pulsecore/protocol-simple.c
index 41a3cc5c..6def27fd 100644
--- a/src/pulsecore/protocol-simple.c
+++ b/src/pulsecore/protocol-simple.c
@@ -24,10 +24,8 @@
#endif
#include <stdlib.h>
-#include <limits.h>
#include <stdio.h>
#include <errno.h>
-#include <string.h>
#include <pulse/xmalloc.h>
#include <pulse/timeval.h>
diff --git a/src/pulsecore/pstream.c b/src/pulsecore/pstream.c
index 369e22ca..3e59fc45 100644
--- a/src/pulsecore/pstream.c
+++ b/src/pulsecore/pstream.c
@@ -28,9 +28,6 @@
#include <stdlib.h>
#include <unistd.h>
-#ifdef HAVE_SYS_UN_H
-#include <sys/un.h>
-#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
diff --git a/src/pulsecore/random.c b/src/pulsecore/random.c
index bdbc1437..1bd69c2d 100644
--- a/src/pulsecore/random.c
+++ b/src/pulsecore/random.c
@@ -27,7 +27,6 @@
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
-#include <string.h>
#include <stdlib.h>
#include <time.h>
diff --git a/src/pulsecore/remap_mmx.c b/src/pulsecore/remap_mmx.c
index 37d72da7..9a69ada4 100644
--- a/src/pulsecore/remap_mmx.c
+++ b/src/pulsecore/remap_mmx.c
@@ -24,8 +24,6 @@
#include <config.h>
#endif
-#include <string.h>
-
#include <pulse/sample.h>
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
diff --git a/src/pulsecore/remap_sse.c b/src/pulsecore/remap_sse.c
index e1cb161d..8344a275 100644
--- a/src/pulsecore/remap_sse.c
+++ b/src/pulsecore/remap_sse.c
@@ -24,8 +24,6 @@
#include <config.h>
#endif
-#include <string.h>
-
#include <pulse/sample.h>
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
diff --git a/src/pulsecore/rtpoll.c b/src/pulsecore/rtpoll.c
index a5e990f6..d90c996c 100644
--- a/src/pulsecore/rtpoll.c
+++ b/src/pulsecore/rtpoll.c
@@ -26,7 +26,6 @@
#include <sys/types.h>
#include <stdio.h>
-#include <signal.h>
#include <string.h>
#include <errno.h>
diff --git a/src/pulsecore/sample-util.c b/src/pulsecore/sample-util.c
index 62b7c468..8a13495c 100644
--- a/src/pulsecore/sample-util.c
+++ b/src/pulsecore/sample-util.c
@@ -29,6 +29,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
+#include <math.h>
#include <pulse/timeval.h>
diff --git a/src/pulsecore/sample-util.h b/src/pulsecore/sample-util.h
index d0235d60..cf79d433 100644
--- a/src/pulsecore/sample-util.h
+++ b/src/pulsecore/sample-util.h
@@ -23,9 +23,11 @@
USA.
***/
+#include <pulse/gccmacro.h>
#include <pulse/sample.h>
#include <pulse/volume.h>
#include <pulse/channelmap.h>
+
#include <pulsecore/memblock.h>
#include <pulsecore/memchunk.h>
diff --git a/src/pulsecore/sconv-s16le.c b/src/pulsecore/sconv-s16le.c
index 43587f3e..138e4185 100644
--- a/src/pulsecore/sconv-s16le.c
+++ b/src/pulsecore/sconv-s16le.c
@@ -27,10 +27,10 @@
#include <inttypes.h>
#include <stdio.h>
+#include <math.h>
#include <pulsecore/sconv.h>
#include <pulsecore/macro.h>
-#include <pulsecore/log.h>
#include <pulsecore/endianmacros.h>
#include "sconv-s16le.h"
diff --git a/src/pulsecore/sconv.c b/src/pulsecore/sconv.c
index 988d4b33..f0f154f5 100644
--- a/src/pulsecore/sconv.c
+++ b/src/pulsecore/sconv.c
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <math.h>
#include <pulsecore/g711.h>
#include <pulsecore/macro.h>
diff --git a/src/pulsecore/sconv.h b/src/pulsecore/sconv.h
index cd937559..204887f3 100644
--- a/src/pulsecore/sconv.h
+++ b/src/pulsecore/sconv.h
@@ -23,6 +23,7 @@
USA.
***/
+#include <pulse/gccmacro.h>
#include <pulse/sample.h>
typedef void (*pa_convert_func_t)(unsigned n, const void *a, void *b);
diff --git a/src/pulsecore/sconv_sse.c b/src/pulsecore/sconv_sse.c
index 26daa223..ac99bf67 100644
--- a/src/pulsecore/sconv_sse.c
+++ b/src/pulsecore/sconv_sse.c
@@ -27,7 +27,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <pulsecore/g711.h>
#include <pulsecore/macro.h>
#include <pulsecore/endianmacros.h>
diff --git a/src/pulsecore/shared.c b/src/pulsecore/shared.c
index edd7b7fe..368a6c3d 100644
--- a/src/pulsecore/shared.c
+++ b/src/pulsecore/shared.c
@@ -24,7 +24,6 @@
#endif
#include <pulse/xmalloc.h>
-#include <pulsecore/log.h>
#include <pulsecore/macro.h>
#include "shared.h"
diff --git a/src/pulsecore/shmasyncq.h b/src/pulsecore/shmasyncq.h
index 9845c391..4212055e 100644
--- a/src/pulsecore/shmasyncq.h
+++ b/src/pulsecore/shmasyncq.h
@@ -24,7 +24,6 @@
#include <sys/types.h>
-#include <pulse/def.h>
#include <pulsecore/macro.h>
/* Similar to pa_asyncq, but stores data in a shared memory segment */
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 2e718c45..d386b005 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -26,7 +26,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <pulse/utf8.h>
#include <pulse/xmalloc.h>
diff --git a/src/pulsecore/sink.h b/src/pulsecore/sink.h
index cbff5cae..85c22ec6 100644
--- a/src/pulsecore/sink.h
+++ b/src/pulsecore/sink.h
@@ -36,9 +36,10 @@ typedef struct pa_sink_volume_change pa_sink_volume_change;
#include <pulsecore/core.h>
#include <pulsecore/idxset.h>
+#include <pulsecore/memchunk.h>
#include <pulsecore/source.h>
#include <pulsecore/module.h>
-#include <pulsecore/refcnt.h>
+#include <pulsecore/asyncmsgq.h>
#include <pulsecore/msgobject.h>
#include <pulsecore/rtpoll.h>
#include <pulsecore/card.h>
diff --git a/src/pulsecore/sndfile-util.c b/src/pulsecore/sndfile-util.c
index 292eb6e8..85d7a1c4 100644
--- a/src/pulsecore/sndfile-util.c
+++ b/src/pulsecore/sndfile-util.c
@@ -29,7 +29,6 @@
#include <pulse/utf8.h>
#include <pulsecore/macro.h>
-#include <pulsecore/core-util.h>
#include "sndfile-util.h"
diff --git a/src/pulsecore/socket-util.c b/src/pulsecore/socket-util.c
index 3023395c..46623c4d 100644
--- a/src/pulsecore/socket-util.c
+++ b/src/pulsecore/socket-util.c
@@ -25,14 +25,12 @@
#include <config.h>
#endif
-#include <stdarg.h>
#include <stdlib.h>
#include <signal.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
-#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
@@ -55,8 +53,6 @@
#include <netdb.h>
#endif
-#include <pulse/xmalloc.h>
-
#include <pulsecore/core-error.h>
#include <pulsecore/core-util.h>
#include <pulsecore/log.h>
diff --git a/src/pulsecore/sound-file-stream.c b/src/pulsecore/sound-file-stream.c
index d33eca5a..96b5fb82 100644
--- a/src/pulsecore/sound-file-stream.c
+++ b/src/pulsecore/sound-file-stream.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include <stdio.h>
-#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
@@ -40,7 +39,6 @@
#include <pulsecore/log.h>
#include <pulsecore/thread-mq.h>
#include <pulsecore/core-util.h>
-#include <pulsecore/sample-util.h>
#include <pulsecore/sndfile-util.h>
#include "sound-file-stream.h"
diff --git a/src/pulsecore/sound-file.c b/src/pulsecore/sound-file.c
index d8c10b1e..3db0981f 100644
--- a/src/pulsecore/sound-file.c
+++ b/src/pulsecore/sound-file.c
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 78a52036..70248026 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -26,7 +26,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <pulse/utf8.h>
#include <pulse/xmalloc.h>
diff --git a/src/pulsecore/source.h b/src/pulsecore/source.h
index 902cc036..b68dfd59 100644
--- a/src/pulsecore/source.h
+++ b/src/pulsecore/source.h
@@ -28,23 +28,23 @@ typedef struct pa_source_volume_change pa_source_volume_change;
#include <inttypes.h>
+#include <pulse/def.h>
#include <pulse/sample.h>
#include <pulse/channelmap.h>
#include <pulse/volume.h>
#include <pulsecore/core.h>
#include <pulsecore/idxset.h>
-#include <pulsecore/memblock.h>
#include <pulsecore/memchunk.h>
#include <pulsecore/sink.h>
#include <pulsecore/module.h>
#include <pulsecore/asyncmsgq.h>
#include <pulsecore/msgobject.h>
#include <pulsecore/rtpoll.h>
-#include <pulsecore/source-output.h>
#include <pulsecore/card.h>
#include <pulsecore/queue.h>
#include <pulsecore/thread-mq.h>
+#include <pulsecore/source-output.h>
#define PA_MAX_OUTPUTS_PER_SOURCE 32
diff --git a/src/pulsecore/svolume_arm.c b/src/pulsecore/svolume_arm.c
index 098f10ee..b7797337 100644
--- a/src/pulsecore/svolume_arm.c
+++ b/src/pulsecore/svolume_arm.c
@@ -24,11 +24,8 @@
#include <config.h>
#endif
-#include <pulse/timeval.h>
#include <pulsecore/random.h>
#include <pulsecore/macro.h>
-#include <pulsecore/g711.h>
-#include <pulsecore/core-util.h>
#include <pulsecore/endianmacros.h>
#include "cpu-arm.h"
diff --git a/src/pulsecore/svolume_c.c b/src/pulsecore/svolume_c.c
index e55d0d7b..6c0fbf81 100644
--- a/src/pulsecore/svolume_c.c
+++ b/src/pulsecore/svolume_c.c
@@ -27,7 +27,6 @@
#include <pulsecore/macro.h>
#include <pulsecore/g711.h>
-#include <pulsecore/core-util.h>
#include <pulsecore/endianmacros.h>
#include "sample-util.h"
diff --git a/src/pulsecore/svolume_mmx.c b/src/pulsecore/svolume_mmx.c
index 28bbfdd3..64010810 100644
--- a/src/pulsecore/svolume_mmx.c
+++ b/src/pulsecore/svolume_mmx.c
@@ -24,13 +24,10 @@
#include <config.h>
#endif
-#include <pulse/timeval.h>
#include <pulse/rtclock.h>
#include <pulsecore/random.h>
#include <pulsecore/macro.h>
-#include <pulsecore/g711.h>
-#include <pulsecore/core-util.h>
#include <pulsecore/endianmacros.h>
#include "cpu-x86.h"
diff --git a/src/pulsecore/svolume_orc.c b/src/pulsecore/svolume_orc.c
index 270b2911..8e1e46cf 100644
--- a/src/pulsecore/svolume_orc.c
+++ b/src/pulsecore/svolume_orc.c
@@ -26,7 +26,6 @@
#endif
#include "cpu-orc.h"
-#include <pulse/xmalloc.h>
#include <pulse/rtclock.h>
#include <pulsecore/sample-util.h>
#include <pulsecore/random.h>
diff --git a/src/pulsecore/svolume_sse.c b/src/pulsecore/svolume_sse.c
index dcd71c4b..f713761a 100644
--- a/src/pulsecore/svolume_sse.c
+++ b/src/pulsecore/svolume_sse.c
@@ -24,13 +24,10 @@
#include <config.h>
#endif
-#include <pulse/timeval.h>
#include <pulse/rtclock.h>
#include <pulsecore/random.h>
#include <pulsecore/macro.h>
-#include <pulsecore/g711.h>
-#include <pulsecore/core-util.h>
#include <pulsecore/endianmacros.h>
#include "cpu-x86.h"
diff --git a/src/pulsecore/tagstruct.h b/src/pulsecore/tagstruct.h
index 0091eeb9..5f729bc6 100644
--- a/src/pulsecore/tagstruct.h
+++ b/src/pulsecore/tagstruct.h
@@ -31,7 +31,6 @@
#include <pulse/channelmap.h>
#include <pulse/volume.h>
#include <pulse/proplist.h>
-#include <pulse/gccmacro.h>
#include <pulsecore/macro.h>
diff --git a/src/pulsecore/thread-mq.c b/src/pulsecore/thread-mq.c
index 73997a74..51fb765b 100644
--- a/src/pulsecore/thread-mq.c
+++ b/src/pulsecore/thread-mq.c
@@ -26,16 +26,9 @@
#include <unistd.h>
#include <errno.h>
-#include <pulse/xmalloc.h>
-
-#include <pulsecore/atomic.h>
-#include <pulsecore/once.h>
-#include <pulsecore/log.h>
#include <pulsecore/thread.h>
#include <pulsecore/semaphore.h>
#include <pulsecore/macro.h>
-#include <pulsecore/core-util.h>
-#include <pulsecore/flist.h>
#include "thread-mq.h"
diff --git a/src/pulsecore/thread-posix.c b/src/pulsecore/thread-posix.c
index 58bcb72a..3f4ae5c6 100644
--- a/src/pulsecore/thread-posix.c
+++ b/src/pulsecore/thread-posix.c
@@ -33,8 +33,6 @@
#endif
#include <pulse/xmalloc.h>
-#include <pulsecore/mutex.h>
-#include <pulsecore/once.h>
#include <pulsecore/atomic.h>
#include <pulsecore/macro.h>
diff --git a/src/pulsecore/thread-win32.c b/src/pulsecore/thread-win32.c
index 7d458b97..e0839af8 100644
--- a/src/pulsecore/thread-win32.c
+++ b/src/pulsecore/thread-win32.c
@@ -28,7 +28,6 @@
#include <windows.h>
#include <pulse/xmalloc.h>
-#include <pulsecore/log.h>
#include <pulsecore/once.h>
#include "thread.h"
diff --git a/src/pulsecore/thread.h b/src/pulsecore/thread.h
index 79b61ae0..9cabb899 100644
--- a/src/pulsecore/thread.h
+++ b/src/pulsecore/thread.h
@@ -24,6 +24,8 @@
***/
#include <pulse/def.h>
+#include <pulse/gccmacro.h>
+
#include <pulsecore/once.h>
#include <pulsecore/core-util.h>
diff --git a/src/pulsecore/time-smoother.c b/src/pulsecore/time-smoother.c
index a8dd333f..be054a5f 100644
--- a/src/pulsecore/time-smoother.c
+++ b/src/pulsecore/time-smoother.c
@@ -24,6 +24,7 @@
#endif
#include <stdio.h>
+#include <math.h>
#include <pulse/sample.h>
#include <pulse/xmalloc.h>
diff --git a/src/pulsecore/tokenizer.c b/src/pulsecore/tokenizer.c
index 1eb466dd..a0ade697 100644
--- a/src/pulsecore/tokenizer.c
+++ b/src/pulsecore/tokenizer.c
@@ -27,7 +27,6 @@
#include <stdlib.h>
#include <pulse/xmalloc.h>
-#include <pulse/gccmacro.h>
#include <pulsecore/dynarray.h>
#include <pulsecore/macro.h>
diff --git a/src/tests/asyncmsgq-test.c b/src/tests/asyncmsgq-test.c
index 94bfcea1..96e5a0df 100644
--- a/src/tests/asyncmsgq-test.c
+++ b/src/tests/asyncmsgq-test.c
@@ -25,12 +25,9 @@
#include <stdlib.h>
#include <unistd.h>
-#include <pulse/util.h>
-#include <pulse/xmalloc.h>
#include <pulsecore/asyncmsgq.h>
#include <pulsecore/thread.h>
#include <pulsecore/log.h>
-#include <pulsecore/core-util.h>
#include <pulsecore/macro.h>
enum {
diff --git a/src/tests/asyncq-test.c b/src/tests/asyncq-test.c
index eae8cce9..46bac9f4 100644
--- a/src/tests/asyncq-test.c
+++ b/src/tests/asyncq-test.c
@@ -26,11 +26,9 @@
#include <unistd.h>
#include <pulse/util.h>
-#include <pulse/xmalloc.h>
#include <pulsecore/asyncq.h>
#include <pulsecore/thread.h>
#include <pulsecore/log.h>
-#include <pulsecore/core-util.h>
#include <pulsecore/macro.h>
static void producer(void *_q) {
diff --git a/src/tests/channelmap-test.c b/src/tests/channelmap-test.c
index 6cf58fb0..70d6a6a9 100644
--- a/src/tests/channelmap-test.c
+++ b/src/tests/channelmap-test.c
@@ -6,7 +6,6 @@
#include <assert.h>
#include <pulse/channelmap.h>
-#include <pulse/gccmacro.h>
int main(int argc, char *argv[]) {
char cm[PA_CHANNEL_MAP_SNPRINT_MAX];
diff --git a/src/tests/cpulimit-test.c b/src/tests/cpulimit-test.c
index 5b11bc44..8bd03417 100644
--- a/src/tests/cpulimit-test.c
+++ b/src/tests/cpulimit-test.c
@@ -28,7 +28,6 @@
#include <signal.h>
#include <pulse/mainloop.h>
-#include <pulse/gccmacro.h>
#ifdef TEST2
#include <pulse/mainloop-signal.h>
diff --git a/src/tests/extended-test.c b/src/tests/extended-test.c
index ab8ab2c0..631fdc89 100644
--- a/src/tests/extended-test.c
+++ b/src/tests/extended-test.c
@@ -22,13 +22,11 @@
#endif
#include <signal.h>
-#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
-#include <getopt.h>
#include <math.h>
#include <pulse/pulseaudio.h>
diff --git a/src/tests/get-binary-name-test.c b/src/tests/get-binary-name-test.c
index e49f2eff..4afe81b3 100644
--- a/src/tests/get-binary-name-test.c
+++ b/src/tests/get-binary-name-test.c
@@ -21,7 +21,6 @@
#include <config.h>
#endif
-#include <limits.h>
#include <stdio.h>
#include <string.h>
diff --git a/src/tests/interpol-test.c b/src/tests/interpol-test.c
index ca5c50b9..ffe4ab38 100644
--- a/src/tests/interpol-test.c
+++ b/src/tests/interpol-test.c
@@ -28,7 +28,6 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
-#include <math.h>
#include <pulse/pulseaudio.h>
#include <pulse/mainloop.h>
diff --git a/src/tests/mainloop-test.c b/src/tests/mainloop-test.c
index cd54bcfe..ab23de43 100644
--- a/src/tests/mainloop-test.c
+++ b/src/tests/mainloop-test.c
@@ -28,7 +28,6 @@
#include <pulse/rtclock.h>
#include <pulse/timeval.h>
-#include <pulse/gccmacro.h>
#include <pulsecore/core-util.h>
#include <pulsecore/core-rtclock.h>
diff --git a/src/tests/mcalign-test.c b/src/tests/mcalign-test.c
index 92e3e14e..75a71dd1 100644
--- a/src/tests/mcalign-test.c
+++ b/src/tests/mcalign-test.c
@@ -29,8 +29,6 @@
#include <stdlib.h>
#include <time.h>
-#include <pulse/gccmacro.h>
-
#include <pulsecore/core-util.h>
#include <pulsecore/mcalign.h>
diff --git a/src/tests/mix-test.c b/src/tests/mix-test.c
index 55844e7f..7c05b8ed 100644
--- a/src/tests/mix-test.c
+++ b/src/tests/mix-test.c
@@ -26,7 +26,6 @@
#include <pulse/sample.h>
#include <pulse/volume.h>
-#include <pulsecore/resampler.h>
#include <pulsecore/macro.h>
#include <pulsecore/endianmacros.h>
#include <pulsecore/memblock.h>
diff --git a/src/tests/once-test.c b/src/tests/once-test.c
index 86a12479..13791688 100644
--- a/src/tests/once-test.c
+++ b/src/tests/once-test.c
@@ -24,11 +24,9 @@
#include <pthread.h>
#include <pulsecore/thread.h>
-#include <pulsecore/mutex.h>
#include <pulsecore/once.h>
#include <pulsecore/log.h>
#include <pulsecore/core-util.h>
-#include <pulsecore/core-error.h>
#include <pulsecore/atomic.h>
#include <pulse/xmalloc.h>
diff --git a/src/tests/pacat-simple.c b/src/tests/pacat-simple.c
index d4224e11..7d119c44 100644
--- a/src/tests/pacat-simple.c
+++ b/src/tests/pacat-simple.c
@@ -29,7 +29,6 @@
#include <pulse/simple.h>
#include <pulse/error.h>
-#include <pulse/gccmacro.h>
#define BUFSIZE 1024
diff --git a/src/tests/parec-simple.c b/src/tests/parec-simple.c
index 9f19ff47..dfa43f0f 100644
--- a/src/tests/parec-simple.c
+++ b/src/tests/parec-simple.c
@@ -28,7 +28,6 @@
#include <pulse/simple.h>
#include <pulse/error.h>
-#include <pulse/gccmacro.h>
#define BUFSIZE 1024
diff --git a/src/tests/queue-test.c b/src/tests/queue-test.c
index 7ee2693d..b21775e8 100644
--- a/src/tests/queue-test.c
+++ b/src/tests/queue-test.c
@@ -25,11 +25,8 @@
#include <stdlib.h>
#include <unistd.h>
-#include <pulse/util.h>
-#include <pulse/xmalloc.h>
#include <pulsecore/queue.h>
#include <pulsecore/log.h>
-#include <pulsecore/core-util.h>
#include <pulsecore/macro.h>
int main(int argc, char *argv[]) {
diff --git a/src/tests/remix-test.c b/src/tests/remix-test.c
index 4990bf93..19f5582b 100644
--- a/src/tests/remix-test.c
+++ b/src/tests/remix-test.c
@@ -24,13 +24,10 @@
#include <stdio.h>
#include <pulse/sample.h>
-#include <pulse/volume.h>
#include <pulsecore/resampler.h>
#include <pulsecore/macro.h>
-#include <pulsecore/endianmacros.h>
#include <pulsecore/memblock.h>
-#include <pulsecore/sample-util.h>
int main(int argc, char *argv[]) {
diff --git a/src/tests/resampler-test.c b/src/tests/resampler-test.c
index 097465ad..78461da5 100644
--- a/src/tests/resampler-test.c
+++ b/src/tests/resampler-test.c
@@ -37,7 +37,6 @@
#include <pulsecore/endianmacros.h>
#include <pulsecore/memblock.h>
#include <pulsecore/sample-util.h>
-#include <pulsecore/core-rtclock.h>
#include <pulsecore/core-util.h>
static void dump_block(const pa_sample_spec *ss, const pa_memchunk *chunk) {
diff --git a/src/tests/rtstutter.c b/src/tests/rtstutter.c
index 402a8c09..739683d5 100644
--- a/src/tests/rtstutter.c
+++ b/src/tests/rtstutter.c
@@ -27,7 +27,6 @@
#include <unistd.h>
#include <time.h>
#include <inttypes.h>
-#include <string.h>
#ifdef HAVE_PTHREAD
#include <pthread.h>
diff --git a/src/tests/strlist-test.c b/src/tests/strlist-test.c
index 10f370c2..86f4f075 100644
--- a/src/tests/strlist-test.c
+++ b/src/tests/strlist-test.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <pulse/xmalloc.h>
-#include <pulse/gccmacro.h>
#include <pulsecore/strlist.h>
diff --git a/src/tests/sync-playback.c b/src/tests/sync-playback.c
index bb64a91f..8eaa25fe 100644
--- a/src/tests/sync-playback.c
+++ b/src/tests/sync-playback.c
@@ -22,13 +22,11 @@
#endif
#include <signal.h>
-#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
-#include <getopt.h>
#include <math.h>
#include <pulse/pulseaudio.h>
diff --git a/src/tests/thread-mainloop-test.c b/src/tests/thread-mainloop-test.c
index 4696fb01..72275972 100644
--- a/src/tests/thread-mainloop-test.c
+++ b/src/tests/thread-mainloop-test.c
@@ -29,7 +29,6 @@
#include <pulse/timeval.h>
#include <pulse/util.h>
#include <pulse/thread-mainloop.h>
-#include <pulse/gccmacro.h>
#include <pulsecore/macro.h>
#include <pulsecore/core-rtclock.h>
diff --git a/src/tests/voltest.c b/src/tests/voltest.c
index 551f7ecd..ece86f85 100644
--- a/src/tests/voltest.c
+++ b/src/tests/voltest.c
@@ -22,9 +22,9 @@
#endif
#include <stdio.h>
+#include <math.h>
#include <pulse/volume.h>
-#include <pulse/gccmacro.h>
#include <pulsecore/macro.h>
diff --git a/src/utils/pabrowse.c b/src/utils/pabrowse.c
index a349e414..a00fb4d3 100644
--- a/src/utils/pabrowse.c
+++ b/src/utils/pabrowse.c
@@ -29,7 +29,6 @@
#include <pulse/browser.h>
#include <pulse/pulseaudio.h>
-#include <pulse/rtclock.h>
#include <pulsecore/core-util.h>
diff --git a/src/utils/pacmd.c b/src/utils/pacmd.c
index 4d07c4c2..f0779802 100644
--- a/src/utils/pacmd.c
+++ b/src/utils/pacmd.c
@@ -32,7 +32,6 @@
#include <sys/un.h>
#include <locale.h>
-#include <pulse/error.h>
#include <pulse/util.h>
#include <pulse/xmalloc.h>
#include <pulse/i18n.h>
diff --git a/src/utils/pactl.c b/src/utils/pactl.c
index a9d4c824..e6f9c175 100644
--- a/src/utils/pactl.c
+++ b/src/utils/pactl.c
@@ -30,7 +30,6 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
-#include <limits.h>
#include <getopt.h>
#include <locale.h>
diff --git a/src/utils/pasuspender.c b/src/utils/pasuspender.c
index 534b77b4..e1ee2512 100644
--- a/src/utils/pasuspender.c
+++ b/src/utils/pasuspender.c
@@ -33,7 +33,6 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
-#include <limits.h>
#include <getopt.h>
#include <locale.h>
diff --git a/src/utils/pax11publish.c b/src/utils/pax11publish.c
index 6600363b..41361a15 100644
--- a/src/utils/pax11publish.c
+++ b/src/utils/pax11publish.c
@@ -25,7 +25,6 @@
#include <stdio.h>
#include <getopt.h>
-#include <string.h>
#include <assert.h>
#include <locale.h>