Skip to content

Commit

Permalink
util: Clean up includes
Browse files Browse the repository at this point in the history
Clean up includes so that osdep.h is included first and headers
which it implies are not included manually.

This commit was created with scripts/clean-includes.

Signed-off-by: Peter Maydell <[email protected]>
Message-id: [email protected]
  • Loading branch information
pm215 committed Feb 4, 2016
1 parent 9c05833 commit aafd758
Show file tree
Hide file tree
Showing 50 changed files with 50 additions and 72 deletions.
1 change: 1 addition & 0 deletions util/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/


#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/acl.h"

Expand Down
1 change: 1 addition & 0 deletions util/base64.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*
*/

#include "qemu/osdep.h"
#include <config-host.h>

#include "qemu/base64.h"
Expand Down
1 change: 1 addition & 0 deletions util/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Version 2.
*/

#include "qemu/osdep.h"
#include "qemu/bitops.h"
#include "qemu/bitmap.h"
#include "qemu/atomic.h"
Expand Down
1 change: 1 addition & 0 deletions util/bitops.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* 2 of the License, or (at your option) any later version.
*/

#include "qemu/osdep.h"
#include "qemu/bitops.h"

#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
Expand Down
1 change: 1 addition & 0 deletions util/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*
*/

#include "qemu/osdep.h"
#include "qemu/buffer.h"
#include "trace.h"

Expand Down
1 change: 1 addition & 0 deletions util/compatfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* GNU GPL, version 2 or (at your option) any later version.
*/

#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/compatfd.h"
#include "qemu/thread.h"
Expand Down
1 change: 1 addition & 0 deletions util/coroutine-gthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/

#include "qemu/osdep.h"
#include <glib.h>
#include "qemu-common.h"
#include "qemu/coroutine_int.h"
Expand Down
4 changes: 1 addition & 3 deletions util/coroutine-sigaltstack.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@
#ifdef _FORTIFY_SOURCE
#undef _FORTIFY_SOURCE
#endif
#include <stdlib.h>
#include "qemu/osdep.h"
#include <setjmp.h>
#include <stdint.h>
#include <pthread.h>
#include <signal.h>
#include "qemu-common.h"
#include "qemu/coroutine_int.h"

Expand Down
3 changes: 1 addition & 2 deletions util/coroutine-ucontext.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
#ifdef _FORTIFY_SOURCE
#undef _FORTIFY_SOURCE
#endif
#include <stdlib.h>
#include "qemu/osdep.h"
#include <setjmp.h>
#include <stdint.h>
#include <ucontext.h>
#include "qemu-common.h"
#include "qemu/coroutine_int.h"
Expand Down
1 change: 1 addition & 0 deletions util/coroutine-win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* THE SOFTWARE.
*/

#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/coroutine_int.h"

Expand Down
1 change: 1 addition & 0 deletions util/crc32c.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*
*/

#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/crc32c.h"

Expand Down
3 changes: 1 addition & 2 deletions util/cutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/host-utils.h"
#include <math.h>
#include <limits.h>
#include <errno.h>

#include "qemu/sockets.h"
#include "qemu/iov.h"
Expand Down
1 change: 1 addition & 0 deletions util/envlist.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/queue.h"
#include "qemu/envlist.h"
Expand Down
2 changes: 1 addition & 1 deletion util/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* the COPYING.LIB file in the top-level directory.
*/

#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qapi/error.h"
#include "qemu/error-report.h"

struct Error
Expand Down
1 change: 1 addition & 0 deletions util/event_notifier-posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* See the COPYING file in the top-level directory.
*/

#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/event_notifier.h"
#include "sysemu/char.h"
Expand Down
1 change: 1 addition & 0 deletions util/event_notifier-win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* See the COPYING file in the top-level directory.
*/

#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/event_notifier.h"
#include "qemu/main-loop.h"
Expand Down
1 change: 1 addition & 0 deletions util/fifo8.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* with this program; if not, see <http://www.gnu.org/licenses/>.
*/

#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/fifo8.h"

Expand Down
2 changes: 1 addition & 1 deletion util/getauxval.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* THE SOFTWARE.
*/

#include "qemu-common.h"
#include "qemu/osdep.h"
#include "qemu-common.h"

#ifdef CONFIG_GETAUXVAL
/* Don't inline this in qemu/osdep.h, because pulling in <sys/auxv.h> for
Expand Down
4 changes: 1 addition & 3 deletions util/hbitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
* later. See the COPYING file in the top-level directory.
*/

#include <string.h>
#include <glib.h>
#include <assert.h>
#include "qemu/osdep.h"
#include <glib.h>
#include "qemu/hbitmap.h"
#include "qemu/host-utils.h"
#include "trace.h"
Expand Down
1 change: 1 addition & 0 deletions util/hexdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* GNU GPL, version 2 or (at your option) any later version.
*/

#include "qemu/osdep.h"
#include "qemu-common.h"

void qemu_hexdump(const char *buf, FILE *fp, const char *prefix, size_t size)
Expand Down
3 changes: 1 addition & 2 deletions util/host-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
* THE SOFTWARE.
*/

#include <stdlib.h>
#include <stdint.h>
#include "qemu/osdep.h"
#include "qemu/host-utils.h"

