From: Christophe CURIS <christophe.cu...@free.fr>

Using local function prototype redefinition is dangerous, now a single
prototype is seen in all the files that are concerned.

Signed-off-by: Christophe CURIS <christophe.cu...@free.fr>
---
 wrlib/Makefile.am |  2 ++
 wrlib/context.c   |  4 ++--
 wrlib/convert.c   |  5 +----
 wrlib/scale.c     |  3 ++-
 wrlib/scale.h     | 30 ++++++++++++++++++++++++++++++
 wrlib/xutil.c     |  1 +
 wrlib/xutil.h     | 29 +++++++++++++++++++++++++++++
 7 files changed, 67 insertions(+), 7 deletions(-)
 create mode 100644 wrlib/scale.h
 create mode 100644 wrlib/xutil.h

diff --git a/wrlib/Makefile.am b/wrlib/Makefile.am
index 489b4a4..e9f357c 100644
--- a/wrlib/Makefile.am
+++ b/wrlib/Makefile.am
@@ -33,11 +33,13 @@ libwraster_la_SOURCES =     \
        context.c       \
        misc.c          \
        scale.c         \
+       scale.h         \
        rotate.c        \
        flip.c          \
        convolve.c      \
        save_xpm.c      \
        xutil.c         \
+       xutil.h         \
        load_ppm.c
 
 if USE_GIF
diff --git a/wrlib/context.c b/wrlib/context.c
index 7479009..1b216a0 100644
--- a/wrlib/context.c
+++ b/wrlib/context.c
@@ -35,8 +35,8 @@
 #include <math.h>
 
 #include "wraster.h"
+#include "scale.h"
 
-extern void _wraster_change_filter(int type);
 
 static Bool bestContext(Display * dpy, int screen_number, RContext * context);
 
@@ -588,7 +588,7 @@ RContext *RCreateContext(Display * dpy, int screen_number, 
const RContextAttribu
 
        /* get configuration from environment variables */
        gatherconfig(context, screen_number);
-       _wraster_change_filter(context->attribs->scaling_filter);
+       wraster_change_filter(context->attribs->scaling_filter);
        if ((context->attribs->flags & RC_VisualID)) {
                XVisualInfo *vinfo, templ;
                int nret;
diff --git a/wrlib/convert.c b/wrlib/convert.c
index b0ab230..23df5c6 100644
--- a/wrlib/convert.c
+++ b/wrlib/convert.c
@@ -35,12 +35,9 @@
 
 #include "wraster.h"
 #include "convert.h"
+#include "xutil.h"
 
 
-#ifdef USE_XSHM
-extern Pixmap R_CreateXImageMappedPixmap(RContext * context, RXImage * ximage);
-#endif
-
 #define NFREE(n)  if (n) free(n)
 
 #define HAS_ALPHA(I)   ((I)->format == RRGBAFormat)
diff --git a/wrlib/scale.c b/wrlib/scale.c
index d2cc1e6..3694be6 100644
--- a/wrlib/scale.c
+++ b/wrlib/scale.c
@@ -35,6 +35,7 @@
 #include <assert.h>
 
 #include "wraster.h"
+#include "scale.h"
 
 /*
  *----------------------------------------------------------------------
@@ -246,7 +247,7 @@ static double Mitchell_filter(double t)
 static double (*filterf)(double) = Mitchell_filter;
 static double fwidth = Mitchell_support;
 
-void _wraster_change_filter(int type)
+void wraster_change_filter(int type)
 {
        switch (type) {
        case RBoxFilter:
diff --git a/wrlib/scale.h b/wrlib/scale.h
new file mode 100644
index 0000000..887b47d
--- /dev/null
+++ b/wrlib/scale.h
@@ -0,0 +1,30 @@
+/*
+ * Raster graphics library
+ *
+ * Copyright (c) 2014 Window Maker Team
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public
+ *  License along with this library.
+ */
+
+#ifndef WRASTER_SCALE_H
+#define WRASTER_SCALE_H
+
+
+/*
+ * Function to change the smoothing filter used for image scaling 
(RSmoothScaleImage)
+ */
+void wraster_change_filter(int type);
+
+
+#endif
diff --git a/wrlib/xutil.c b/wrlib/xutil.c
index 3baa861..1c3f86d 100644
--- a/wrlib/xutil.c
+++ b/wrlib/xutil.c
@@ -36,6 +36,7 @@
 #endif                         /* USE_XSHM */
 
 #include "wraster.h"
+#include "xutil.h"
 
 #ifdef USE_XSHM
 
diff --git a/wrlib/xutil.h b/wrlib/xutil.h
new file mode 100644
index 0000000..46b148b
--- /dev/null
+++ b/wrlib/xutil.h
@@ -0,0 +1,29 @@
+/*
+ * Raster graphics library
+ *
+ * Copyright (c) 2014 Window Maker Team
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public
+ *  License along with this library.
+ */
+
+#ifndef WRASTER_XUTIL_H
+#define WRASTER_XUTIL_H
+
+
+#ifdef USE_XSHM
+Pixmap R_CreateXImageMappedPixmap(RContext *context, RXImage *ximage);
+#endif
+
+
+#endif
-- 
1.9.2


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to