summaryrefslogtreecommitdiff
path: root/app/x11perf
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2022-11-06 16:08:53 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2022-11-06 16:08:53 +0000
commite1cac83a1c3502654f669b5463a9a8a7a44bf9db (patch)
tree12c011a685f80dd13371ff6ecf0742bd5e800e55 /app/x11perf
parentd7d55fb55f26adac2bcd65388bb9fc0fa17362e1 (diff)
Update x11perf to version 1.6.2
Diffstat (limited to 'app/x11perf')
-rw-r--r--app/x11perf/ChangeLog73
-rw-r--r--app/x11perf/Makefile.in7
-rw-r--r--app/x11perf/README.md2
-rw-r--r--app/x11perf/aclocal.m416
-rw-r--r--app/x11perf/compile17
-rw-r--r--app/x11perf/configure76
-rw-r--r--app/x11perf/configure.ac6
-rw-r--r--app/x11perf/do_arcs.c18
-rw-r--r--app/x11perf/do_blt.c22
-rw-r--r--app/x11perf/do_complex.c33
-rw-r--r--app/x11perf/do_dots.c10
-rw-r--r--app/x11perf/do_lines.c9
-rw-r--r--app/x11perf/do_movewin.c50
-rw-r--r--app/x11perf/do_rects.c13
-rw-r--r--app/x11perf/do_segs.c6
-rw-r--r--app/x11perf/do_simple.c34
-rw-r--r--app/x11perf/do_text.c92
-rw-r--r--app/x11perf/do_traps.c35
-rw-r--r--app/x11perf/do_tris.c25
-rw-r--r--app/x11perf/do_valgc.c3
-rw-r--r--app/x11perf/do_windows.c47
-rw-r--r--app/x11perf/man/Makefile.in1
-rw-r--r--app/x11perf/x11perf.c53
-rw-r--r--app/x11perf/x11perf.h2
24 files changed, 320 insertions, 330 deletions
diff --git a/app/x11perf/ChangeLog b/app/x11perf/ChangeLog
index 0f42294c0..675852c5e 100644
--- a/app/x11perf/ChangeLog
+++ b/app/x11perf/ChangeLog
@@ -1,3 +1,72 @@
+commit 95ff3954dea7deb1cc995c09c404ebb22b6f18a0
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Oct 28 19:19:52 2022 -0700
+
+ x11perf 1.6.2
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 74b90ae3c226295a6ff196b71273983da3e1a70e
+Author: Aaron Plattner <aplattner@nvidia.com>
+Date: Wed Sep 14 10:20:47 2022 -0700
+
+ tests: Skip trapezoids for unsupported XRender formats
+
+ xserver commit 436fd7e8b4966c305ea9c43f3c14c2ca04c35539 removed support
+ for PictStandardA4. x11perf assumes this format always exists, so trying
+ to run the -aa4trap* tests causes a segmentation fault when
+ `XRenderFindStandardFormat (xp->d, PictStandardA4)` returns NULL.
+
+ Since the server change was intentional, skip the tests if
+ XRenderFindStandardFormat() returns NULL.
+
+ See also: https://gitlab.freedesktop.org/xorg/xserver/-/commit/436fd7e8b4966c305ea9c43f3c14c2ca04c35539
+
+commit c420f450d0a2b1f26d4043334bb8b6524fea4b07
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Oct 15 13:10:52 2022 -0700
+
+ Stop casting return value of malloc() and calloc()
+
+ Not needed in C89 and later, and may hide errors
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 2900d7a7e7929414268cb142bf00c57d370e1396
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Oct 15 13:00:22 2022 -0700
+
+ Variable scope reductions as recommended by cppcheck
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit f021fe33579e75bd19e7b5784858be14c3e3c4b6
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Thu Jul 21 15:57:38 2022 -0700
+
+ gitlab CI: add a basic build test
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit e7d9ca95f3afacd4d14eccc9d3492d651b8936fe
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Thu Jul 21 15:52:42 2022 -0700
+
+ Build xz tarballs instead of bzip2
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 8527d4cf67018d793e8912f66fde0cd8a19d30a5
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sun Jan 9 13:02:18 2022 -0800
+
+ Fix spelling/wording issues
+
+ Found by using:
+ codespell --builtin clear,rare,usage,informal,code,names
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
commit ed96e6ce90f8a2177db00c56c2af9311bc167cc4
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Mar 16 15:49:38 2019 -0700
@@ -641,7 +710,7 @@ Date: Thu Dec 6 16:37:08 2007 -0500
Replace static ChangeLog with dist-hook to generate from git log
commit b1c5b72bb4bb5f3e116255f9d04b368137ff25f7
-Author: Michel Dänzer <michel@tungstengraphics.com>
+Author: Michel Dänzer <michel@tungstengraphics.com>
Date: Thu Nov 1 09:13:43 2007 +0100
Fix typos in descriptions of -compwinwin{1,5}00.
@@ -874,7 +943,7 @@ Date: Sat Jul 16 23:29:38 2005 +0000
correctly
commit 68ebb5b755791822c2f1d9f9659c2ee94bb63f1c
-Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Wed Jun 29 20:41:01 2005 +0000
Add x11perf build system Add some x11perf shell script to symlink.sh
diff --git a/app/x11perf/Makefile.in b/app/x11perf/Makefile.in
index 5850f8491..43e818987 100644
--- a/app/x11perf/Makefile.in
+++ b/app/x11perf/Makefile.in
@@ -216,9 +216,9 @@ am__relativize = \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
-DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
+DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.xz
GZIP_ENV = --best
-DIST_TARGETS = dist-bzip2 dist-gzip
+DIST_TARGETS = dist-xz dist-gzip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
@@ -343,6 +343,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -800,6 +801,7 @@ distdir: $(DISTFILES)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir)
+
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
@@ -807,7 +809,6 @@ dist-bzip2: distdir
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
-
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
diff --git a/app/x11perf/README.md b/app/x11perf/README.md
index 65a0dab96..3c0cbd975 100644
--- a/app/x11perf/README.md
+++ b/app/x11perf/README.md
@@ -4,7 +4,7 @@ Xorg mailing list:
https://lists.x.org/mailman/listinfo/xorg
-The master development code repository can be found at:
+The primary development code repository can be found at:
https://gitlab.freedesktop.org/xorg/test/x11perf
diff --git a/app/x11perf/aclocal.m4 b/app/x11perf/aclocal.m4
index 2a518c4b6..d0a818e1e 100644
--- a/app/x11perf/aclocal.m4
+++ b/app/x11perf/aclocal.m4
@@ -19,9 +19,9 @@ You have another version of autoconf. It may work, but is not guaranteed to.
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'.])])
-dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-dnl serial 11 (pkg-config-0.29.1)
-dnl
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 12 (pkg-config-0.29.2)
+
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
dnl
@@ -62,7 +62,7 @@ dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
-[m4_define([PKG_MACROS_VERSION], [0.29.1])
+[m4_define([PKG_MACROS_VERSION], [0.29.2])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
@@ -163,7 +163,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
-AC_MSG_CHECKING([for $1])
+AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
@@ -173,11 +173,11 @@ and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
- AC_MSG_RESULT([no])
+ AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
- else
+ else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
@@ -194,7 +194,7 @@ installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
- AC_MSG_RESULT([no])
+ 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
is in your PATH or set the PKG_CONFIG environment variable to the full
diff --git a/app/x11perf/compile b/app/x11perf/compile
index a85b723c7..df363c8fb 100644
--- a/app/x11perf/compile
+++ b/app/x11perf/compile
@@ -1,9 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
-scriptversion=2012-10-14.11; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -53,7 +53,7 @@ func_file_conv ()
MINGW*)
file_conv=mingw
;;
- CYGWIN*)
+ CYGWIN* | MSYS*)
file_conv=cygwin
;;
*)
@@ -67,7 +67,7 @@ func_file_conv ()
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
- cygwin/*)
+ cygwin/* | msys/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
@@ -255,7 +255,8 @@ EOF
echo "compile $scriptversion"
exit $?
;;
- cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+ cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
@@ -339,9 +340,9 @@ exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/app/x11perf/configure b/app/x11perf/configure
index 823e47886..2f64cec39 100644
--- a/app/x11perf/configure
+++ b/app/x11perf/configure
@@ -1,8 +1,8 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for x11perf 1.6.1.
+# Generated by GNU Autoconf 2.69 for x11perf 1.6.2.
#
-# Report bugs to <https://gitlab.freedesktop.org/xorg/test/x11perf/issues>.
+# Report bugs to <https://gitlab.freedesktop.org/xorg/test/x11perf/-/issues>.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -267,7 +267,7 @@ fi
$as_echo "$0: be upgraded to zsh 4.3.4 or later."
else
$as_echo "$0: Please tell bug-autoconf@gnu.org and
-$0: https://gitlab.freedesktop.org/xorg/test/x11perf/issues
+$0: https://gitlab.freedesktop.org/xorg/test/x11perf/-/issues
$0: about your system, including any error possibly output
$0: before this message. Then install a modern shell, or
$0: manually run the script under such a shell if you do
@@ -581,9 +581,9 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='x11perf'
PACKAGE_TARNAME='x11perf'
-PACKAGE_VERSION='1.6.1'
-PACKAGE_STRING='x11perf 1.6.1'
-PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/test/x11perf/issues'
+PACKAGE_VERSION='1.6.2'
+PACKAGE_STRING='x11perf 1.6.2'
+PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/test/x11perf/-/issues'
PACKAGE_URL=''
ac_unique_file="Makefile.am"
@@ -737,6 +737,7 @@ infodir
docdir
oldincludedir
includedir
+runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -823,6 +824,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1075,6 +1077,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst | --runs \
+ | --run | --ru | --r)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+ | --run=* | --ru=* | --r=*)
+ runstatedir=$ac_optarg ;;
+
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1212,7 +1223,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
+ libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1325,7 +1336,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures x11perf 1.6.1 to adapt to many kinds of systems.
+\`configure' configures x11perf 1.6.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1365,6 +1376,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1395,7 +1407,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of x11perf 1.6.1:";;
+ short | recursive ) echo "Configuration of x11perf 1.6.2:";;
esac
cat <<\_ACEOF
@@ -1449,7 +1461,7 @@ Some influential environment variables:
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
-Report bugs to <https://gitlab.freedesktop.org/xorg/test/x11perf/issues>.
+Report bugs to <https://gitlab.freedesktop.org/xorg/test/x11perf/-/issues>.
_ACEOF
ac_status=$?
fi
@@ -1512,7 +1524,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-x11perf configure 1.6.1
+x11perf configure 1.6.2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1836,7 +1848,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by x11perf $as_me 1.6.1, which was
+It was created by x11perf $as_me 1.6.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2665,7 +2677,7 @@ fi
# Define the identity of the package.
PACKAGE='x11perf'
- VERSION='1.6.1'
+ VERSION='1.6.2'
cat >>confdefs.h <<_ACEOF
@@ -10536,8 +10548,8 @@ fi
# Checks for pkg-config packages
pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11PERF" >&5
-$as_echo_n "checking for X11PERF... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x11 xmuu xproto >= 7.0.17" >&5
+$as_echo_n "checking for x11 xmuu xproto >= 7.0.17... " >&6; }
if test -n "$X11PERF_CFLAGS"; then
pkg_cv_X11PERF_CFLAGS="$X11PERF_CFLAGS"
@@ -10577,7 +10589,7 @@ fi
if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -10604,7 +10616,7 @@ Alternatively, you may set the environment variables X11PERF_CFLAGS
and X11PERF_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@@ -10629,8 +10641,8 @@ fi
# Check for Xrender library
pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRENDER" >&5
-$as_echo_n "checking for XRENDER... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xrender" >&5
+$as_echo_n "checking for xrender... " >&6; }
if test -n "$XRENDER_CFLAGS"; then
pkg_cv_XRENDER_CFLAGS="$XRENDER_CFLAGS"
@@ -10670,7 +10682,7 @@ fi
if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -10688,7 +10700,7 @@ fi
xrender_found=no
elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
xrender_found=no
else
@@ -10709,8 +10721,8 @@ esac
# Check for Xft library
pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XFT" >&5
-$as_echo_n "checking for XFT... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xft" >&5
+$as_echo_n "checking for xft... " >&6; }
if test -n "$XFT_CFLAGS"; then
pkg_cv_XFT_CFLAGS="$XFT_CFLAGS"
@@ -10750,7 +10762,7 @@ fi
if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -10768,7 +10780,7 @@ fi
xft_found=no
elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
xft_found=no
else
@@ -10789,8 +10801,8 @@ esac
# Check for MIT-SHM extension
pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XEXT" >&5
-$as_echo_n "checking for XEXT... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xext" >&5
+$as_echo_n "checking for xext... " >&6; }
if test -n "$XEXT_CFLAGS"; then
pkg_cv_XEXT_CFLAGS="$XEXT_CFLAGS"
@@ -10830,7 +10842,7 @@ fi
if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -10848,7 +10860,7 @@ fi
xext_found=no
elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
xext_found=no
else
@@ -11427,7 +11439,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by x11perf $as_me 1.6.1, which was
+This file was extended by x11perf $as_me 1.6.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -11487,13 +11499,13 @@ $config_headers
Configuration commands:
$config_commands
-Report bugs to <https://gitlab.freedesktop.org/xorg/test/x11perf/issues>."
+Report bugs to <https://gitlab.freedesktop.org/xorg/test/x11perf/-/issues>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-x11perf config.status 1.6.1
+x11perf config.status 1.6.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/app/x11perf/configure.ac b/app/x11perf/configure.ac
index 5130bc7b0..d5f744760 100644
--- a/app/x11perf/configure.ac
+++ b/app/x11perf/configure.ac
@@ -23,14 +23,14 @@ dnl Process this file with autoconf to create configure.
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([x11perf],
- [1.6.1],
- [https://gitlab.freedesktop.org/xorg/test/x11perf/issues],
+ [1.6.2],
+ [https://gitlab.freedesktop.org/xorg/test/x11perf/-/issues],
[x11perf])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
# Initialize Automake
-AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_INIT_AUTOMAKE([foreign dist-xz])
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION],
diff --git a/app/x11perf/do_arcs.c b/app/x11perf/do_arcs.c
index 5afd434ee..6ab15474e 100644
--- a/app/x11perf/do_arcs.c
+++ b/app/x11perf/do_arcs.c
@@ -31,7 +31,6 @@ static GC pgc;
static void
GenerateCircles(XParms xp, Parms p, Bool partialArcs, Bool ddashed)
{
- int i;
int rows; /* Number of rows filled in current column */
int x, y; /* base of square to draw the circle in */
int xorg, yorg; /* Used to get from column to column or row to row */
@@ -46,13 +45,13 @@ GenerateCircles(XParms xp, Parms p, Bool partialArcs, Bool ddashed)
size = p->special;
half = (size + 19) / 20;
- arcs = (XArc *)malloc((p->objects) * sizeof(XArc));
+ arcs = malloc((p->objects) * sizeof(XArc));
x = xorg = half; y = yorg = half;
rows = 0;
startAngle = DegreesToX(0);
arcAngle = DegreesToX(360);
- for (i = 0; i != p->objects; i++) {
+ for (int i = 0; i != p->objects; i++) {
arcs[i].x = x;
arcs[i].y = y;
arcs[i].width = size;
@@ -239,7 +238,6 @@ GenerateEllipses(XParms xp, Parms p, int partialArcs, Bool ddashed)
int size;
int half;
int rows; /* Number of rows filled in current column */
- int i;
int x, y; /* base of square to draw ellipse in */
int vsize, vsizeinc;
int dir;
@@ -252,7 +250,7 @@ GenerateEllipses(XParms xp, Parms p, int partialArcs, Bool ddashed)
size = p->special;
half = (size + 19) / 20;
- arcs = (XArc *)malloc((p->objects) * sizeof(XArc));
+ arcs = malloc((p->objects) * sizeof(XArc));
vsize = 1;
vsizeinc = (size - 1) / (p->objects - 1);
if (vsizeinc == 0) vsizeinc = 1;
@@ -263,7 +261,7 @@ GenerateEllipses(XParms xp, Parms p, int partialArcs, Bool ddashed)
startAngle = DegreesToX(0);
arcAngle = DegreesToX(360);
- for (i = 0; i != p->objects; i++) {
+ for (int i = 0; i != p->objects; i++) {
arcs[i].x = x;
arcs[i].y = y;
if ((i & 1) ^ dir) {
@@ -454,9 +452,7 @@ InitWideDoubleDashedEllipses(XParms xp, Parms p, int64_t reps)
void
DoArcs(XParms xp, Parms p, int64_t reps)
{
- int i;
-
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
XDrawArcs(xp->d, xp->w, pgc, arcs, p->objects);
if (pgc == xp->ddbggc)
pgc = xp->ddfggc;
@@ -473,9 +469,7 @@ DoArcs(XParms xp, Parms p, int64_t reps)
void
DoFilledArcs(XParms xp, Parms p, int64_t reps)
{
- int i;
-
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
XFillArcs(xp->d, xp->w, pgc, arcs, p->objects);
if (pgc == xp->ddbggc)
pgc = xp->ddfggc;
diff --git a/app/x11perf/do_blt.c b/app/x11perf/do_blt.c
index 87e824f3b..1d8fdbed4 100644
--- a/app/x11perf/do_blt.c
+++ b/app/x11perf/do_blt.c
@@ -37,10 +37,10 @@ static XSegment *segsa2, *segsb2;
static void
InitBltLines(void)
{
- int i, x, y;
+ int x, y;
points[0].x = points[0].y = y = 0;
- for (i = 1; i != NUMPOINTS/2; i++) {
+ for (int i = 1; i != NUMPOINTS/2; i++) {
if (i & 1) {
points[i].x = WIDTH-1;
} else {
@@ -51,7 +51,7 @@ InitBltLines(void)
}
x = 0;
- for (i = NUMPOINTS/2; i!= NUMPOINTS; i++) {
+ for (int i = NUMPOINTS/2; i!= NUMPOINTS; i++) {
if (i & 1) {
points[i].y = HEIGHT-1;
} else {
@@ -73,7 +73,7 @@ InitScroll(XParms xp, Parms p, int64_t reps)
void
DoScroll(XParms xp, Parms p, int64_t reps)
{
- int i, size, x, y, xorg, yorg, delta;
+ int size, x, y, xorg, yorg, delta;
size = p->special;
xorg = 0; yorg = 0;
@@ -88,7 +88,7 @@ DoScroll(XParms xp, Parms p, int64_t reps)
delta = 13;
}
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
XCopyArea(xp->d, xp->w, xp->w, xp->fggc, x, y + delta,
size, size, x, y);
y += size;
@@ -127,7 +127,7 @@ static void
InitCopyLocations(int size, int mul, int div,
int64_t reps, XSegment **ap, XSegment **bp)
{
- int x1, y1, x2, y2, i;
+ int x1, y1, x2, y2;
int xinc, yinc;
int width, height;
XSegment *a, *b;
@@ -149,9 +149,9 @@ InitCopyLocations(int size, int mul, int div,
x2 = width;
y2 = height;
- *ap = a = (XSegment *)malloc(reps * sizeof(XSegment));
- *bp = b = (XSegment *)malloc(reps * sizeof(XSegment));
- for (i = 0; i != reps; i++) {
+ *ap = a = malloc(reps * sizeof(XSegment));
+ *bp = b = malloc(reps * sizeof(XSegment));
+ for (int i = 0; i != reps; i++) {
a[i].x1 = x1 * div / mul;
a[i].y1 = y1 * div / mul;
a[i].x2 = x2 * div / mul;
@@ -716,7 +716,7 @@ EndCompositeWin (XParms xp, Parms p)
static void
CompositeArea(XParms xp, Parms p, int64_t reps, Picture src, Picture dst)
{
- int i, size;
+ int size;
XSegment *sa, *sb;
XSegment *sa2, *sb2;
@@ -726,7 +726,7 @@ CompositeArea(XParms xp, Parms p, int64_t reps, Picture src, Picture dst)
sb = segsb;
sa2 = segsa2 ? segsa2 : segsa;
sb2 = segsb2 ? segsb2 : segsb;
- for (i = 0; i < reps; i++) {
+ for (int i = 0; i < reps; i++) {
XRenderComposite (xp->d, xp->func,
src, None, dst,
sa2->x1, sa2->y1, 0, 0, sa->x2, sa->y2, size, size);
diff --git a/app/x11perf/do_complex.c b/app/x11perf/do_complex.c
index 88f1d4f9a..8fcabe8c3 100644
--- a/app/x11perf/do_complex.c
+++ b/app/x11perf/do_complex.c
@@ -38,7 +38,7 @@ static GC pgc;
int
InitComplexPoly(XParms xp, Parms p, int64_t reps)
{
- int i, j, numPoints;
+ int numPoints;
int x, y;
int size, iradius;
double phi, phiinc, radius, delta, phi2;
@@ -67,12 +67,12 @@ InitComplexPoly(XParms xp, Parms p, int64_t reps)
iradius = (int) radius + 1;
numPoints = (p->objects) * NUM_POINTS;
- points = (XPoint *)malloc(numPoints * sizeof(XPoint));
+ points = malloc(numPoints * sizeof(XPoint));
curPoint = points;
x = iradius;
y = iradius;
- for (i = 0; i != p->objects; i++) {
- for (j = 0; j != NUM_ANGLES; j++) {
+ for (int i = 0; i != p->objects; i++) {
+ for (int j = 0; j != NUM_ANGLES; j++) {
phi2 = phi + ((double) j) * delta;
curPoint->x = (int) ((double)x + (radius * cos(phi2)) + 0.5);
curPoint->y = (int) ((double)y + (radius * sin(phi2)) + 0.5);
@@ -98,12 +98,9 @@ InitComplexPoly(XParms xp, Parms p, int64_t reps)
void
DoComplexPoly(XParms xp, Parms p, int64_t reps)
{
- int i, j;
- XPoint *curPoint;
-
- for (i = 0; i != reps; i++) {
- curPoint = points;
- for (j = 0; j != p->objects; j++) {
+ for (int i = 0; i != reps; i++) {
+ XPoint *curPoint = points;
+ for (int j = 0; j != p->objects; j++) {
XFillPolygon(xp->d, xp->w, pgc, curPoint, NUM_POINTS, Complex,
CoordModeOrigin);
curPoint += NUM_POINTS;
@@ -125,7 +122,7 @@ EndComplexPoly(XParms xp, Parms p)
int
InitGeneralPoly(XParms xp, Parms p, int64_t reps)
{
- int i, j, numPoints;
+ int numPoints;
int nsides;
int x, y;
int size, iradius;
@@ -142,14 +139,14 @@ InitGeneralPoly(XParms xp, Parms p, int64_t reps)
inner_radius = size / sqrt (nsides * tan (PI / nsides));
outer_radius = inner_radius / cos (PI / (2 * nsides));
numPoints = p->objects * nsides;
- points = (XPoint *) malloc (numPoints * sizeof (XPoint));
+ points = malloc (numPoints * sizeof (XPoint));
curPoint = points;
iradius = outer_radius + 1;
x = iradius;
y = iradius;
- for (i = 0; i < p->objects; i++) {
+ for (int i = 0; i < p->objects; i++) {
phi2 = phi;
- for (j = 0; j < nsides; j++) {
+ for (int j = 0; j < nsides; j++) {
curPoint->x = x + (outer_radius * cos(phi2) + 0.5);
curPoint->y = y + (outer_radius * sin(phi2) + 0.5);
curPoint++;
@@ -171,16 +168,14 @@ InitGeneralPoly(XParms xp, Parms p, int64_t reps)
void
DoGeneralPoly(XParms xp, Parms p, int64_t reps)
{
- int i, j;
int nsides;
int mode;
- XPoint *curPoint;
nsides = (long) p->font;
mode = (long) p->bfont;
- for (i = 0; i != reps; i++) {
- curPoint = points;
- for (j = 0; j != p->objects; j++) {
+ for (int i = 0; i != reps; i++) {
+ XPoint *curPoint = points;
+ for (int j = 0; j != p->objects; j++) {
XFillPolygon(xp->d, xp->w, pgc, curPoint, nsides, mode,
CoordModeOrigin);
curPoint += nsides;
diff --git a/app/x11perf/do_dots.c b/app/x11perf/do_dots.c
index fe9ca2eca..38944e079 100644
--- a/app/x11perf/do_dots.c
+++ b/app/x11perf/do_dots.c
@@ -29,13 +29,11 @@ static GC pgc;
int
InitDots(XParms xp, Parms p, int64_t reps)
{
- int i;
-
pgc = xp->fggc;
- points = (XPoint *)malloc(p->objects * sizeof(XPoint));
+ points = malloc(p->objects * sizeof(XPoint));
- for (i = 0; i != p->objects; i++) {
+ for (int i = 0; i != p->objects; i++) {
points[i].x = 2 * (i/MAXROWS);
points[i].y = 2 * (i%MAXROWS);
}
@@ -45,9 +43,7 @@ InitDots(XParms xp, Parms p, int64_t reps)
void
DoDots(XParms xp, Parms p, int64_t reps)
{
- int i;
-
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
XDrawPoints(xp->d, xp->w, pgc, points, p->objects, CoordModeOrigin);
if (pgc == xp->bggc)
pgc = xp->fggc;
diff --git a/app/x11perf/do_lines.c b/app/x11perf/do_lines.c
index d2ad1d607..1cead8651 100644
--- a/app/x11perf/do_lines.c
+++ b/app/x11perf/do_lines.c
@@ -31,7 +31,6 @@ GenerateLines(XParms xp, Parms p, Bool ddashed)
{
int size;
int half; /* Half of width if wide line */
- int i;
int rows; /* Number of rows filled in current column */
int x, y; /* Next point */
int xdir, ydir; /* Which direction x, y are going */
@@ -51,7 +50,7 @@ GenerateLines(XParms xp, Parms p, Bool ddashed)
size4 = 4 * (size+1);
half = (size + 19) / 20;
- points = (XPoint *)malloc((p->objects+1) * sizeof(XPoint));
+ points = malloc((p->objects+1) * sizeof(XPoint));
/* All this x, x1, x1inc, etc. stuff is to create a pattern that
(1) scans down the screen vertically
@@ -76,7 +75,7 @@ GenerateLines(XParms xp, Parms p, Bool ddashed)
points[0].x = x;
points[0].y = y;
- for (i = 1; i != (p->objects+1); i++) {
+ for (int i = 1; i != (p->objects+1); i++) {
phase = phasef;
switch (phase / (size+1)) {
case 0:
@@ -275,9 +274,7 @@ InitWideDoubleDashedLines(XParms xp, Parms p, int64_t reps)
void
DoLines(XParms xp, Parms p, int64_t reps)
{
- int i;
-
- for (i = 0; i != reps; i++)
+ for (int i = 0; i != reps; i++)
{
XDrawLines(xp->d, xp->w, pgc, points, p->objects+1, CoordModeOrigin);
if (pgc == xp->ddbggc)
diff --git a/app/x11perf/do_movewin.c b/app/x11perf/do_movewin.c
index 27b038971..b7f0b44ad 100644
--- a/app/x11perf/do_movewin.c
+++ b/app/x11perf/do_movewin.c
@@ -36,21 +36,19 @@ static int delta1; /* Private global data for DoResizeWindows */
int
InitMoveWindows(XParms xp, Parms p, int64_t reps)
{
- int i = 0;
-
rows = (p->objects + MAXCOLS - 1) / MAXCOLS;
x_offset = 0;
y_offset = 0;
delta1 = 1;
- children = (Window *) malloc (p->objects*sizeof (Window));
- positions = (XPoint *) malloc(p->objects*sizeof(XPoint));
+ children = malloc(p->objects * sizeof (Window));
+ positions = malloc(p->objects * sizeof(XPoint));
xmax = (CHILDSIZE+CHILDSPACE) * (rows > 1 ? MAXCOLS : p->objects);
ymax = rows * (CHILDSIZE+CHILDSPACE);
- for (i = 0; i != p->objects; i++) {
+ for (int i = 0; i != p->objects; i++) {
positions[i].x = (CHILDSIZE+CHILDSPACE) * (i/rows) + CHILDSPACE/2;
positions[i].y = (CHILDSIZE+CHILDSPACE) * (i%rows) + CHILDSPACE/2;
children[i] = XCreateSimpleWindow(xp->d, xp->w,
@@ -65,16 +63,14 @@ InitMoveWindows(XParms xp, Parms p, int64_t reps)
void
DoMoveWindows(XParms xp, Parms p, int64_t reps)
{
- int i, j;
-
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
x_offset += 1;
y_offset += 3;
if (y_offset + ymax > HEIGHT)
y_offset = 0;
if (x_offset + xmax > WIDTH)
x_offset = 0;
- for (j = 0; j != p->objects; j++) {
+ for (int j = 0; j != p->objects; j++) {
XMoveWindow(xp->d, children[j],
positions[j].x + x_offset, positions[j].y + y_offset);
}
@@ -92,12 +88,12 @@ EndMoveWindows(XParms xp, Parms p)
void
DoResizeWindows(XParms xp, Parms p, int64_t reps)
{
- int i, j, delta2;
+ for (int i = 0; i != reps; i++) {
+ int delta2;
- for (i = 0; i != reps; i++) {
delta1 = -delta1;
delta2 = delta1;
- for (j = 0; j != p->objects; j++) {
+ for (int j = 0; j != p->objects; j++) {
delta2 = -delta2;
XResizeWindow(xp->d, children[j],
CHILDSIZE+delta2, CHILDSIZE-delta2);
@@ -109,14 +105,10 @@ DoResizeWindows(XParms xp, Parms p, int64_t reps)
int
InitCircWindows(XParms xp, Parms p, int64_t reps)
{
- int i;
- int pos;
- int color;
-
- children = (Window *) malloc (p->objects * sizeof (Window));
- for (i = 0; i != p->objects; i++) {
- pos = i % STACK;
- color = (i & 1 ? xp->foreground : xp->background);
+ children = malloc (p->objects * sizeof (Window));
+ for (int i = 0; i != p->objects; i++) {
+ int pos = i % STACK;
+ int color = (i & 1 ? xp->foreground : xp->background);
children[i] = XCreateSimpleWindow (xp->d, xp->w,
pos*CHILDSIZE/4 + (i/STACK)*2*CHILDSIZE, pos*CHILDSIZE/4,
CHILDSIZE, CHILDSIZE, 0, color, color);
@@ -129,11 +121,9 @@ InitCircWindows(XParms xp, Parms p, int64_t reps)
void
DoCircWindows(XParms xp, Parms p, int64_t reps)
{
- int i, j;
-
- for (i = 0; i != reps; i++)
+ for (int i = 0; i != reps; i++)
{
- for (j = 0; j != p->objects; j++)
+ for (int j = 0; j != p->objects; j++)
XCirculateSubwindows (xp->d, xp->w, RaiseLowest);
CheckAbort ();
}
@@ -149,16 +139,14 @@ EndCircWindows(XParms xp, Parms p)
int
InitMoveTree(XParms xp, Parms p, int64_t reps)
{
- int i = 0;
-
rows = (p->objects + MAXCOLS - 1) / MAXCOLS;
x_offset = 0;
y_offset = 0;
delta1 = 1;
- children = (Window *) malloc (p->objects*sizeof (Window));
- positions = (XPoint *) malloc(p->objects*sizeof(XPoint));
+ children = malloc(p->objects * sizeof (Window));
+ positions = malloc(p->objects * sizeof(XPoint));
xmax = (CHILDSIZE+CHILDSPACE) * (rows > 1 ? MAXCOLS : p->objects);
ymax = rows * (CHILDSIZE+CHILDSPACE);
@@ -167,7 +155,7 @@ InitMoveTree(XParms xp, Parms p, int64_t reps)
0, 0, xmax, ymax, 0,
xp->background, xp->background);
- for (i = 0; i != p->objects; i++) {
+ for (int i = 0; i != p->objects; i++) {
positions[i].x = (CHILDSIZE+CHILDSPACE) * (i/rows) + CHILDSPACE/2;
positions[i].y = (CHILDSIZE+CHILDSPACE) * (i%rows) + CHILDSPACE/2;
children[i] = XCreateSimpleWindow(xp->d, cover,
@@ -182,9 +170,7 @@ InitMoveTree(XParms xp, Parms p, int64_t reps)
void
DoMoveTree(XParms xp, Parms p, int64_t reps)
{
- int i;
-
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
x_offset += 1;
y_offset += 3;
if (y_offset + ymax > HEIGHT)
diff --git a/app/x11perf/do_rects.c b/app/x11perf/do_rects.c
index b4507bc56..4c03d9ca7 100644
--- a/app/x11perf/do_rects.c
+++ b/app/x11perf/do_rects.c
@@ -30,7 +30,6 @@ static GC pgc;
int
InitRectangles(XParms xp, Parms p, int64_t reps)
{
- int i;
int size = p->special;
int step;
int x, y;
@@ -48,7 +47,7 @@ InitRectangles(XParms xp, Parms p, int64_t reps)
lw = (lw >> 1) + 1;
}
- rects = (XRectangle *)malloc(p->objects * sizeof(XRectangle));
+ rects = malloc(p->objects * sizeof(XRectangle));
x = lw;
y = lw;
rows = 0;
@@ -61,7 +60,7 @@ InitRectangles(XParms xp, Parms p, int64_t reps)
step = size + 1 + (size % 2);
}
- for (i = 0; i != p->objects; i++) {
+ for (int i = 0; i != p->objects; i++) {
rects[i].x = x;
rects[i].y = y;
rects[i].width = rects[i].height = size;
@@ -86,9 +85,7 @@ InitRectangles(XParms xp, Parms p, int64_t reps)
void
DoRectangles(XParms xp, Parms p, int64_t reps)
{
- int i;
-
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
XFillRectangles(xp->d, xp->w, pgc, rects, p->objects);
if (pgc == xp->bggc)
pgc = xp->fggc;
@@ -101,9 +98,7 @@ DoRectangles(XParms xp, Parms p, int64_t reps)
void
DoOutlineRectangles(XParms xp, Parms p, int64_t reps)
{
- int i;
-
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
XDrawRectangles (xp->d, xp->w, pgc, rects, p->objects);
if (pgc == xp->bggc)
pgc = xp->fggc;
diff --git a/app/x11perf/do_segs.c b/app/x11perf/do_segs.c
index 369f7848c..db1cd46c2 100644
--- a/app/x11perf/do_segs.c
+++ b/app/x11perf/do_segs.c
@@ -50,7 +50,7 @@ GenerateSegments(XParms xp, Parms p, Bool ddashed)
size8 = 8 * size;
half = (size + 19) / 20;
- segments = (XSegment *)malloc((p->objects) * sizeof(XSegment));
+ segments = malloc((p->objects) * sizeof(XSegment));
/* All this x, x1, etc. stuff is to create a pattern that
(1) scans down the screen vertically, with each new segment going
@@ -225,7 +225,7 @@ InitHorizSegments(XParms xp, Parms p, int64_t reps)
size = p->special;
half = (size + 19) / 20;
- segments = (XSegment *)malloc((p->objects) * sizeof(XSegment));
+ segments = malloc((p->objects) * sizeof(XSegment));
x = half;
y = half;
@@ -298,7 +298,7 @@ InitVertSegments(XParms xp, Parms p, int64_t reps)
size = p->special;
half = (size + 19) / 20;
- segments = (XSegment *)malloc((p->objects) * sizeof(XSegment));
+ segments = malloc((p->objects) * sizeof(XSegment));
x = half;
y = half;
diff --git a/app/x11perf/do_simple.c b/app/x11perf/do_simple.c
index d6c4d59a3..29970a6af 100644
--- a/app/x11perf/do_simple.c
+++ b/app/x11perf/do_simple.c
@@ -34,9 +34,7 @@ static Atom XA_PK_TEMP;
void
DoNoOp(XParms xp, Parms p, int64_t reps)
{
- int i;
-
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
XNoOp(xp->d);
CheckAbort ();
}
@@ -46,11 +44,8 @@ DoNoOp(XParms xp, Parms p, int64_t reps)
void
DoGetAtom(XParms xp, Parms p, int64_t reps)
{
- char *atom;
- int i;
-
- for (i = 0; i != reps; i++) {
- atom = XGetAtomName (xp->d, 1);
+ for (int i = 0; i != reps; i++) {
+ char *atom = XGetAtomName (xp->d, 1);
XFree(atom); /* fix XBUG 6480 */
CheckAbort ();
}
@@ -59,12 +54,11 @@ DoGetAtom(XParms xp, Parms p, int64_t reps)
void
DoQueryPointer(XParms xp, Parms p, int64_t reps)
{
- int i;
- Window w;
- int x;
- unsigned int m;
+ for (int i = 0; i != reps; i++) {
+ Window w;
+ int x;
+ unsigned int m;
- for (i = 0; i != reps; i++) {
XQueryPointer (xp->d, xp->w, &w, &w, &x, &x, &x, &x, &m);
CheckAbort ();
}
@@ -89,14 +83,12 @@ InitGetProperty(XParms xp, Parms p, int64_t reps)
void
DoGetProperty(XParms xp, Parms p, int64_t reps)
{
- int i;
- int actual_format;
- unsigned long actual_length, bytes_remaining;
- unsigned char *prop;
-
- Atom actual_type;
-
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
+ int actual_format;
+ unsigned long actual_length, bytes_remaining;
+ unsigned char *prop;
+ Atom actual_type;
+
XGetWindowProperty (
xp->d, xp->w, XA_PK_TEMP, 0, 4,
False, AnyPropertyType, &actual_type, &actual_format,
diff --git a/app/x11perf/do_text.c b/app/x11perf/do_text.c
index 01845e174..34947b923 100644
--- a/app/x11perf/do_text.c
+++ b/app/x11perf/do_text.c
@@ -37,8 +37,6 @@ static int charsPerLine, totalLines;
int
InitText(XParms xp, Parms p, int64_t reps)
{
- int i, j;
- char ch;
XGCValues gcv;
font = XLoadQueryFont(xp->d, p->font);
@@ -74,14 +72,16 @@ InitText(XParms xp, Parms p, int64_t reps)
totalLines = '\177' - ' ' + 1;
if (totalLines > reps) totalLines = reps;
- charBuf = (char **) malloc(totalLines*sizeof (char *));
+ charBuf = malloc(totalLines * sizeof (char *));
if (p->special)
- items = (XTextItem *) malloc(totalLines*SEGS*sizeof (XTextItem));
+ items = malloc(totalLines * SEGS * sizeof (XTextItem));
- for (i = 0; i != totalLines; i++) {
- charBuf[i] = (char *) malloc (sizeof (char)*charsPerLine);
+ for (int i = 0; i != totalLines; i++) {
+ char ch;
+
+ charBuf[i] = malloc (sizeof (char) * charsPerLine);
ch = i + ' ';
- for (j = 0; j != charsPerLine; j++) {
+ for (int j = 0; j != charsPerLine; j++) {
charBuf[i][j] = ch;
if (ch == '\177') ch = ' '; else ch++;
}
@@ -121,8 +121,6 @@ InitText(XParms xp, Parms p, int64_t reps)
int
InitText16(XParms xp, Parms p, int64_t reps)
{
- register int i, j;
- register char *pbuf0, *pbuf1, *pbuf2;
XGCValues gcv;
int rows, columns, totalChars, ch;
int brows, bcolumns = 0, btotalChars = 0, bch = 0;
@@ -171,25 +169,27 @@ InitText16(XParms xp, Parms p, int64_t reps)
charsPerLine = (charsPerLine + 3) & ~3; /* make a multiple of four */
p->objects = charsPerLine;
- items = (XTextItem *) malloc(totalLines*SEGS*sizeof (XTextItem));
+ items = malloc(totalLines * SEGS * sizeof (XTextItem));
+
+ for (int i = 0; i < totalLines; i++) {
+ char *pbuf0, *pbuf1, *pbuf2;
- for (i = 0; i < totalLines; i++) {
pbuf0 = items[i*SEGS+0].chars =
- (char *) malloc (sizeof (char)*charsPerLine/2);
+ malloc (sizeof (char) * charsPerLine/2);
items[i*SEGS+0].nchars = charsPerLine/4;
items[i*SEGS+0].delta = 0;
items[i*SEGS+0].font = font->fid;
pbuf1 = items[i*SEGS+1].chars =
- (char *) malloc (sizeof (char)*charsPerLine);
+ malloc (sizeof (char) * charsPerLine);
items[i*SEGS+1].nchars = charsPerLine/2;
items[i*SEGS+1].delta = 3;
items[i*SEGS+1].font = bfont->fid;
pbuf2 = items[i*SEGS+2].chars =
- (char *) malloc (sizeof (char)*charsPerLine/2);
+ malloc (sizeof (char) * charsPerLine/2);
items[i*SEGS+2].nchars = charsPerLine/4;
items[i*SEGS+2].delta = 3;
items[i*SEGS+2].font = font->fid;
- for (j = 0; j < charsPerLine/4; j++) {
+ for (int j = 0; j < charsPerLine/4; j++) {
GetRealChar(font, totalChars, ch);
*pbuf0++ = ch / columns + font->min_byte1;
*pbuf0++ = ch % columns + font->min_char_or_byte2;
@@ -197,17 +197,18 @@ InitText16(XParms xp, Parms p, int64_t reps)
*pbuf2++ = ch / columns + font->min_byte1;
*pbuf2++ = ch % columns + font->min_char_or_byte2;
}
- for (j = 0; j < charsPerLine/2; j++) {
+ for (int j = 0; j < charsPerLine/2; j++) {
GetRealChar(bfont, btotalChars, bch);
*pbuf1++ = bch / bcolumns + bfont->min_byte1;
*pbuf1++ = bch % bcolumns + bfont->min_char_or_byte2;
}
}
} else {
- charBuf = (char **) malloc(totalLines*sizeof (char *));
- for (i = 0; i < totalLines; i++) {
- pbuf0 = charBuf[i] = (char *) malloc (sizeof (char)*charsPerLine*2);
- for (j = 0; j < charsPerLine; j++) {
+ charBuf = malloc(totalLines * sizeof (char *));
+ for (int i = 0; i < totalLines; i++) {
+ char *pbuf0 = charBuf[i] =
+ malloc (sizeof (char) * charsPerLine * 2);
+ for (int j = 0; j < charsPerLine; j++) {
GetRealChar(font, totalChars, ch);
*pbuf0++ = ch / columns + font->min_byte1;
*pbuf0++ = ch % columns + font->min_char_or_byte2;
@@ -220,11 +221,11 @@ InitText16(XParms xp, Parms p, int64_t reps)
void
DoText(XParms xp, Parms p, int64_t reps)
{
- int i, line, startLine;
+ int line, startLine;
startLine = 0;
line = 0;
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
XDrawString(
xp->d, xp->w, xp->fggc, XPOS, ypos, charBuf[line], charsPerLine);
ypos += height;
@@ -242,11 +243,11 @@ DoText(XParms xp, Parms p, int64_t reps)
void
DoText16(XParms xp, Parms p, int64_t reps)
{
- int i, line, startLine;
+ int line, startLine;
startLine = 0;
line = 0;
- for (i = 0; i < reps; i++) {
+ for (int i = 0; i < reps; i++) {
XDrawString16(
xp->d, xp->w, xp->fggc, XPOS, ypos, (XChar2b *)charBuf[line], charsPerLine);
ypos += height;
@@ -264,11 +265,11 @@ DoText16(XParms xp, Parms p, int64_t reps)
void
DoPolyText(XParms xp, Parms p, int64_t reps)
{
- int i, line, startLine;
+ int line, startLine;
startLine = 0;
line = 0;
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
XDrawText(
xp->d, xp->w, xp->fggc, XPOS, ypos, &items[line*SEGS], SEGS);
ypos += height;
@@ -286,11 +287,11 @@ DoPolyText(XParms xp, Parms p, int64_t reps)
void
DoPolyText16(XParms xp, Parms p, int64_t reps)
{
- int i, line, startLine;
+ int line, startLine;
startLine = 0;
line = 0;
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
XDrawText16(
xp->d, xp->w, xp->fggc, XPOS, ypos, (XTextItem16 *)&items[line*SEGS], SEGS);
ypos += height;
@@ -308,11 +309,11 @@ DoPolyText16(XParms xp, Parms p, int64_t reps)
void
DoImageText(XParms xp, Parms p, int64_t reps)
{
- int i, line, startLine;
+ int line, startLine;
startLine = 0;
line = 0;
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
XDrawImageString(
xp->d, xp->w, xp->fggc, XPOS, ypos, charBuf[line], charsPerLine);
ypos += height;
@@ -330,11 +331,11 @@ DoImageText(XParms xp, Parms p, int64_t reps)
void
DoImageText16(XParms xp, Parms p, int64_t reps)
{
- int i, line, startLine;
+ int line, startLine;
startLine = 0;
line = 0;
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
XDrawImageString16(
xp->d, xp->w, xp->fggc, XPOS, ypos, (XChar2b *)charBuf[line], charsPerLine);
ypos += height;
@@ -358,10 +359,8 @@ ClearTextWin(XParms xp, Parms p)
void
EndText(XParms xp, Parms p)
{
- int i;
-
if(font==NULL)return;
- for (i = 0; i != totalLines; i++)
+ for (int i = 0; i != totalLines; i++)
free(charBuf[i]);
free(charBuf);
if (p->special)
@@ -374,18 +373,16 @@ EndText(XParms xp, Parms p)
void
EndText16(XParms xp, Parms p)
{
- int i;
-
if(font==NULL)return;
if (p->special) {
- for (i = 0; i < totalLines; i++) {
+ for (int i = 0; i < totalLines; i++) {
free(items[i*SEGS+0].chars);
free(items[i*SEGS+1].chars);
free(items[i*SEGS+2].chars);
}
free(items);
} else {
- for (i = 0; i < totalLines; i++) {
+ for (int i = 0; i < totalLines; i++) {
free(charBuf[i]);
}
free(charBuf);
@@ -407,7 +404,6 @@ static XftColor aacolor;
int
InitAAText(XParms xp, Parms p, int64_t reps)
{
- int i, j;
char ch;
XRenderColor color;
@@ -457,12 +453,12 @@ InitAAText(XParms xp, Parms p, int64_t reps)
totalLines = '\177' - ' ' + 1;
if (totalLines > reps) totalLines = reps;
- charBuf = (char **) malloc(totalLines*sizeof (char *));
+ charBuf = malloc(totalLines * sizeof (char *));
- for (i = 0; i != totalLines; i++) {
- charBuf[i] = (char *) malloc (sizeof (char)*charsPerLine);
+ for (int i = 0; i != totalLines; i++) {
+ charBuf[i] = malloc (sizeof (char) * charsPerLine);
ch = i + ' ';
- for (j = 0; j != charsPerLine; j++) {
+ for (int j = 0; j != charsPerLine; j++) {
charBuf[i][j] = ch;
if (ch == '\177') ch = ' '; else ch++;
}
@@ -473,11 +469,11 @@ InitAAText(XParms xp, Parms p, int64_t reps)
void
DoAAText(XParms xp, Parms p, int64_t reps)
{
- int i, line, startLine;
+ int line, startLine;
startLine = 0;
line = 0;
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
XftDrawString8 (aadraw, &aacolor, aafont,
XPOS, ypos, (unsigned char *) charBuf[line], charsPerLine);
ypos += height;
@@ -495,10 +491,8 @@ DoAAText(XParms xp, Parms p, int64_t reps)
void
EndAAText(XParms xp, Parms p)
{
- int i;
-
if(!aadraw)return;
- for (i = 0; i != totalLines; i++)
+ for (int i = 0; i != totalLines; i++)
free(charBuf[i]);
free(charBuf);
XftDrawDestroy (aadraw);
diff --git a/app/x11perf/do_traps.c b/app/x11perf/do_traps.c
index 1c33ab0d5..0f5d16861 100644
--- a/app/x11perf/do_traps.c
+++ b/app/x11perf/do_traps.c
@@ -31,7 +31,7 @@ static GC pgc;
int
InitTrapezoids(XParms xp, Parms p, int64_t reps)
{
- int i, numPoints;
+ int numPoints;
int rows;
int x, y;
int size, skew;
@@ -41,14 +41,14 @@ InitTrapezoids(XParms xp, Parms p, int64_t reps)
size = p->special;
numPoints = (p->objects) * NUM_POINTS;
- points = (XPoint *)malloc(numPoints * sizeof(XPoint));
+ points = malloc(numPoints * sizeof(XPoint));
curPoint = points;
x = size;
y = 0;
rows = 0;
skew = size;
- for (i = 0; i != p->objects; i++, curPoint += NUM_POINTS) {
+ for (int i = 0; i != p->objects; i++, curPoint += NUM_POINTS) {
curPoint[0].x = x - skew;
curPoint[0].y = y;
curPoint[1].x = x - skew + size;
@@ -80,12 +80,9 @@ InitTrapezoids(XParms xp, Parms p, int64_t reps)
void
DoTrapezoids(XParms xp, Parms p, int64_t reps)
{
- int i, j;
- XPoint *curPoint;
-
- for (i = 0; i != reps; i++) {
- curPoint = points;
- for (j = 0; j != p->objects; j++) {
+ for (int i = 0; i != reps; i++) {
+ XPoint *curPoint = points;
+ for (int j = 0; j != p->objects; j++) {
XFillPolygon(xp->d, xp->w, pgc, curPoint, NUM_POINTS, Convex,
CoordModeOrigin);
curPoint += NUM_POINTS;
@@ -120,7 +117,7 @@ static Picture mask;
int
InitFixedTraps(XParms xp, Parms p, int64_t reps)
{
- int i, numTraps;
+ int numTraps;
int rows;
int x, y;
int size, skew;
@@ -139,7 +136,7 @@ InitFixedTraps(XParms xp, Parms p, int64_t reps)
size = p->special;
numTraps = p->objects;
- traps = (XTrap *)malloc(numTraps * sizeof(XTrap));
+ traps = malloc(numTraps * sizeof(XTrap));
curTrap = traps;
x = size;
y = 0;
@@ -168,6 +165,8 @@ InitFixedTraps(XParms xp, Parms p, int64_t reps)
break;
}
maskFormat = XRenderFindStandardFormat (xp->d, std_fmt);
+ if (!maskFormat)
+ return 0;
maskPixmap = XCreatePixmap (xp->d, xp->w, WIDTH, HEIGHT, depth);
@@ -202,7 +201,7 @@ InitFixedTraps(XParms xp, Parms p, int64_t reps)
if (width == 0)
width = size;
- for (i = 0; i != p->objects; i++, curTrap ++) {
+ for (int i = 0; i != p->objects; i++, curTrap ++) {
curTrap->top.y = XDoubleToFixed (y);
curTrap->top.left = XDoubleToFixed (x - skew);
curTrap->top.right = XDoubleToFixed (x - skew + width);
@@ -232,7 +231,6 @@ InitFixedTraps(XParms xp, Parms p, int64_t reps)
void
DoFixedTraps(XParms xp, Parms p, int64_t reps)
{
- int i;
Picture white, black, src, dst;
white = XftDrawSrcPicture (aadraw, &aawhite);
@@ -240,7 +238,7 @@ DoFixedTraps(XParms xp, Parms p, int64_t reps)
dst = XftDrawPicture (aadraw);
src = black;
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
XRenderFillRectangle (xp->d, PictOpSrc, mask, &transparent,
0, 0, WIDTH, HEIGHT);
XRenderAddTraps (xp->d, mask, 0, 0, traps, p->objects);
@@ -266,7 +264,7 @@ EndFixedTraps (XParms xp, Parms p)
int
InitFixedTrapezoids(XParms xp, Parms p, int64_t reps)
{
- int i, numTraps;
+ int numTraps;
int rows;
int x, y;
int size, skew;
@@ -277,7 +275,7 @@ InitFixedTrapezoids(XParms xp, Parms p, int64_t reps)
size = p->special;
numTraps = p->objects;
- trapezoids = (XTrapezoid *)malloc(numTraps * sizeof(XTrapezoid));
+ trapezoids = malloc(numTraps * sizeof(XTrapezoid));
curTrap = trapezoids;
x = size;
y = 0;
@@ -330,7 +328,7 @@ InitFixedTrapezoids(XParms xp, Parms p, int64_t reps)
return 0;
}
- for (i = 0; i != p->objects; i++, curTrap ++) {
+ for (int i = 0; i != p->objects; i++, curTrap++) {
curTrap->top = XDoubleToFixed (y);
curTrap->bottom = XDoubleToFixed (y + size);
curTrap->left.p1.x = XDoubleToFixed (x - skew);
@@ -366,7 +364,6 @@ InitFixedTrapezoids(XParms xp, Parms p, int64_t reps)
void
DoFixedTrapezoids(XParms xp, Parms p, int64_t reps)
{
- int i;
Picture white, black, src, dst;
white = XftDrawSrcPicture (aadraw, &aawhite);
@@ -374,7 +371,7 @@ DoFixedTrapezoids(XParms xp, Parms p, int64_t reps)
dst = XftDrawPicture (aadraw);
src = black;
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
XRenderCompositeTrapezoids (xp->d, PictOpOver, src, dst, maskFormat,
0, 0, trapezoids, p->objects);
if (src == black)
diff --git a/app/x11perf/do_tris.c b/app/x11perf/do_tris.c
index 0a8d51170..1e1d3b93c 100644
--- a/app/x11perf/do_tris.c
+++ b/app/x11perf/do_tris.c
@@ -1,3 +1,6 @@
+
+
+
/*****************************************************************************
Copyright 1988, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
@@ -58,7 +61,7 @@ Distance(XPoint p1, XPoint p2)
int
InitTriangles(XParms xp, Parms p, int64_t reps)
{
- int i, j, numPoints;
+ int numPoints;
int rows;
int x, y;
int size, iradius;
@@ -88,15 +91,15 @@ InitTriangles(XParms xp, Parms p, int64_t reps)
iradius = (int) (radius + 0.5);
numPoints = (p->objects) * NUM_POINTS;
- points = (XPoint *)malloc(numPoints * sizeof(XPoint));
+ points = malloc(numPoints * sizeof(XPoint));
curPoint = points;
x = iradius;
y = iradius;
rows = 0;
aarea = 0.0;
- for (i = 0; i != p->objects; i++) {
- for (j = 0; j != NUM_POINTS; j++) {
+ for (int i = 0; i != p->objects; i++) {
+ for (int j = 0; j != NUM_POINTS; j++) {
phi2 = phi + ((double) j) * delta;
curPoint->x = (int) ((double)x + (radius * cos(phi2)) + 0.5);
curPoint->y = (int) ((double)y + (radius * sin(phi2)) + 0.5);
@@ -134,12 +137,9 @@ InitTriangles(XParms xp, Parms p, int64_t reps)
void
DoTriangles(XParms xp, Parms p, int64_t reps)
{
- int i, j;
- XPoint *curPoint;
-
- for (i = 0; i != reps; i++) {
- curPoint = points;
- for (j = 0; j != p->objects; j++) {
+ for (int i = 0; i != reps; i++) {
+ XPoint *curPoint = points;
+ for (int j = 0; j != p->objects; j++) {
XFillPolygon(xp->d, xp->w, pgc, curPoint, NUM_POINTS, Convex,
CoordModeOrigin);
curPoint += NUM_POINTS;
@@ -209,10 +209,7 @@ XPolyTriangle(register Display *dpy,
void
DoTriangles(XParms xp, Parms p, int64_t reps)
{
- int i, j;
- XPoint *curPoint;
-
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
XPolyTriangle (xp->d, xp->w, pgc, points, p->objects, Convex,
CoordModeOrigin);
if (pgc == xp->bggc)
diff --git a/app/x11perf/do_valgc.c b/app/x11perf/do_valgc.c
index 68559f960..8edf7647d 100644
--- a/app/x11perf/do_valgc.c
+++ b/app/x11perf/do_valgc.c
@@ -44,10 +44,9 @@ InitGC(XParms xp, Parms p, int64_t reps)
void
DoChangeGC(XParms xp, Parms p, int64_t reps)
{
- int i;
XGCValues gcv;
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
gcv.foreground = xp->foreground;
XChangeGC(xp->d, xp->fggc, GCForeground , &gcv);
XDrawPoint(xp->d, win[0], xp->fggc, 5, 5);
diff --git a/app/x11perf/do_windows.c b/app/x11perf/do_windows.c
index ebd095a42..490b290e6 100644
--- a/app/x11perf/do_windows.c
+++ b/app/x11perf/do_windows.c
@@ -44,8 +44,6 @@ ComputeSizes(XParms xp, Parms p)
int
CreateParents(XParms xp, Parms p, int64_t reps)
{
- int i;
-
ComputeSizes(xp, p);
parentcolumns = WIDTH / parentwidth;
@@ -59,8 +57,8 @@ CreateParents(XParms xp, Parms p, int64_t reps)
/* We will do parentwindows sets of childwindows, in order to get better
timing accuracy. Creating 4 windows at a millisecond apiece or so
is a bit faster than the 60 Hz clock. */
- isolates = (Window *)malloc(parentwindows * sizeof(Window));
- parents = (Window *)malloc(parentwindows * sizeof(Window));
+ isolates = malloc(parentwindows * sizeof(Window));
+ parents = malloc(parentwindows * sizeof(Window));
/*
* Create isolation windows for the parents, and then the parents
@@ -70,7 +68,7 @@ CreateParents(XParms xp, Parms p, int64_t reps)
* the number of children we are trying to get benchmarks on.
*/
- for (i = 0; i != parentwindows; i++) {
+ for (int i = 0; i != parentwindows; i++) {
isolates[i] = XCreateSimpleWindow(xp->d, xp->w,
(i/parentrows)*parentwidth, (i%parentrows)*parentheight,
parentwidth, parentheight, 0, xp->background, xp->background);
@@ -86,9 +84,7 @@ CreateParents(XParms xp, Parms p, int64_t reps)
void
MapParents(XParms xp, Parms p, int64_t reps)
{
- int i;
-
- for (i = 0; i != parentwindows; i++) {
+ for (int i = 0; i != parentwindows; i++) {
XMapWindow(xp->d, parents[i]);
}
}
@@ -96,9 +92,7 @@ MapParents(XParms xp, Parms p, int64_t reps)
void
MapParentsCleanup(XParms xp, Parms p)
{
- int i;
-
- for (i = 0; i != parentwindows; i++) {
+ for (int i = 0; i != parentwindows; i++) {
XMapWindow(xp->d, parents[i]);
}
}
@@ -115,9 +109,7 @@ InitCreate(XParms xp, Parms p, int64_t reps)
static void
CreateChildGroup(XParms xp, Parms p, Window parent)
{
- int j;
-
- for (j = 0; j != childwindows; j++) {
+ for (int j = 0; j != childwindows; j++) {
(void) XCreateSimpleWindow (xp->d, parent,
(CHILDSIZE+CHILDSPACE) * (j/childrows) + CHILDSPACE/2,
(CHILDSIZE+CHILDSPACE) * (j%childrows) + CHILDSPACE/2,
@@ -131,9 +123,7 @@ CreateChildGroup(XParms xp, Parms p, Window parent)
void
CreateChildren(XParms xp, Parms p, int64_t reps)
{
- int i;
-
- for (i = 0; i != parentwindows; i++) {
+ for (int i = 0; i != parentwindows; i++) {
CreateChildGroup(xp, p, parents[i]);
} /* end i */
}
@@ -141,9 +131,7 @@ CreateChildren(XParms xp, Parms p, int64_t reps)
void
DestroyChildren(XParms xp, Parms p)
{
- int i;
-
- for (i = 0; i != parentwindows; i++) {
+ for (int i = 0; i != parentwindows; i++) {
XDestroySubwindows(xp->d, parents[i]);
}
}
@@ -168,9 +156,7 @@ InitMap(XParms xp, Parms p, int64_t reps)
void
UnmapParents(XParms xp, Parms p, int64_t reps)
{
- int i;
-
- for (i = 0; i != parentwindows; i++) {
+ for (int i = 0; i != parentwindows; i++) {
XUnmapWindow(xp->d, parents[i]);
}
}
@@ -178,9 +164,7 @@ UnmapParents(XParms xp, Parms p, int64_t reps)
void
UnmapParentsCleanup(XParms xp, Parms p)
{
- int i;
-
- for (i = 0; i != parentwindows; i++) {
+ for (int i = 0; i != parentwindows; i++) {
XUnmapWindow(xp->d, parents[i]);
}
}
@@ -197,9 +181,7 @@ InitDestroy(XParms xp, Parms p, int64_t reps)
void
DestroyParents(XParms xp, Parms p, int64_t reps)
{
- int i;
-
- for (i = 0; i != parentwindows; i++) {
+ for (int i = 0; i != parentwindows; i++) {
XDestroyWindow(xp->d, parents[i]);
}
}
@@ -208,9 +190,7 @@ DestroyParents(XParms xp, Parms p, int64_t reps)
void
RenewParents(XParms xp, Parms p)
{
- int i;
-
- for (i = 0; i != parentwindows; i++) {
+ for (int i = 0; i != parentwindows; i++) {
parents[i] = XCreateSimpleWindow(xp->d, isolates[i],
0, 0, parentwidth, parentheight, 0, xp->background, xp->background);
}
@@ -262,8 +242,7 @@ InitPopups(XParms xp, Parms p, int64_t reps)
void
DoPopUps(XParms xp, Parms p, int64_t reps)
{
- int i;
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
XMapWindow(xp->d, popup);
XUnmapWindow(xp->d, popup);
CheckAbort ();
diff --git a/app/x11perf/man/Makefile.in b/app/x11perf/man/Makefile.in
index a06efdc65..053d25433 100644
--- a/app/x11perf/man/Makefile.in
+++ b/app/x11perf/man/Makefile.in
@@ -230,6 +230,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
diff --git a/app/x11perf/x11perf.c b/app/x11perf/x11perf.c
index e98cca577..578292353 100644
--- a/app/x11perf/x11perf.c
+++ b/app/x11perf/x11perf.c
@@ -289,12 +289,10 @@ RoundTo3Digits(double d)
static void
ReportTimes(double usecs, int64_t n, char *str, int average)
{
- double msecsperobj, objspersec;
-
if(usecs != 0.0)
{
- msecsperobj = usecs / (1000.0 * (double)n);
- objspersec = (double) n * 1000000.0 / usecs;
+ double msecsperobj = usecs / (1000.0 * (double)n);
+ double objspersec = (double) n * 1000000.0 / usecs;
/* Round obj/sec to 3 significant digits. Leave msec untouched, to
allow averaging results from several repetitions. */
@@ -324,7 +322,7 @@ static char *program_name;
static void usage(void) _X_NORETURN;
/*
- * Get_Display_Name (argc, argv) Look for -display, -d, or host:dpy (obselete)
+ * Get_Display_Name (argc, argv) Look for -display, -d, or host:dpy (obsolete)
* If found, remove it from command line. Don't go past a lone -.
*/
static char *
@@ -334,9 +332,8 @@ Get_Display_Name(int *pargc, /* MODIFIED */
int argc = *pargc;
char **pargv = argv+1;
char *displayname = NULL;
- int i;
- for (i = 1; i != argc; i++) {
+ for (int i = 1; i != argc; i++) {
char *arg = argv[i];
if (!strcmp (arg, "-display") || !strcmp (arg, "-d")) {
@@ -370,10 +367,9 @@ GetVersion(int *pargc, /* MODIFIED */
int argc = *pargc;
char **pargv = argv+1;
Version version = VERSION1_6;
- int i;
Bool found = False;
- for (i = 1; i != argc; i++) {
+ for (int i = 1; i != argc; i++) {
char *arg = argv[i];
if (!strcmp (arg, "-v1.2")) {
@@ -549,9 +545,7 @@ HardwareSync(XParms xp)
static void
DoHardwareSync(XParms xp, Parms p, int64_t reps)
{
- int i;
-
- for (i = 0; i != reps; i++) {
+ for (int i = 0; i != reps; i++) {
HardwareSync(xp);
CheckAbort ();
}
@@ -600,12 +594,11 @@ CreatePerfWindow(XParms xp, int x, int y, int width, int height)
static void
CreateClipWindows(XParms xp, int clips)
{
- int j;
XWindowAttributes xwa;
(void) XGetWindowAttributes(xp->d, xp->w, &xwa);
if (clips > MAXCLIP) clips = MAXCLIP;
- for (j = 0; j != clips; j++) {
+ for (int j = 0; j != clips; j++) {
clipWindows[j] = CreatePerfWindow(xp,
xwa.x + ws[j].x, xwa.y + ws[j].y, ws[j].width, ws[j].height);
}
@@ -615,10 +608,8 @@ CreateClipWindows(XParms xp, int clips)
static void
DestroyClipWindows(XParms xp, int clips)
{
- int j;
-
if (clips > MAXCLIP) clips = MAXCLIP;
- for (j = 0; j != clips; j++) {
+ for (int j = 0; j != clips; j++) {
XDestroyWindow(xp->d, clipWindows[j]);
}
} /* DestroyClipWindows */
@@ -832,7 +823,6 @@ ProcessTest(XParms xp, Test *test, int func, unsigned long pm, char *label)
{
double time, totalTime;
long long reps;
- int j;
xp->planemask = pm;
xp->func = func;
@@ -862,7 +852,7 @@ ProcessTest(XParms xp, Test *test, int func, unsigned long pm, char *label)
CreateClipWindows(xp, test->clips);
totalTime = 0.0;
- for (j = 0; j != repeat; j++) {
+ for (int j = 0; j != repeat; j++) {
DisplayStatus(xp->d, "Testing", label, j+1);
time = DoTest(xp, test, reps);
if (abortTest)
@@ -911,7 +901,7 @@ main(int argc, char *argv[])
/* Save away argv, argc, for usage to print out */
saveargc = argc;
- saveargv = (char **) malloc(argc * sizeof(char *));
+ saveargv = malloc(argc * sizeof(char *));
for (i = 0; i != argc; i++) {
saveargv[i] = argv[i];
}
@@ -922,7 +912,7 @@ main(int argc, char *argv[])
/* Count number of tests */
ForEachTest(numTests);
- doit = (Bool *)calloc(numTests, sizeof(Bool));
+ doit = calloc(numTests, sizeof(Bool));
/* Parse arguments */
program_name = argv[0];
@@ -1119,7 +1109,6 @@ main(int argc, char *argv[])
/* Just print out list of tests for use with .sh programs that
assemble data from different x11perf runs into a nice format */
ForEachTest (i) {
- int child;
if (doit[i]) {
switch (test[i].testType) {
case NONROP:
@@ -1162,7 +1151,7 @@ main(int argc, char *argv[])
break;
case WINDOW:
- for (child = 0; child != numSubWindows; child++) {
+ for (int child = 0; child != numSubWindows; child++) {
printf ("%s (%ld kids)\n",
LABELP(i), subWindows[child]);
}
@@ -1327,7 +1316,6 @@ main(int argc, char *argv[])
printf("Sync time adjustment is %6.4f msecs.\n\n", syncTime/1000);
ForEachTest (i) {
- int child;
char label[200];
if (doit[i] && (test[i].versions & xparms.version)) {
@@ -1379,7 +1367,7 @@ main(int argc, char *argv[])
case WINDOW:
/* Loop through number of children array */
- for (child = 0; child != numSubWindows; child++) {
+ for (int child = 0; child != numSubWindows; child++) {
test[i].parms.objects = subWindows[child];
sprintf(label, "%s (%d kids)",
LABELP(i), test[i].parms.objects);
@@ -1468,12 +1456,10 @@ GetNumbers (int argi, int argc, char **argv, unsigned long *intsp, int *nump)
{
char *words[256];
int count;
- int i;
- int flip;
count = GetWords (argi, argc, argv, words, nump);
- for (i = 0; i < count; i++) {
- flip = 0;
+ for (int i = 0; i < count; i++) {
+ int flip = 0;
if (!strncmp (words[i], "~", 1)) {
words[i]++;
flip = ~0;
@@ -1491,11 +1477,10 @@ GetRops (int argi, int argc, char **argv, int *ropsp, int *nump)
{
char *words[256];
int count;
- int i;
int rop;
count = GetWords (argi, argc, argv, words, nump);
- for (i = 0; i < count; i++) {
+ for (int i = 0; i < count; i++) {
if (!strncmp (words[i], "GX", 2))
words[i] += 2;
if (!strcmp (words[i], "all")) {
@@ -1563,8 +1548,7 @@ FormatFromName (char *name)
static const char *
NameFromFormat (int format)
{
- int i;
- for (i = 0; i < NUM_FORMATS; i++)
+ for (int i = 0; i < NUM_FORMATS; i++)
if (formatNames[i].rop == format)
return formatNames[i].name;
return NULL;
@@ -1576,10 +1560,11 @@ GetFormats (int argi, int argc, char **argv, int *formatsp, int *nump)
char *words[256];
int count;
int i;
- int format;
count = GetWords (argi, argc, argv, words, nump);
for (i = 0; i < count; i++) {
+ int format;
+
if (!strcmp (words[i], "all")) {
for (i = 0; i < NUM_FORMATS; i++)
formatsp[i] = formatNames[i].rop;
diff --git a/app/x11perf/x11perf.h b/app/x11perf/x11perf.h
index 69dedec49..72f814c1e 100644
--- a/app/x11perf/x11perf.h
+++ b/app/x11perf/x11perf.h
@@ -343,7 +343,7 @@ drawing speed for lines, polygons, text, etc.
Since workstations are not used as standalone graphics engines, but as
super-terminals, x11perf measures window management performance as well as
-traditional graphics performace. x11perf includes benchmarks for the time it
+traditional graphics performance. x11perf includes benchmarks for the time it
takes to create and map windows (as when you start up an application); to map a
pre-existing set of windows onto the screen (as when you deiconify an
application or pop up a menu); and to rearrange windows (as when you slosh