Update to bitmap 1.0.8

This commit is contained in:
matthieu 2015-01-25 11:30:36 +00:00
parent 8e6050dcaa
commit d6201822a8
12 changed files with 936 additions and 611 deletions

View File

@ -41,6 +41,7 @@ from The Open Group.
#include "BitmapP.h" #include "BitmapP.h"
#include "Bitmap.h" #include "Bitmap.h"
#include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <math.h> #include <math.h>
@ -686,10 +687,14 @@ XmuWriteBitmapDataToFile(_Xconst _XtString filename,
else else
file = fopen(filename, "w+"); file = fopen(filename, "w+");
if (!basename || !strcmp(basename, "") || !strcmp(basename, "-"))
basename = StripFilename(filename);
if (file) { if (file) {
String new_basename;
if (!basename || !strcmp(basename, "") || !strcmp(basename, "-"))
basename = new_basename = StripFilename(filename);
else
new_basename = NULL;
fprintf(file, "#define %s_width %d\n", basename, width); fprintf(file, "#define %s_width %d\n", basename, width);
fprintf(file, "#define %s_height %d\n", basename, height); fprintf(file, "#define %s_height %d\n", basename, height);
if (QuerySet(x_hot, y_hot)) { if (QuerySet(x_hot, y_hot)) {
@ -708,6 +713,7 @@ XmuWriteBitmapDataToFile(_Xconst _XtString filename,
if (file != stdout) if (file != stdout)
fclose(file); fclose(file);
XtFree(new_basename);
return BitmapSuccess; return BitmapSuccess;
} }
@ -902,20 +908,20 @@ Initialize(Widget wrequest, Widget wnew, ArgList argv, Cardinal *argc)
{ {
int status; int status;
XImage *image, *buffer; XImage *image, *buffer;
unsigned char *image_data; unsigned char *image_data2;
char *buffer_data; char *buffer_data2;
unsigned int width, height; unsigned int width, height;
int x_hot, y_hot; int x_hot, y_hot;
status = XmuReadBitmapDataFromFile(new->bitmap.filename, status = XmuReadBitmapDataFromFile(new->bitmap.filename,
&width, &height, &image_data, &width, &height, &image_data2,
&x_hot, &y_hot); &x_hot, &y_hot);
if (status == BitmapSuccess) { if (status == BitmapSuccess) {
buffer_data = CreateCleanData(Length(width, height)); buffer_data2 = CreateCleanData(Length(width, height));
image = CreateBitmapImage(new, (char *)image_data, width, height); image = CreateBitmapImage(new, (char *)image_data2, width, height);
buffer = CreateBitmapImage(new, buffer_data, width, height); buffer = CreateBitmapImage(new, buffer_data2, width, height);
TransferImageData(new->bitmap.image, buffer); TransferImageData(new->bitmap.image, buffer);
@ -1102,7 +1108,7 @@ BWReadFile(Widget w, _Xconst _XtString filename, _Xconst _XtString basename) /*
XtFree(BW->bitmap.filename); XtFree(BW->bitmap.filename);
BW->bitmap.filename = XtNewString(filename); BW->bitmap.filename = XtNewString(filename);
XtFree(BW->bitmap.basename); XtFree(BW->bitmap.basename);
BW->bitmap.basename= XtNewString(StripFilename(filename)); BW->bitmap.basename = StripFilename(filename);
BWUnmark(w); BWUnmark(w);
@ -1198,7 +1204,7 @@ BWWriteFile(Widget w, _Xconst _XtString filename, _Xconst _XtString basename)
XtFree(BW->bitmap.filename); XtFree(BW->bitmap.filename);
BW->bitmap.filename = XtNewString(filename); BW->bitmap.filename = XtNewString(filename);
XtFree(BW->bitmap.basename); XtFree(BW->bitmap.basename);
BW->bitmap.basename= XtNewString(StripFilename(filename)); BW->bitmap.basename = StripFilename(filename);
} }
if (!basename) basename = BW->bitmap.basename; if (!basename) basename = BW->bitmap.basename;
else { else {
@ -1238,6 +1244,8 @@ BWGetFilepath(Widget w, String *str)
String end; String end;
*str = XtNewString(BW->bitmap.filename); *str = XtNewString(BW->bitmap.filename);
assert(*str);
end = strrchr(*str, '/'); end = strrchr(*str, '/');
if (end) if (end)

View File

@ -1,3 +1,200 @@
commit 2f5eae70cd2e9c1e09dcbd8a2a58eaf58207fe00
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri Jan 16 21:57:03 2015 -0800
bitmap 1.0.8
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit dacae58710f7033d5295c50cf6262783350e938d
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Mon Dec 29 18:28:00 2014 -0800
Stop memory leak in XmuWriteBitmapDataToFile()
StripFilename() allocates a new string for its result, so after we're
done with it, free it instead of just losing the pointer to it.
Fixes errors found by Oracle Parfait 1.5.1 bug checking tool:
Error: Memory leak (CWE 401)
Memory leak of pointer basename allocated with StripFilename(filename)
at line 712 of Bitmap.c in function 'XmuWriteBitmapDataToFile'.
basename allocated at line 691 with StripFilename(filename).
basename leaks when i >= data_length at line 702.
Error: Memory leak (CWE 401)
Memory leak of pointer basename allocated with StripFilename(filename)
at line 715 of Bitmap.c in function 'XmuWriteBitmapDataToFile'.
basename allocated at line 691 with StripFilename(filename).
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 8df1a843a3a9f92399113688a350873a141bf995
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Mon Dec 29 18:15:57 2014 -0800
Stop memory leaks from XtNewString(StripFilename(filename))
StripFilename() already allocates a new string for its result,
we don't need to duplicate it and then lose the pointer to the
first one.
Fixes errors found by Oracle Parfait 1.5.1 bug checking tool:
Error: Memory leak (CWE 401)
Memory leak of pointer pointer allocated with StripFilename(filename)
at line 1119 of Bitmap.c in function 'BWReadFile'.
pointer allocated at line 1106 with StripFilename(filename).
pointer leaks when StripFilename(filename) != NULL at line 1106.
Error: Memory leak (CWE 401)
Memory leak of pointer pointer allocated with StripFilename(filename)
at line 1119 of Bitmap.c in function 'BWReadFile'.
pointer allocated at line 1106 with StripFilename(filename).
Error: Memory leak (CWE 401)
Memory leak of pointer pointer allocated with StripFilename(filename)
at line 1222 of Bitmap.c in function 'BWWriteFile'.
pointer allocated at line 1202 with StripFilename(filename).
pointer leaks when StripFilename(filename) != NULL at line 1202.
Error: Memory leak (CWE 401)
Memory leak of pointer pointer allocated with StripFilename(filename)
at line 1222 of Bitmap.c in function 'BWWriteFile'.
pointer allocated at line 1202 with StripFilename(filename).
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit a0db0f6c7996b282aa9027d3b670597d88fe3353
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Jun 1 21:03:14 2014 -0700
autogen.sh: Honor NOCONFIGURE=1
See http://people.gnome.org/~walters/docs/build-api.txt
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 8fb1efccb5f24eab51cefafedb1a5a60217db35f
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Jun 1 21:03:13 2014 -0700
configure: Drop AM_MAINTAINER_MODE
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit d0911d130b870da0951b56f5103c6b4dfb9eeb28
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Wed Jan 1 23:02:48 2014 -0800
Use '& 7' instead '% 8' to silence clang analyzer warning
Graphics.c:569:10: warning: The result of the '<<' expression is undefined
while (!QueryFlood(BW, x, y, value) && (x < x_right))
^~~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics.c:470:7: note: expanded from macro 'QueryFlood'
((GetBit(BW->bitmap.image, x, y) !=\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics.c:66:9: note: expanded from macro 'GetBit'
(1 << ((x) % 8))) ? 1 : 0))
~~^~~~~~~~~~~~
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
commit e3fe79502a4a1b0f0b148659948d541ce26ed7bf
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Wed Jan 1 22:58:23 2014 -0800
Demacro modernization of NewSList to plug a memory leak during error handling
atobm.c:248:6: warning: Potential leak of memory pointed to by 'slist'
NewSList ();
^~~~~~~~~~~
atobm.c:209:3: note: expanded from macro 'NewSList'
fprintf (stderr, "%s: unable to allocate char array\n", \
^~~~~~~
atobm.c:259:6: warning: Potential leak of memory pointed to by 'old'
NewSList ();
^~~~~~~~~~~
atobm.c:209:3: note: expanded from macro 'NewSList'
fprintf (stderr, "%s: unable to allocate char array\n", \
^~~~~~~
atobm.c:259:6: warning: Potential leak of memory pointed to by 'slist'
NewSList ();
^~~~~~~~~~~
atobm.c:209:3: note: expanded from macro 'NewSList'
fprintf (stderr, "%s: unable to allocate char array\n", \
^~~~~~~
3 warnings generated.
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
commit a59538d5d57bd2f8b2101e398a97fe8466b8eef7
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Wed Jan 1 22:43:26 2014 -0800
Silence -Wbad-function-cast
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
commit e7086abb4576a777a4b0aff8553047077cdd08ce
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Wed Jan 1 22:29:45 2014 -0800
Avoid shadow declarations
Bitmap.c:906:17: warning: declaration shadows a local variable [-Wshadow]
unsigned char *image_data;
^
Bitmap.c:799:11: note: previous declaration is here
char *image_data, *buffer_data;
^
Bitmap.c:907:8: warning: declaration shadows a local variable [-Wshadow]
char *buffer_data;
^
Bitmap.c:799:24: note: previous declaration is here
char *image_data, *buffer_data;
^
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
commit 1e236565459d10c7ad85ebed285d2acfc4b15b69
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Wed Jan 1 22:27:36 2014 -0800
assert to avoid a NULL dereference
Bitmap.c:1246:8: warning: Dereference of null pointer
**str = '\0';
~~~~~~^~~~~~
1 warning generated.
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
commit 15d326027827c168511f923e72c64e2131515e19
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Mon Nov 4 23:14:22 2013 -0800
Print which option was in error along with usage message
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
commit 64bc2b97d408d6fea16716e37f7b5ff1661d57fd
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Fri Oct 25 21:51:37 2013 -0400
config: replace deprecated use of AC_OUTPUT with AC_CONFIG_FILES
Fix Automake warning: AC_OUTPUT should be used without arguments.
www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Files
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit a78fc882fac9a3334a77744be4c617b51997a5bb
Author: Eric S. Raymond <esr@thyrsus.com>
Date: Thu Jun 6 14:24:08 2013 -0400
Use table markup in preference to various low-level constructions.
commit 10584a7e5f476c5adb5ec6de9f0b519380abd6df commit 10584a7e5f476c5adb5ec6de9f0b519380abd6df
Author: Alan Coopersmith <alan.coopersmith@oracle.com> Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri May 17 21:12:44 2013 -0700 Date: Fri May 17 21:12:44 2013 -0700

View File

@ -57,13 +57,19 @@ from The Open Group.
# endif # endif
#endif #endif
#ifdef __clang__
/* clang doesn't like (int)floor(d) */
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wbad-function-cast"
#endif
/*****************************************************************************\ /*****************************************************************************\
* Graphics * * Graphics *
\*****************************************************************************/ \*****************************************************************************/
#define GetBit(image, x, y)\ #define GetBit(image, x, y)\
((bit)((*(image->data + (x) / 8 + (y) * image->bytes_per_line) &\ ((bit)((*(image->data + (x) / 8 + (y) * image->bytes_per_line) &\
(1 << ((x) % 8))) ? 1 : 0)) (1 << ((x) & 7))) ? 1 : 0))
#if 0 #if 0
bit bit

View File

@ -288,7 +288,6 @@ LIBS = @LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LTLIBOBJS = @LTLIBOBJS@ LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
MAN_SUBSTS = @MAN_SUBSTS@ MAN_SUBSTS = @MAN_SUBSTS@
MATH_LIBS = @MATH_LIBS@ MATH_LIBS = @MATH_LIBS@
@ -305,6 +304,8 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@ PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
SED = @SED@ SED = @SED@
SET_MAKE = @SET_MAKE@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@ SHELL = @SHELL@
@ -418,7 +419,7 @@ all: config.h
.SUFFIXES: .c .o .obj .SUFFIXES: .c .o .obj
am--refresh: Makefile am--refresh: Makefile
@: @:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \ @for dep in $?; do \
case '$(am__configure_deps)' in \ case '$(am__configure_deps)' in \
*$$dep*) \ *$$dep*) \
@ -445,9 +446,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck $(SHELL) ./config.status --recheck
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(top_srcdir)/configure: $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF) $(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps): $(am__aclocal_m4_deps):
@ -458,7 +459,7 @@ config.h: stamp-h1
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1 @rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(srcdir)/config.h.in: $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER)) ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1 rm -f stamp-h1
touch $@ touch $@

199
app/bitmap/aclocal.m4 vendored
View File

@ -20,6 +20,7 @@ If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])]) To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 1 (pkg-config-0.24)
# #
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
# #
@ -46,8 +47,12 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# ---------------------------------- # ----------------------------------
AC_DEFUN([PKG_PROG_PKG_CONFIG], AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi fi
@ -60,7 +65,6 @@ if test -n "$PKG_CONFIG"; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
PKG_CONFIG="" PKG_CONFIG=""
fi fi
fi[]dnl fi[]dnl
])# PKG_PROG_PKG_CONFIG ])# PKG_PROG_PKG_CONFIG
@ -69,33 +73,31 @@ fi[]dnl
# Check to see whether a particular set of modules exists. Similar # Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors. # to PKG_CHECK_MODULES(), but does not set variables or print errors.
# #
# # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
# Similar to PKG_CHECK_MODULES, make sure that the first instance of # only at the first occurence in configure.ac, so if the first place
# this or PKG_CHECK_MODULES is called, or make sure to call # it's called might be skipped (such as if it is within an "if", you
# PKG_CHECK_EXISTS manually # have to call PKG_CHECK_EXISTS manually
# -------------------------------------------------------------- # --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_EXISTS], AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \ if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_ifval([$2], [$2], [:]) m4_default([$2], [:])
m4_ifvaln([$3], [else m4_ifvaln([$3], [else
$3])dnl $3])dnl
fi]) fi])
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
# --------------------------------------------- # ---------------------------------------------
m4_define([_PKG_CONFIG], m4_define([_PKG_CONFIG],
[if test -n "$PKG_CONFIG"; then [if test -n "$$1"; then
if test -n "$$1"; then
pkg_cv_[]$1="$$1" pkg_cv_[]$1="$$1"
else elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3], PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes ],
[pkg_failed=yes]) [pkg_failed=yes])
fi else
else
pkg_failed=untried pkg_failed=untried
fi[]dnl fi[]dnl
])# _PKG_CONFIG ])# _PKG_CONFIG
@ -138,16 +140,17 @@ and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.]) See the pkg-config man page for more details.])
if test $pkg_failed = yes; then if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED _PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else else
$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi fi
# Put the nasty error message in config.log where it belongs # Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
ifelse([$4], , [AC_MSG_ERROR(dnl m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met: [Package requirements ($2) were not met:
$$1_PKG_ERRORS $$1_PKG_ERRORS
@ -155,28 +158,67 @@ $$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix. installed software in a non-standard prefix.
_PKG_TEXT _PKG_TEXT])[]dnl
])], ])
[AC_MSG_RESULT([no])
$4])
elif test $pkg_failed = untried; then elif test $pkg_failed = untried; then
ifelse([$4], , [AC_MSG_FAILURE(dnl AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it [The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config. path to pkg-config.
_PKG_TEXT _PKG_TEXT
To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])], To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
[$4]) ])
else else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
ifelse([$3], , :, [$3]) $3
fi[]dnl fi[]dnl
])# PKG_CHECK_MODULES ])# PKG_CHECK_MODULES
# PKG_INSTALLDIR(DIRECTORY)
# -------------------------
# Substitutes the variable pkgconfigdir as the location where a module
# should install pkg-config .pc files. By default the directory is
# $libdir/pkgconfig, but the default can be changed by passing
# DIRECTORY. The user can override through the --with-pkgconfigdir
# parameter.
AC_DEFUN([PKG_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([pkgconfigdir],
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
[with_pkgconfigdir=]pkg_default)
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
]) dnl PKG_INSTALLDIR
# PKG_NOARCH_INSTALLDIR(DIRECTORY)
# -------------------------
# Substitutes the variable noarch_pkgconfigdir as the location where a
# module should install arch-independent pkg-config .pc files. By
# default the directory is $datadir/pkgconfig, but the default can be
# changed by passing DIRECTORY. The user can override through the
# --with-noarch-pkgconfigdir parameter.
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([noarch-pkgconfigdir],
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
[with_noarch_pkgconfigdir=]pkg_default)
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
]) dnl PKG_NOARCH_INSTALLDIR
# Copyright (C) 2002-2012 Free Software Foundation, Inc. # Copyright (C) 2002-2012 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
@ -757,44 +799,6 @@ fi
rmdir .tst 2>/dev/null rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])]) AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_MAINTAINER_MODE([DEFAULT-MODE])
# ----------------------------------
# Control maintainer-specific portions of Makefiles.
# Default is to disable them, unless 'enable' is passed literally.
# For symmetry, 'disable' may be passed as well. Anyway, the user
# can override the default with the --enable/--disable switch.
AC_DEFUN([AM_MAINTAINER_MODE],
[m4_case(m4_default([$1], [disable]),
[enable], [m4_define([am_maintainer_other], [disable])],
[disable], [m4_define([am_maintainer_other], [enable])],
[m4_define([am_maintainer_other], [enable])
m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode's default is 'disable' unless 'enable' is passed
AC_ARG_ENABLE([maintainer-mode],
[AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
am_maintainer_other[ make rules and dependencies not useful
(and sometimes confusing) to the casual installer])],
[USE_MAINTAINER_MODE=$enableval],
[USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST([MAINT])dnl
]
)
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
# Check to see how 'make' treats includes. -*- Autoconf -*- # Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2012 Free Software Foundation, Inc. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
@ -1269,7 +1273,7 @@ dnl DEALINGS IN THE SOFTWARE.
# See the "minimum version" comment for each macro you use to see what # See the "minimum version" comment for each macro you use to see what
# version you require. # version you require.
m4_defun([XORG_MACROS_VERSION],[ m4_defun([XORG_MACROS_VERSION],[
m4_define([vers_have], [1.16.2]) m4_define([vers_have], [1.19.0])
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
m4_if(m4_cmp(maj_have, maj_needed), 0,, m4_if(m4_cmp(maj_have, maj_needed), 0,,
@ -1319,6 +1323,7 @@ if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
else else
if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
TRADITIONALCPPFLAGS="-traditional"
RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
else else
@ -1327,6 +1332,7 @@ else
fi fi
rm -f conftest.$ac_ext rm -f conftest.$ac_ext
AC_SUBST(RAWCPPFLAGS) AC_SUBST(RAWCPPFLAGS)
AC_SUBST(TRADITIONALCPPFLAGS)
]) # XORG_PROG_RAWCPP ]) # XORG_PROG_RAWCPP
# XORG_MANPAGE_SECTIONS() # XORG_MANPAGE_SECTIONS()
@ -1851,9 +1857,10 @@ AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
]) # XORG_WITH_ASCIIDOC ]) # XORG_WITH_ASCIIDOC
# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
# -------------------------------- # -------------------------------------------
# Minimum version: 1.5.0 # Minimum version: 1.5.0
# Minimum version for optional DEFAULT argument: 1.11.0 # Minimum version for optional DEFAULT argument: 1.11.0
# Minimum version for optional DOT checking: 1.18.0
# #
# Documentation tools are not always available on all platforms and sometimes # Documentation tools are not always available on all platforms and sometimes
# not at the appropriate level. This macro enables a module to test for the # not at the appropriate level. This macro enables a module to test for the
@ -1873,6 +1880,7 @@ AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
# #
AC_DEFUN([XORG_WITH_DOXYGEN],[ AC_DEFUN([XORG_WITH_DOXYGEN],[
AC_ARG_VAR([DOXYGEN], [Path to doxygen command]) AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
AC_ARG_VAR([DOT], [Path to the dot graphics utility])
m4_define([_defopt], m4_default([$2], [auto])) m4_define([_defopt], m4_default([$2], [auto]))
AC_ARG_WITH(doxygen, AC_ARG_WITH(doxygen,
AS_HELP_STRING([--with-doxygen], AS_HELP_STRING([--with-doxygen],
@ -1916,6 +1924,20 @@ m4_ifval([$1],
AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
fi]) fi])
fi]) fi])
dnl Check for DOT if we have doxygen. The caller decides if it is mandatory
dnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
dnl HAVE_DOT = @HAVE_DOT@
HAVE_DOT=no
if test "x$have_doxygen" = "xyes"; then
AC_PATH_PROG([DOT], [dot])
if test "x$DOT" != "x"; then
HAVE_DOT=yes
fi
fi
AC_SUBST([HAVE_DOT])
AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
]) # XORG_WITH_DOXYGEN ]) # XORG_WITH_DOXYGEN
@ -2098,6 +2120,29 @@ fi])
AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
]) # XORG_WITH_FOP ]) # XORG_WITH_FOP
# XORG_WITH_M4([MIN-VERSION])
# ---------------------------
# Minimum version: 1.19.0
#
# This macro attempts to locate an m4 macro processor which supports
# -I option and is only useful for modules relying on M4 in order to
# expand macros in source code files.
#
# Interface to module:
# M4: returns the path of the m4 program found
# returns the path set by the user in the environment
#
AC_DEFUN([XORG_WITH_M4], [
AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
[AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
[[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
[AC_MSG_ERROR([could not find m4 that supports -I option])],
[$PATH:/usr/gnu/bin])])
AC_SUBST([M4], [$ac_cv_path_M4])
]) # XORG_WITH_M4
# XORG_WITH_PS2PDF([DEFAULT]) # XORG_WITH_PS2PDF([DEFAULT])
# ---------------- # ----------------
# Minimum version: 1.6.0 # Minimum version: 1.6.0
@ -2552,7 +2597,8 @@ AC_ARG_ENABLE(malloc0returnsnull,
AC_MSG_CHECKING([whether malloc(0) returns NULL]) AC_MSG_CHECKING([whether malloc(0) returns NULL])
if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
AC_RUN_IFELSE([AC_LANG_PROGRAM([ AC_CACHE_VAL([xorg_cv_malloc0_returns_null],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([
#include <stdlib.h> #include <stdlib.h>
],[ ],[
char *m0, *r0, *c0, *p; char *m0, *r0, *c0, *p;
@ -2562,9 +2608,9 @@ if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
c0 = calloc(0,10); c0 = calloc(0,10);
exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1); exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
])], ])],
[MALLOC_ZERO_RETURNS_NULL=yes], [xorg_cv_malloc0_returns_null=yes],
[MALLOC_ZERO_RETURNS_NULL=no], [xorg_cv_malloc0_returns_null=no])])
[MALLOC_ZERO_RETURNS_NULL=yes]) MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
fi fi
AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
@ -2775,18 +2821,18 @@ fi
found="no" found="no"
m4_foreach([flag], m4_cdr($@), [ m4_foreach([flag], m4_cdr($@), [
if test $found = "no" ; then if test $found = "no" ; then
if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
fi fi
if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument" PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
fi fi
PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag[" PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
AC_MSG_CHECKING([if ]COMPILER[ supports]flag[]) AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[]) cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
AC_CACHE_VAL($cacheid, AC_CACHE_VAL($cacheid,
[AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])], [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
@ -2853,7 +2899,7 @@ AC_LANG_CASE(
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
] ]
) )
@ -2862,16 +2908,17 @@ AC_LANG_CASE(
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
# These are currently disabled because they are noisy. They will be enabled # These are currently disabled because they are noisy. They will be enabled
# in the future once the codebase is sufficiently modernized to silence # in the future once the codebase is sufficiently modernized to silence
# them. For now, I don't want them to drown out the other warnings. # them. For now, I don't want them to drown out the other warnings.
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
# Turn some warnings into errors, so we don't accidently get successful builds # Turn some warnings into errors, so we don't accidently get successful builds
# when there are problems that should be fixed. # when there are problems that should be fixed.

View File

@ -42,9 +42,11 @@ static char *ProgramName;
static void doit(FILE *fp, const char *filename, const char *chars, static void doit(FILE *fp, const char *filename, const char *chars,
int xhot, int yhot, const char *name); int xhot, int yhot, const char *name);
static void _X_NORETURN static void _X_NORETURN _X_COLD
usage (void) usage (const char *msg)
{ {
if (msg)
fprintf(stderr, "%s: %s\n", ProgramName, msg);
fprintf (stderr, "usage: %s [-options ...] [filename]\n\n%s\n", fprintf (stderr, "usage: %s [-options ...] [filename]\n\n%s\n",
ProgramName, ProgramName,
"where options include:\n" "where options include:\n"
@ -55,6 +57,14 @@ usage (void)
exit (1); exit (1);
} }
static void _X_NORETURN _X_COLD
missing_arg (const char *option)
{
char msg[32];
snprintf(msg, sizeof(msg), "%s requires an argument", option);
usage(msg);
}
static char * static char *
cify_name (char *name) cify_name (char *name)
@ -106,23 +116,25 @@ main (int argc, char *argv[])
filename = NULL; filename = NULL;
continue; continue;
case 'c': case 'c':
if (++i >= argc) usage (); if (++i >= argc) missing_arg("-chars");
chars = argv[i]; chars = argv[i];
continue; continue;
case 'n': case 'n':
if (++i >= argc) usage (); if (++i >= argc) missing_arg("-name");
name = argv[i]; name = argv[i];
continue; continue;
case 'x': case 'x':
if (++i >= argc) usage (); if (++i >= argc) missing_arg("-xhot");
xhot = atoi (argv[i]); xhot = atoi (argv[i]);
continue; continue;
case 'y': case 'y':
if (++i >= argc) usage (); if (++i >= argc) missing_arg("-yhot");
yhot = atoi (argv[i]); yhot = atoi (argv[i]);
continue; continue;
default: default:
usage (); fprintf(stderr, "%s: unrecognized option '%s'\n",
ProgramName, argv[i]);
usage (NULL);
} }
} else { } else {
filename = arg; filename = arg;
@ -155,6 +167,31 @@ main (int argc, char *argv[])
exit (0); exit (0);
} }
struct _scan_list {
int allocated;
int used;
unsigned char *scanlines;
struct _scan_list *next;
};
#define NTOALLOC 16
static inline struct _scan_list *
_new_scan_list(int bytes_per_scanline) {
struct _scan_list *slist = (struct _scan_list *) calloc (1, sizeof(*slist));
if (!slist) {
return NULL;
}
slist->allocated = NTOALLOC * bytes_per_scanline;
slist->scanlines = (unsigned char *) calloc(slist->allocated, 1);
if (!slist->scanlines) {
free(slist);
return NULL;
}
slist->used = 0;
slist->next = NULL;
return slist;
}
static void static void
doit (FILE *fp, doit (FILE *fp,
@ -173,34 +210,11 @@ doit (FILE *fp,
(isascii(chars[1]) && isspace(chars[1]))) ? 0 : 1); (isascii(chars[1]) && isspace(chars[1]))) ? 0 : 1);
int lineno = 0; int lineno = 0;
int bytes_per_scanline = 0; int bytes_per_scanline = 0;
struct _scan_list { struct _scan_list *head = NULL, *slist = NULL;
int allocated;
int used;
unsigned char *scanlines;
struct _scan_list *next;
} *head = NULL, *slist = NULL;
static unsigned char masktable[] = { static unsigned char masktable[] = {
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
int padded = 0; int padded = 0;
#define NTOALLOC 16
#define NewSList() \
slist = (struct _scan_list *) calloc (1, sizeof *slist); \
if (!slist) { \
fprintf (stderr, "%s: unable to allocate scan list\n", \
ProgramName); \
return; \
} \
slist->allocated = NTOALLOC * bytes_per_scanline; \
slist->scanlines = (unsigned char *) calloc(slist->allocated, 1); \
if (!slist->scanlines) { \
fprintf (stderr, "%s: unable to allocate char array\n", \
ProgramName); \
return; \
} \
slist->used = 0; \
slist->next = NULL;
while (1) { while (1) {
buf[0] = '\0'; buf[0] = '\0';
lineno++; lineno++;
@ -233,8 +247,12 @@ doit (FILE *fp,
width = len; width = len;
padded = ((width & 7) != 0); padded = ((width & 7) != 0);
bytes_per_scanline = (len + 7) / 8; bytes_per_scanline = (len + 7) / 8;
NewSList (); head = slist = _new_scan_list(bytes_per_scanline);
head = slist;
if (!slist) {
fprintf (stderr, "%s: unable to allocate scan list\n", ProgramName);
return;
}
} else if (width != len) { } else if (width != len) {
fprintf (stderr, fprintf (stderr,
"%s: line %d is %d characters wide instead of %d\n", "%s: line %d is %d characters wide instead of %d\n",
@ -244,8 +262,13 @@ doit (FILE *fp,
if (slist->used + 1 >= slist->allocated) { if (slist->used + 1 >= slist->allocated) {
struct _scan_list *old = slist; struct _scan_list *old = slist;
NewSList (); old->next = slist = _new_scan_list(bytes_per_scanline);
old->next = slist;
if (!slist) {
fprintf (stderr, "%s: unable to allocate scan list\n", ProgramName);
free(old);
return;
}
} }
/* okay, parse the line and stick values into the scanline array */ /* okay, parse the line and stick values into the scanline array */

View File

@ -9,5 +9,6 @@ cd $srcdir
autoreconf -v --install || exit 1 autoreconf -v --install || exit 1
cd $ORIGDIR || exit $? cd $ORIGDIR || exit $?
$srcdir/configure --enable-maintainer-mode "$@" if test -z "$NOCONFIGURE"; then
$srcdir/configure "$@"
fi

View File

@ -130,10 +130,16 @@ main (int argc, char *argv[])
filename = NULL; filename = NULL;
continue; continue;
case 'c': case 'c':
if (++i >= argc) usage (); if (++i >= argc) {
fprintf(stderr, "%s: -chars requires an argument\n",
ProgramName);
usage ();
}
chars = argv[i]; chars = argv[i];
continue; continue;
default: default:
fprintf(stderr, "%s: unrecognized option '%s'\n",
ProgramName, argv[i]);
usage (); usage ();
} }
} else { } else {

892
app/bitmap/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -23,14 +23,13 @@ dnl Process this file with autoconf to create configure.
# Initialize Autoconf # Initialize Autoconf
AC_PREREQ([2.60]) AC_PREREQ([2.60])
AC_INIT([bitmap], [1.0.7], AC_INIT([bitmap], [1.0.8],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [bitmap]) [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [bitmap])
AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
# Initialize Automake # Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_MAINTAINER_MODE
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS # Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION], m4_ifndef([XORG_MACROS_VERSION],
@ -56,7 +55,7 @@ AC_SUBST([MATH_LIBS])
# Obtain compiler/linker options from dependencies # Obtain compiler/linker options from dependencies
PKG_CHECK_MODULES(BMTOA, [x11 xmu xproto >= 7.0.17]) PKG_CHECK_MODULES(BMTOA, [x11 xmu xproto >= 7.0.17])
PKG_CHECK_MODULES(ATOBM, [xproto >= 7.0.17]) PKG_CHECK_MODULES(ATOBM, [xproto >= 7.0.25])
PKG_CHECK_MODULES(BITMAP, xbitmaps xaw7 xmu) PKG_CHECK_MODULES(BITMAP, xbitmaps xaw7 xmu)
PKG_CHECK_MODULES(APPDEFS, xt) PKG_CHECK_MODULES(APPDEFS, xt)
@ -67,5 +66,6 @@ AC_ARG_WITH(appdefaultdir,
[appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"]) [appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"])
AC_SUBST(appdefaultdir) AC_SUBST(appdefaultdir)
AC_OUTPUT([Makefile AC_CONFIG_FILES([Makefile
man/Makefile]) man/Makefile])
AC_OUTPUT

View File

@ -184,7 +184,6 @@ LIBS = @LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LTLIBOBJS = @LTLIBOBJS@ LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
MAN_SUBSTS = @MAN_SUBSTS@ MAN_SUBSTS = @MAN_SUBSTS@
MATH_LIBS = @MATH_LIBS@ MATH_LIBS = @MATH_LIBS@
@ -201,6 +200,8 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@ PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
SED = @SED@ SED = @SED@
SET_MAKE = @SET_MAKE@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@ SHELL = @SHELL@
@ -271,7 +272,7 @@ all: all-am
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .$(APP_MAN_SUFFIX) .man .SUFFIXES: .$(APP_MAN_SUFFIX) .man
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \ @for dep in $?; do \
case '$(am__configure_deps)' in \ case '$(am__configure_deps)' in \
*$$dep*) \ *$$dep*) \
@ -296,9 +297,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps): $(am__aclocal_m4_deps):
install-appmanDATA: $(appman_DATA) install-appmanDATA: $(appman_DATA)

View File

@ -612,20 +612,23 @@ purpose as well. It can be freely incorporated with other
applications and used as a standard editing tool. The following are applications and used as a standard editing tool. The following are
the resources provided by the bitmap widget. the resources provided by the bitmap widget.
.sp .sp
.nf .TS
lb lb
l l.
Bitmap Widget Bitmap Widget
Header file Bitmap.h Header file Bitmap.h
Class bitmapWidgetClass Class bitmapWidgetClass
Class Name Bitmap Class Name Bitmap
Superclass Bitmap Superclass Bitmap
.TE
All the Simple Widget resources plus .\|.\|. All the Simple Widget resources plus .\|.\|.
.ta 1.6i 3.2i 4.8i
.TS
lb lb lb lb lb
l l l l l.
Name Class Type Default Value Name Class Type Default Value
foreground Foreground Pixel XtDefaultForeground foreground Foreground Pixel XtDefaultForeground
highlight Highlight Pixel XtDefaultForeground highlight Highlight Pixel XtDefaultForeground
framing Framing Pixel XtDefaultForeground framing Framing Pixel XtDefaultForeground
@ -648,7 +651,7 @@ button4Function Button4Function DrawingFunction Invert
button5Function Button5Function DrawingFunction Invert button5Function Button5Function DrawingFunction Invert
filename Filename String None ("") filename Filename String None ("")
basename Basename String None ("") basename Basename String None ("")
.fi .TE
.SH AUTHOR .SH AUTHOR
Davor Matic, MIT X Consortium Davor Matic, MIT X Consortium