From 63b36a2b5b8e04f5d96fa9aa8d212a01c73aad49 Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Mon, 10 Jan 2011 11:20:14 +0100
Subject: Use a central header.
$ time (make clean; make)
Before: ~8.0 seconds
After: ~8.1 seconds
---
CMakeLists.txt | 1 +
src/ld-canvas.c | 12 +-----------
src/ld-diagram-object.c | 5 +----
src/ld-diagram-symbol.c | 6 +-----
src/ld-diagram.c | 7 +------
src/ld-library.c | 11 +----------
src/ld-lua-symbol.c | 11 +----------
src/ld-lua.c | 9 +--------
src/ld-symbol-category.c | 8 +-------
src/ld-symbol.c | 8 +-------
src/ld-types.c | 5 +----
src/ld-window-main.c | 12 +-----------
src/liblogdiag.h | 34 ++++++++++++++++++++++++++++++++++
13 files changed, 46 insertions(+), 83 deletions(-)
create mode 100644 src/liblogdiag.h
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 493904f..75eb11a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -95,6 +95,7 @@ set (logdiag_SOURCES
src/ld-lua-symbol.c)
set (logdiag_HEADERS
${CMAKE_CURRENT_BINARY_DIR}/config.h
+ src/liblogdiag.h
src/ld-marshal.h
src/ld-types.h
src/ld-window-main.h
diff --git a/src/ld-canvas.c b/src/ld-canvas.c
index e41d014..9523d9d 100644
--- a/src/ld-canvas.c
+++ b/src/ld-canvas.c
@@ -10,21 +10,11 @@
#include
#include
-
-#include
#include
+#include "liblogdiag.h"
#include "config.h"
-#include "ld-marshal.h"
-#include "ld-types.h"
-#include "ld-diagram-object.h"
-#include "ld-diagram-symbol.h"
-#include "ld-diagram.h"
-#include "ld-symbol.h"
-#include "ld-library.h"
-#include "ld-canvas.h"
-
/**
* SECTION:ld-canvas
diff --git a/src/ld-diagram-object.c b/src/ld-diagram-object.c
index a9f87ba..f43e620 100644
--- a/src/ld-diagram-object.c
+++ b/src/ld-diagram-object.c
@@ -8,12 +8,9 @@
*
*/
-#include
-
+#include "liblogdiag.h"
#include "config.h"
-#include "ld-diagram-object.h"
-
/**
* SECTION:ld-diagram-object
diff --git a/src/ld-diagram-symbol.c b/src/ld-diagram-symbol.c
index 0310579..3308dbb 100644
--- a/src/ld-diagram-symbol.c
+++ b/src/ld-diagram-symbol.c
@@ -8,13 +8,9 @@
*
*/
-#include
-
+#include "liblogdiag.h"
#include "config.h"
-#include "ld-diagram-object.h"
-#include "ld-diagram-symbol.h"
-
/**
* SECTION:ld-diagram-symbol
diff --git a/src/ld-diagram.c b/src/ld-diagram.c
index 7a6694c..0129e2b 100644
--- a/src/ld-diagram.c
+++ b/src/ld-diagram.c
@@ -8,14 +8,9 @@
*
*/
-#include
-#include
-
+#include "liblogdiag.h"
#include "config.h"
-#include "ld-diagram-object.h"
-#include "ld-diagram.h"
-
/**
* SECTION:ld-diagram
diff --git a/src/ld-library.c b/src/ld-library.c
index adf069d..37e2bc9 100644
--- a/src/ld-library.c
+++ b/src/ld-library.c
@@ -10,18 +10,9 @@
#include
-#include
-#include
-
+#include "liblogdiag.h"
#include "config.h"
-#include "ld-types.h"
-#include "ld-symbol.h"
-#include "ld-symbol-category.h"
-#include "ld-library.h"
-
-#include "ld-lua.h"
-
/**
* SECTION:ld-library
diff --git a/src/ld-lua-symbol.c b/src/ld-lua-symbol.c
index 955bd97..27a6279 100644
--- a/src/ld-lua-symbol.c
+++ b/src/ld-lua-symbol.c
@@ -8,18 +8,9 @@
*
*/
-#include
-
+#include "liblogdiag.h"
#include "config.h"
-#include "ld-types.h"
-#include "ld-symbol.h"
-#include "ld-symbol-category.h"
-#include "ld-library.h"
-
-#include "ld-lua.h"
-#include "ld-lua-symbol.h"
-
#include "ld-lua-private.h"
#include "ld-lua-symbol-private.h"
diff --git a/src/ld-lua.c b/src/ld-lua.c
index 448e25c..47a41b5 100644
--- a/src/ld-lua.c
+++ b/src/ld-lua.c
@@ -8,20 +8,13 @@
*
*/
-#include
#include
#include
#include
+#include "liblogdiag.h"
#include "config.h"
-#include "ld-types.h"
-#include "ld-symbol.h"
-#include "ld-library.h"
-
-#include "ld-lua.h"
-#include "ld-lua-symbol.h"
-
#include "ld-lua-private.h"
#include "ld-lua-symbol-private.h"
diff --git a/src/ld-symbol-category.c b/src/ld-symbol-category.c
index b9d70b1..e4b86a9 100644
--- a/src/ld-symbol-category.c
+++ b/src/ld-symbol-category.c
@@ -8,15 +8,9 @@
*
*/
-#include
-
+#include "liblogdiag.h"
#include "config.h"
-#include "ld-types.h"
-#include "ld-symbol.h"
-#include "ld-symbol-category.h"
-#include "ld-library.h"
-
/**
* SECTION:ld-symbol-category
diff --git a/src/ld-symbol.c b/src/ld-symbol.c
index fd9ef5a..fafa9ab 100644
--- a/src/ld-symbol.c
+++ b/src/ld-symbol.c
@@ -8,15 +8,9 @@
*
*/
-#include
-
+#include "liblogdiag.h"
#include "config.h"
-#include "ld-types.h"
-#include "ld-symbol.h"
-#include "ld-symbol-category.h"
-#include "ld-library.h"
-
/**
* SECTION:ld-symbol
diff --git a/src/ld-types.c b/src/ld-types.c
index 5bed9dc..cde3da6 100644
--- a/src/ld-types.c
+++ b/src/ld-types.c
@@ -10,12 +10,9 @@
#include
-#include
-
+#include "liblogdiag.h"
#include "config.h"
-#include "ld-types.h"
-
#define DEFINE_BOXED_TYPE(TypeName, type_name) \
GType \
diff --git a/src/ld-window-main.c b/src/ld-window-main.c
index 08e18e8..6cea286 100644
--- a/src/ld-window-main.c
+++ b/src/ld-window-main.c
@@ -10,21 +10,11 @@
#include
+#include "liblogdiag.h"
#include "config.h"
#include "ld-window-main.h"
-#include "ld-types.h"
-#include "ld-symbol.h"
-#include "ld-symbol-category.h"
-#include "ld-library.h"
-
-#include "ld-diagram-object.h"
-#include "ld-diagram-symbol.h"
-#include "ld-diagram.h"
-
-#include "ld-canvas.h"
-
/**
* SECTION:ld-window-main
diff --git a/src/liblogdiag.h b/src/liblogdiag.h
new file mode 100644
index 0000000..800826f
--- /dev/null
+++ b/src/liblogdiag.h
@@ -0,0 +1,34 @@
+/*
+ * liblogdiag.h
+ *
+ * This file is a part of logdiag.
+ * Copyright Přemysl Janouch 2011. All rights reserved.
+ *
+ * See the file LICENSE for licensing information.
+ *
+ */
+
+#ifndef __LIBLOGDIAG_H__
+#define __LIBLOGDIAG_H__
+
+#include
+#include
+
+#include "ld-marshal.h"
+#include "ld-types.h"
+
+#include "ld-symbol.h"
+#include "ld-symbol-category.h"
+#include "ld-library.h"
+
+#include "ld-diagram-object.h"
+#include "ld-diagram-symbol.h"
+#include "ld-diagram.h"
+
+#include "ld-canvas.h"
+
+#include "ld-lua.h"
+#include "ld-lua-symbol.h"
+
+#endif /* ! __LIBLOGDIAG_H__ */
+
--
cgit v1.2.3-70-g09d2