aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-04 09:02:22 (GMT)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-04 10:00:26 (GMT)
commit3cada8d74f6a4e82538bc17923f27bd3e03f4e8e (patch)
tree082ce856ccbbad8f5f1617992a71797459551ea5
parentab49eda5720583b0470a329434554e97c735e696 (diff)
Centralize include for gtk 2
With gtk 2, a function prototyle is declared on a wrong way. Depending on the gcc flags, this will produce an error: /usr/include/gtk-2.0/gtk/gtkitemfactory.h:47:1: error: function declaration isn’t a prototype [-Werror=strict-prototypes] So, move gtk.h include to v4l.h and ensure that this warning is disabled when including it. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r--src/callbacks.c5
-rw-r--r--src/callbacks.h2
-rw-r--r--src/camorama-filter-chain.c1
-rw-r--r--src/camorama-filter-chain.h2
-rw-r--r--src/camorama-globals.h2
-rw-r--r--src/camorama-stock-items.c2
-rw-r--r--src/fileio.c10
-rw-r--r--src/support.c9
-rw-r--r--src/support.h2
-rw-r--r--src/v4l.h6
10 files changed, 22 insertions, 19 deletions
diff --git a/src/callbacks.c b/src/callbacks.c
index cde3ef0..f678c2d 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -1,10 +1,9 @@
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include <config.h>
#include "callbacks.h"
#include "interface.h"
#include "support.h"
#include "filter.h"
+#include <glib/gi18n.h>
+#include <config.h>
#include <pthread.h>
#include <libv4l2.h>
diff --git a/src/callbacks.h b/src/callbacks.h
index 5dd13f9..d38fe4b 100644
--- a/src/callbacks.h
+++ b/src/callbacks.h
@@ -1,7 +1,7 @@
#ifndef CAMORAMA_CALLBACKS_H
#define CAMORAMA_CALLBACKS_H
-#include <gtk/gtk.h>
+#include "v4l.h"
#include "fileio.h"
#include <gconf/gconf-client.h>
diff --git a/src/camorama-filter-chain.c b/src/camorama-filter-chain.c
index 78f9092..f54726a 100644
--- a/src/camorama-filter-chain.c
+++ b/src/camorama-filter-chain.c
@@ -21,6 +21,7 @@
* USA
*/
+#include "v4l.h"
#include "camorama-filter-chain.h"
#include "filter.h"
diff --git a/src/camorama-filter-chain.h b/src/camorama-filter-chain.h
index c8d04a1..4e7519e 100644
--- a/src/camorama-filter-chain.h
+++ b/src/camorama-filter-chain.h
@@ -24,8 +24,6 @@
#ifndef CAMORAMA_FILTER_CHAIN_H
#define CAMORAMA_FILTER_CHAIN_H
-#include <gtk/gtk.h>
-
G_BEGIN_DECLS
typedef struct _CamoramaFilterChain CamoramaFilterChain;
diff --git a/src/camorama-globals.h b/src/camorama-globals.h
index 4dd8386..71d8b71 100644
--- a/src/camorama-globals.h
+++ b/src/camorama-globals.h
@@ -25,7 +25,7 @@
#ifndef CAMORAMA_GLOBALS_H
#define CAMORAMA_GLOBALS_H
-#include <gtk/gtk.h>
+#include "v4l.h"
G_BEGIN_DECLS
diff --git a/src/camorama-stock-items.c b/src/camorama-stock-items.c
index e27e20f..94ff906 100644
--- a/src/camorama-stock-items.c
+++ b/src/camorama-stock-items.c
@@ -5,7 +5,7 @@
#endif
#include <glib/gi18n.h>
-#include <gtk/gtk.h>
+#include "v4l.h"
static GtkStockItem camorama_items[] = {
{CAMORAMA_STOCK_WEBCAM, N_("Webcam"), 0, 0, "camorama"}
diff --git a/src/fileio.c b/src/fileio.c
index 704551c..dedda31 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1,14 +1,14 @@
+#include "interface.h"
+#include "support.h"
+#include "fileio.h"
+#include "v4l.h"
+
#include <errno.h>
-#include <gtk/gtk.h>
#include <gio/gio.h>
#include <glib/gi18n.h>
#include <time.h>
#include <stdio.h>
-#include "interface.h"
-#include "support.h"
-#include "fileio.h"
-
# define CHAR_HEIGHT 11
# define CHAR_WIDTH 6
# define CHAR_START 4
diff --git a/src/support.c b/src/support.c
index 5783b0a..98b081d 100644
--- a/src/support.c
+++ b/src/support.c
@@ -1,13 +1,12 @@
+#include "callbacks.h"
+#include "interface.h"
+#include "support.h"
+
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
-
#include <gdk/gdkkeysyms.h>
-#include <gtk/gtk.h>
-#include "callbacks.h"
-#include "interface.h"
-#include "support.h"
#include <config.h>
GtkWidget *xpm_label_box (gchar * xpm_filename)
diff --git a/src/support.h b/src/support.h
index 63fab01..8545271 100644
--- a/src/support.h
+++ b/src/support.h
@@ -1,2 +1,4 @@
+#include "v4l.h"
+
GtkWidget *xpm_label_box (gchar *);
int error_dialog (char *);
diff --git a/src/v4l.h b/src/v4l.h
index 82c3a1c..c1180f5 100644
--- a/src/v4l.h
+++ b/src/v4l.h
@@ -12,7 +12,6 @@
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <fcntl.h>
-#include <gtk/gtk.h>
#include <linux/types.h>
#include <linux/videodev2.h>
#include <libv4l2.h>
@@ -20,6 +19,11 @@
#include <png.h>
#include <gconf/gconf-client.h>
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstrict-prototypes"
+#include <gtk/gtk.h>
+#pragma GCC diagnostic pop
+
#include "camorama-filter-chain.h"
typedef enum {

Privacy Policy