From: Christophe CURIS <christophe.cu...@free.fr> Using local function prototype redefinition is dangerous, now the prototype is seen in all concerned files. --- util/Makefile.am | 6 +++--- util/common.h | 33 +++++++++++++++++++++++++++++++++ util/convertfonts.c | 4 +++- util/fontconv.c | 3 +++ util/getstyle.c | 3 ++- util/setstyle.c | 3 ++- 6 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 util/common.h
diff --git a/util/Makefile.am b/util/Makefile.am index 5335bd2..dbdd1fd 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -28,17 +28,17 @@ wxpaste_LDADD = @XLFLAGS@ @XLIBS@ getstyle_LDADD = $(top_builddir)/WINGs/libWUtil.la $(liblist) -getstyle_SOURCES = getstyle.c fontconv.c +getstyle_SOURCES = getstyle.c fontconv.c common.h setstyle_LDADD = \ $(top_builddir)/WINGs/libWUtil.la \ @XLFLAGS@ @XLIBS@ $(liblist) -setstyle_SOURCES = setstyle.c fontconv.c +setstyle_SOURCES = setstyle.c fontconv.c common.h convertfonts_LDADD = $(top_builddir)/WINGs/libWUtil.la $(liblist) -convertfonts_SOURCES = convertfonts.c fontconv.c +convertfonts_SOURCES = convertfonts.c fontconv.c common.h seticons_LDADD= $(top_builddir)/WINGs/libWUtil.la $(liblist) diff --git a/util/common.h b/util/common.h new file mode 100644 index 0000000..d8aa2dd --- /dev/null +++ b/util/common.h @@ -0,0 +1,33 @@ +/* + * Command-line utilities for WindowMaker + * + * Copyright (c) 1997-2003 Alfredo K. Kojima + * Copyright (c) 2004 Dan Pascu + * + * 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; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +/* + * Functions that are used by more than one tool + */ + +#ifndef UTIL_COMMON_H +#define UTIL_COMMON_H + +/* ---[ util/fontconv.c ]------------------------------------------------- */ +char *convertFont(char *font, Bool keepXLFD); + +#endif diff --git a/util/convertfonts.c b/util/convertfonts.c index c24a812..05ce900 100644 --- a/util/convertfonts.c +++ b/util/convertfonts.c @@ -35,6 +35,9 @@ #include "../src/wconfig.h" +#include "common.h" + + char *FontOptions[] = { "IconTitleFont", "ClipTitleFont", @@ -50,7 +53,6 @@ char *FontOptions[] = { extern char *__progname; -extern char *convertFont(char *font, Bool keepXLFD); void print_help(int print_usage, int exitval) { diff --git a/util/fontconv.c b/util/fontconv.c index 19204db..9104ae5 100644 --- a/util/fontconv.c +++ b/util/fontconv.c @@ -7,6 +7,9 @@ #include "../src/wconfig.h" +#include "common.h" + + #define DEFAULT_FONT "sans serif:pixelsize=12" /* X Font Name Suffix field names */ diff --git a/util/getstyle.c b/util/getstyle.c index 6c397b4..46c9792 100644 --- a/util/getstyle.c +++ b/util/getstyle.c @@ -40,6 +40,8 @@ #include <WINGs/WUtil.h> +#include "common.h" + #define RETRY( x ) do { \ x; \ } while (errno == EINTR); @@ -135,7 +137,6 @@ WMPropList *PixmapPath = NULL; char *ThemePath = NULL; -extern char *convertFont(char *font, Bool keepXLFD); void print_help(int print_usage, int exitval) { diff --git a/util/setstyle.c b/util/setstyle.c index a0d764d..9c6e725 100644 --- a/util/setstyle.c +++ b/util/setstyle.c @@ -38,6 +38,8 @@ #include "../src/wconfig.h" +#include "common.h" + #define MAX_OPTIONS 128 char *FontOptions[] = { @@ -75,7 +77,6 @@ int ignoreCursors = 0; Display *dpy; -extern char *convertFont(char *font, Bool keepXLFD); static Bool isCursorOption(char *option) { -- 1.7.10.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.