/* Long integer helpers */
Expand Down
1 change: 1 addition & 0 deletions util/id.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* or later. See the COPYING.LIB file in the top-level directory.
*/

#include "qemu/osdep.h"
#include "qemu-common.h"

bool id_wellformed(const char *id)
Expand Down
1 change: 1 addition & 0 deletions util/iov.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* GNU GPL, version 2 or (at your option) any later version.
*/

#include "qemu/osdep.h"
#include "qemu/iov.h"
#include "qemu/sockets.h"

Expand Down
3 changes: 1 addition & 2 deletions util/mmap-alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
* This work is licensed under the terms of the GNU GPL, version 2 or
* later. See the COPYING file in the top-level directory.
*/
#include "qemu/osdep.h"
#include <qemu/mmap-alloc.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <assert.h>

#define HUGETLBFS_MAGIC 0x958458f6

Expand Down
2 changes: 1 addition & 1 deletion util/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* GNU GPL, version 2 or (at your option) any later version.
*/

#include <stdlib.h>
#include "qemu/osdep.h"
#include "qemu-common.h"
#ifdef CONFIG_MODULES
#include <gmodule.h>
Expand Down
1 change: 1 addition & 0 deletions util/notify.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* GNU GPL, version 2 or (at your option) any later version.
*/

#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/notify.h"

Expand Down
11 changes: 1 addition & 10 deletions util/osdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,15 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdbool.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include "qemu/osdep.h"

/* Needed early for CONFIG_BSD etc. */
#include "config-host.h"

#if defined(CONFIG_MADVISE) || defined(CONFIG_POSIX_MADVISE)
#include <sys/mman.h>
#endif

#ifdef CONFIG_SOLARIS
#include <sys/types.h>
#include <sys/statvfs.h>
/* See MySQL bug #7156 (http://bugs.mysql.com/bug.php?id=7156) for
discussion about Solaris header problems */
Expand Down
3 changes: 1 addition & 2 deletions util/oslib-posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,12 @@ extern int daemon(int, int);
# define QEMU_VMALLOC_ALIGN getpagesize()
#endif

#include "qemu/osdep.h"
#include <termios.h>
#include <unistd.h>
#include <termios.h>

#include <glib/gprintf.h>

#include "config-host.h"
#include "sysemu/sysemu.h"
#include "trace.h"
#include "qemu/sockets.h"
Expand Down
3 changes: 1 addition & 2 deletions util/oslib-win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@
* this file are based on code from GNOME glib-2 and use a different license,
* see the license comment there.
*/
#include "qemu/osdep.h"
#include <windows.h>
#include <glib.h>
#include <stdlib.h>
#include "config-host.h"
#include "sysemu/sysemu.h"
#include "qemu/main-loop.h"
#include "trace.h"
Expand Down
7 changes: 1 addition & 6 deletions util/path.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@
The assumption is that this area does not change.
*/
#include <sys/types.h>
#include "qemu/osdep.h"
#include <sys/param.h>
#include <dirent.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>
#include "qemu-common.h"

struct pathelem
Expand Down
2 changes: 1 addition & 1 deletion util/qemu-config.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/error-report.h"
#include "qemu/option.h"
#include "qemu/config-file.h"
#include "qapi/error.h"
#include "qmp-commands.h"

static QemuOptsList *vm_config_groups[48];
Expand Down
1 change: 1 addition & 0 deletions util/qemu-coroutine-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/sockets.h"
#include "qemu/coroutine.h"
Expand Down
1 change: 1 addition & 0 deletions util/qemu-coroutine-lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* THE SOFTWARE.
*/

#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/coroutine.h"
#include "qemu/coroutine_int.h"
Expand Down
1 change: 1 addition & 0 deletions util/qemu-coroutine-sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*
*/

#include "qemu/osdep.h"
#include "qemu/coroutine.h"
#include "qemu/timer.h"
#include "block/aio.h"
Expand Down
1 change: 1 addition & 0 deletions util/qemu-coroutine.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*
*/

#include "qemu/osdep.h"
#include "trace.h"
#include "qemu-common.h"
#include "qemu/thread.h"
Expand Down
2 changes: 1 addition & 1 deletion util/qemu-error.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* See the COPYING file in the top-level directory.
*/

#include <stdio.h>
#include "qemu/osdep.h"
#include "monitor/monitor.h"
#include "qemu/error-report.h"

Expand Down
2 changes: 1 addition & 1 deletion util/qemu-openpty.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* linked with -lutil.
*/

#include "config-host.h"
#include "qemu/osdep.h"
#include "qemu-common.h"

#if defined(__GLIBC__)
Expand Down
4 changes: 1 addition & 3 deletions util/qemu-option.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@
* THE SOFTWARE.
*/

#include <stdio.h>
#include <string.h>
#include "qemu/osdep.h"

#include "qemu-common.h"
#include "qemu/error-report.h"
#include "qapi/qmp/types.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qemu/option_int.h"

Expand Down
3 changes: 1 addition & 2 deletions util/qemu-progress.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
* THE SOFTWARE.
*/

#include "qemu-common.h"
#include "qemu/osdep.h"
#include <stdio.h>
#include "qemu-common.h"

struct progress_state {
float current;
Expand Down
Loading

0 comments on commit aafd758

Please sign in to comment.