Update to xdpyinfo 1.3.4

pull/1/head
matthieu 2023-05-07 17:05:33 +00:00
parent 057a618fd3
commit 0c9bf3472c
6 changed files with 194 additions and 121 deletions

View File

@ -1,3 +1,57 @@
commit ea4083ccb2a5ce4252acabeb2eb7bf49f7be25e0
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Thu Apr 27 16:58:51 2023 -0700
xdpyinfo 1.3.4
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit e4688bb9e4b6e0333a84420864bf39cf4c4fa86f
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Thu Dec 8 18:46:20 2022 -0800
Call memset() instead of hand-coding our own equivalent
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 6bb053f46101e659c4f3a877bf8d17ad37a23225
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Thu Dec 8 13:26:00 2022 -0800
Remove unnecessary downcast of double to float
The printf family always takes double arguments, not float.
Clears clang warning of:
xdpyinfo.c:767:5: warning: implicit conversion increases floating-point
precision: 'float' to 'double' [-Wdouble-promotion]
(float)dotclock/1000.0,
^~~~~~~~~~~~~~~~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 04f4911bedc988b917a268978d9592780aa34651
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Thu Dec 8 13:24:47 2022 -0800
Variable scope reduction
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 563f4c9eb22b5389a2cf63276ec08025ad0d794b
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Tue Nov 22 14:12:16 2022 -0800
configure: Make xf86misc support disabled by default
Require --with-xf86misc to enable it.
The server side of the XF86-Misc extension was removed in the xserver-1.6.0
release in 2008, so this code is unusable on most systems now.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 61bc4b764030bdc9a731ee74c7c56bf2b2a4bddf
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Thu Apr 7 13:43:48 2022 -0700

View File

@ -1,5 +1,3 @@
# $OpenBSD: Makefile.bsd-wrapper,v 1.7 2021/09/15 05:48:04 matthieu Exp $
CONFIGURE_ARGS = --without-xf86misc --without-dmx
# $OpenBSD: Makefile.bsd-wrapper,v 1.8 2023/05/07 17:05:33 matthieu Exp $
.include <bsd.xorg.mk>

View File

@ -1318,7 +1318,7 @@ AC_SUBST([am__untar])
dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
dnl
dnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
dnl Copyright (c) 2005, 2023, Oracle and/or its affiliates.
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the "Software"),
@ -1355,7 +1355,7 @@ dnl DEALINGS IN THE SOFTWARE.
# See the "minimum version" comment for each macro you use to see what
# version you require.
m4_defun([XORG_MACROS_VERSION],[
m4_define([vers_have], [1.19.2])
m4_define([vers_have], [1.20.0])
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_if(m4_cmp(maj_have, maj_needed), 0,,
@ -1376,7 +1376,7 @@ AM_MAINTAINER_MODE
# such as man pages and config files
AC_DEFUN([XORG_PROG_RAWCPP],[
AC_REQUIRE([AC_PROG_CPP])
AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
AC_PATH_TOOL(RAWCPP, [cpp], [${CPP}],
[$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
# Check for flag to avoid builtin definitions - assumes unix is predefined,
@ -1686,7 +1686,7 @@ AC_SUBST(MAKE_HTML)
# 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
# presence of the tool and obtain it's path in separate variables. Coupled with
# the --with-xmlto option, it allows maximum flexibilty in making decisions
# the --with-xmlto option, it allows maximum flexibility in making decisions
# as whether or not to use the xmlto package. When DEFAULT is not specified,
# --with-xmlto assumes 'auto'.
#
@ -1900,7 +1900,7 @@ AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
# 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
# presence of the tool and obtain it's path in separate variables. Coupled with
# the --with-asciidoc option, it allows maximum flexibilty in making decisions
# the --with-asciidoc option, it allows maximum flexibility in making decisions
# as whether or not to use the asciidoc package. When DEFAULT is not specified,
# --with-asciidoc assumes 'auto'.
#
@ -1970,7 +1970,7 @@ AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
# 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
# presence of the tool and obtain it's path in separate variables. Coupled with
# the --with-doxygen option, it allows maximum flexibilty in making decisions
# the --with-doxygen option, it allows maximum flexibility in making decisions
# as whether or not to use the doxygen package. When DEFAULT is not specified,
# --with-doxygen assumes 'auto'.
#
@ -2054,7 +2054,7 @@ AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
# 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
# presence of the tool and obtain it's path in separate variables. Coupled with
# the --with-groff option, it allows maximum flexibilty in making decisions
# the --with-groff option, it allows maximum flexibility in making decisions
# as whether or not to use the groff package. When DEFAULT is not specified,
# --with-groff assumes 'auto'.
#
@ -2162,7 +2162,7 @@ AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
# 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
# presence of the tool and obtain it's path in separate variables. Coupled with
# the --with-fop option, it allows maximum flexibilty in making decisions
# the --with-fop option, it allows maximum flexibility in making decisions
# as whether or not to use the fop package. When DEFAULT is not specified,
# --with-fop assumes 'auto'.
#
@ -2256,7 +2256,7 @@ AC_SUBST([M4], [$ac_cv_path_M4])
# 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
# presence of the tool and obtain it's path in separate variables. Coupled with
# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
# the --with-ps2pdf option, it allows maximum flexibility in making decisions
# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
# --with-ps2pdf assumes 'auto'.
#
@ -2311,7 +2311,7 @@ AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
# not at the appropriate level. This macro enables a builder to skip all
# documentation targets except traditional man pages.
# Combined with the specific tool checking macros XORG_WITH_*, it provides
# maximum flexibilty in controlling documentation building.
# maximum flexibility in controlling documentation building.
# Refer to:
# XORG_WITH_XMLTO --with-xmlto
# XORG_WITH_ASCIIDOC --with-asciidoc
@ -2344,7 +2344,7 @@ AC_MSG_RESULT([$build_docs])
#
# This macro enables a builder to skip all developer documentation.
# Combined with the specific tool checking macros XORG_WITH_*, it provides
# maximum flexibilty in controlling documentation building.
# maximum flexibility in controlling documentation building.
# Refer to:
# XORG_WITH_XMLTO --with-xmlto
# XORG_WITH_ASCIIDOC --with-asciidoc
@ -2377,7 +2377,7 @@ AC_MSG_RESULT([$build_devel_docs])
#
# This macro enables a builder to skip all functional specification targets.
# Combined with the specific tool checking macros XORG_WITH_*, it provides
# maximum flexibilty in controlling documentation building.
# maximum flexibility in controlling documentation building.
# Refer to:
# XORG_WITH_XMLTO --with-xmlto
# XORG_WITH_ASCIIDOC --with-asciidoc
@ -2852,7 +2852,11 @@ AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
AC_DEFUN([XORG_COMPILER_BRAND], [
AC_LANG_CASE(
[C], [
AC_REQUIRE([AC_PROG_CC_C99])
dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC
dnl and complains that AC_PROG_CC_C99 is obsolete
m4_version_prereq([2.70],
[AC_REQUIRE([AC_PROG_CC])],
[AC_REQUIRE([AC_PROG_CC_C99])])
],
[C++], [
AC_REQUIRE([AC_PROG_CXX])
@ -2868,7 +2872,7 @@ AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
# Minimum version: 1.16.0
#
# Test if the compiler works when passed the given flag as a command line argument.
# If it succeeds, the flag is appeneded to the given variable. If not, it tries the
# If it succeeds, the flag is appended to the given variable. If not, it tries the
# next flag in the list until there are no more options.
#
# Note that this does not guarantee that the compiler supports the flag as some
@ -2884,7 +2888,11 @@ AC_LANG_COMPILER_REQUIRE
AC_LANG_CASE(
[C], [
AC_REQUIRE([AC_PROG_CC_C99])
dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC
dnl and complains that AC_PROG_CC_C99 is obsolete
m4_version_prereq([2.70],
[AC_REQUIRE([AC_PROG_CC])],
[AC_REQUIRE([AC_PROG_CC_C99])])
define([PREFIX], [C])
define([CACHE_PREFIX], [cc])
define([COMPILER], [$CC])
@ -3025,7 +3033,7 @@ XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
# 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 accidentally get successful builds
# when there are problems that should be fixed.
if test "x$SELECTIVE_WERROR" = "xyes" ; then
@ -3134,23 +3142,35 @@ AC_SUBST([BASE_]PREFIX[FLAGS])
AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
]) # XORG_STRICT_OPTION
# XORG_DEFAULT_OPTIONS
# --------------------
# Minimum version: 1.3.0
# XORG_DEFAULT_NOCODE_OPTIONS
# ---------------------------
# Minimum version: 1.20.0
#
# Defines default options for X.Org modules.
# Defines default options for X.Org modules which don't compile code,
# such as fonts, bitmaps, cursors, and docs.
#
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
AC_DEFUN([XORG_DEFAULT_NOCODE_OPTIONS], [
AC_REQUIRE([AC_PROG_INSTALL])
XORG_COMPILER_FLAGS
XORG_CWARNFLAGS
XORG_STRICT_OPTION
XORG_RELEASE_VERSION
XORG_CHANGELOG
XORG_INSTALL
XORG_MANPAGE_SECTIONS
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
[AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
]) # XORG_DEFAULT_NOCODE_OPTIONS
# XORG_DEFAULT_OPTIONS
# --------------------
# Minimum version: 1.3.0
#
# Defines default options for X.Org modules which compile code.
#
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
AC_REQUIRE([AC_PROG_INSTALL])
XORG_COMPILER_FLAGS
XORG_CWARNFLAGS
XORG_STRICT_OPTION
XORG_DEFAULT_NOCODE_OPTIONS
]) # XORG_DEFAULT_OPTIONS
# XORG_INSTALL()

View File

@ -1,8 +1,8 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for xdpyinfo 1.3.3.
# Generated by GNU Autoconf 2.69 for xdpyinfo 1.3.4.
#
# Report bugs to <https://gitlab.freedesktop.org/xorg/app/xdpyinfo/issues>.
# Report bugs to <https://gitlab.freedesktop.org/xorg/app/xdpyinfo/-/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/app/xdpyinfo/issues
$0: https://gitlab.freedesktop.org/xorg/app/xdpyinfo/-/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='xdpyinfo'
PACKAGE_TARNAME='xdpyinfo'
PACKAGE_VERSION='1.3.3'
PACKAGE_STRING='xdpyinfo 1.3.3'
PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/app/xdpyinfo/issues'
PACKAGE_VERSION='1.3.4'
PACKAGE_STRING='xdpyinfo 1.3.4'
PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/app/xdpyinfo/-/issues'
PACKAGE_URL=''
ac_unique_file="Makefile.am"
@ -1381,7 +1381,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 xdpyinfo 1.3.3 to adapt to many kinds of systems.
\`configure' configures xdpyinfo 1.3.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1452,7 +1452,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of xdpyinfo 1.3.3:";;
short | recursive ) echo "Configuration of xdpyinfo 1.3.4:";;
esac
cat <<\_ACEOF
@ -1480,7 +1480,7 @@ Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--without-dga Disable dga support.
--without-xf86misc Disable xf86misc support.
--with-xf86misc Enable xf86misc support.
--without-xinerama Disable xinerama support.
--with-dmx Enable dmx support.
--with-lint Use a lint-style source code checker (default:
@ -1558,7 +1558,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/app/xdpyinfo/issues>.
Report bugs to <https://gitlab.freedesktop.org/xorg/app/xdpyinfo/-/issues>.
_ACEOF
ac_status=$?
fi
@ -1621,7 +1621,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
xdpyinfo configure 1.3.3
xdpyinfo configure 1.3.4
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1878,7 +1878,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 xdpyinfo $as_me 1.3.3, which was
It was created by xdpyinfo $as_me 1.3.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -2707,7 +2707,7 @@ fi
# Define the identity of the package.
PACKAGE='xdpyinfo'
VERSION='1.3.3'
VERSION='1.3.4'
cat >>confdefs.h <<_ACEOF
@ -6655,7 +6655,7 @@ $as_echo "$supported" >&6; }
# 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 accidentally get successful builds
# when there are problems that should be fixed.
if test "x$SELECTIVE_WERROR" = "xyes" ; then
@ -10327,6 +10327,8 @@ fi
cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
_ACEOF
@ -10529,6 +10531,7 @@ AM_BACKSLASH='\'
# Checks for pkg-config packages
pkg_failed=no
@ -11086,7 +11089,7 @@ fi
if test "${with_xf86misc+set}" = set; then :
withval=$with_xf86misc; USE_XF86MISC="$withval"
else
USE_XF86MISC="yes"
USE_XF86MISC="no"
fi
if test "x$USE_XF86MISC" != "xno" ; then
@ -12370,7 +12373,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 xdpyinfo $as_me 1.3.3, which was
This file was extended by xdpyinfo $as_me 1.3.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -12430,13 +12433,13 @@ $config_headers
Configuration commands:
$config_commands
Report bugs to <https://gitlab.freedesktop.org/xorg/app/xdpyinfo/issues>."
Report bugs to <https://gitlab.freedesktop.org/xorg/app/xdpyinfo/-/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="\\
xdpyinfo config.status 1.3.3
xdpyinfo config.status 1.3.4
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@ -23,8 +23,8 @@ dnl Process this file with autoconf to create configure.
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xdpyinfo], [1.3.3],
[https://gitlab.freedesktop.org/xorg/app/xdpyinfo/issues], [xdpyinfo])
AC_INIT([xdpyinfo], [1.3.4],
[https://gitlab.freedesktop.org/xorg/app/xdpyinfo/-/issues], [xdpyinfo])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
@ -76,8 +76,8 @@ else
fi
AC_ARG_WITH(xf86misc, AS_HELP_STRING([--without-xf86misc],[Disable xf86misc support.]),
[USE_XF86MISC="$withval"], [USE_XF86MISC="yes"])
AC_ARG_WITH(xf86misc, AS_HELP_STRING([--with-xf86misc],[Enable xf86misc support.]),
[USE_XF86MISC="$withval"], [USE_XF86MISC="no"])
if test "x$USE_XF86MISC" != "xno" ; then
PKG_CHECK_MODULES(DPY_XF86MISC, xxf86misc,
[SAVE_CPPFLAGS="$CPPFLAGS"

View File

@ -170,12 +170,10 @@ print_extension_info(Display *dpy)
printf ("number of extensions: %d\n", n);
if (extlist) {
int i;
qsort(extlist, (size_t)n, sizeof(char *), StrCmp);
if (!queryExtensions) {
for (i = 0; i < n; i++) {
for (int i = 0; i < n; i++) {
printf (" %s\n", extlist[i]);
}
} else {
@ -192,7 +190,7 @@ print_extension_info(Display *dpy)
* Generate all extension queries at once, so they can be
* sent to the xserver in a single batch
*/
for (i = 0; i < n; i++) {
for (int i = 0; i < n; i++) {
qe_cookies[i] = xcb_query_extension (xcb_conn,
(uint16_t)strlen(extlist[i]),
extlist[i]);
@ -203,7 +201,7 @@ print_extension_info(Display *dpy)
* The first call will flush the queue to the server, then
* each one will wait, if needed, for its reply.
*/
for (i = 0; i < n; i++) {
for (int i = 0; i < n; i++) {
xcb_query_extension_reply_t *rep
= xcb_query_extension_reply(xcb_conn, qe_cookies[i], NULL);
@ -229,7 +227,7 @@ print_display_info(Display *dpy)
char dummybuf[40];
const char *cp;
int minkeycode, maxkeycode;
int i, n;
int n;
long req_size;
XPixmapFormatValues *pmf;
Window focuswin;
@ -364,7 +362,7 @@ print_display_info(Display *dpy)
printf ("number of supported pixmap formats: %d\n", n);
if (pmf) {
printf ("supported pixmap formats:\n");
for (i = 0; i < n; i++) {
for (int i = 0; i < n; i++) {
printf (" depth %d, bits_per_pixel %d, scanline_pad %d\n",
pmf[i].depth, pmf[i].bits_per_pixel, pmf[i].scanline_pad);
}
@ -457,7 +455,6 @@ print_screen_info(Display *dpy, int scr)
XVisualInfo viproto; /* fill in for getting info */
XVisualInfo *vip; /* returned info */
int nvi; /* number of elements returned */
int i; /* temp variable: iterator */
char eventbuf[80]; /* want 79 chars per line + nul */
static const char *yes = "YES", *no = "NO", *when = "WHEN MAPPED";
double xres, yres;
@ -487,7 +484,7 @@ print_screen_info(Display *dpy, int scr)
depths = XListDepths (dpy, scr, &ndepths);
if (!depths) ndepths = 0;
printf (" depths (%d): ", ndepths);
for (i = 0; i < ndepths; i++) {
for (int i = 0; i < ndepths; i++) {
printf ("%d", depths[i]);
if (i < ndepths - 1) {
putchar (',');
@ -526,7 +523,7 @@ print_screen_info(Display *dpy, int scr)
printf (" number of visuals: %d\n", nvi);
printf (" default visual id: 0x%lx\n",
XVisualIDFromVisual (DefaultVisual (dpy, scr)));
for (i = 0; i < nvi; i++) {
for (int i = 0; i < nvi; i++) {
print_visual_info (vip+i);
}
if (vip) XFree ((char *) vip);
@ -576,18 +573,16 @@ print_event_mask(char *buf, /* string to write into */
int indent, /* amount by which to indent */
long mask) /* event mask */
{
struct _event_table *etp;
int len;
int bitsfound = 0;
buf[0] = buf[lastcol] = '\0'; /* just in case */
#define INDENT() { register int i; len = indent; \
for (i = 0; i < indent; i++) buf[i] = ' '; }
#define INDENT() do { len = indent; memset(buf, ' ', indent); } while (0)
INDENT ();
for (etp = event_table; etp->name; etp++) {
for (struct _event_table *etp = event_table; etp->name; etp++) {
if (mask & etp->value) {
if (len + MASK_NAME_WIDTH > lastcol) {
puts (buf);
@ -627,11 +622,7 @@ print_standard_extension_info(Display *dpy, const char *extname,
static int
print_multibuf_info(Display *dpy, const char *extname)
{
int i, j; /* temp variable: iterator */
int nmono, nstereo; /* count */
XmbufBufferInfo *mono_info = NULL, *stereo_info = NULL; /* arrays */
#define MULTIBUF_FMT " visual id, max buffers, depth: 0x%lx, %d, %d\n"
int scr = 0;
int majorrev, minorrev;
if (!XmbufGetVersion(dpy, &majorrev, &minorrev))
@ -639,8 +630,12 @@ print_multibuf_info(Display *dpy, const char *extname)
print_standard_extension_info(dpy, extname, majorrev, minorrev);
for (i = 0; i < ScreenCount (dpy); i++)
for (int i = 0; i < ScreenCount (dpy); i++)
{
int nmono, nstereo; /* count */
XmbufBufferInfo *mono_info = NULL, *stereo_info = NULL; /* arrays */
const int scr = 0;
if (!XmbufGetScreenInfo (dpy, RootWindow(dpy, scr), &nmono, &mono_info,
&nstereo, &stereo_info)) {
fprintf (stderr,
@ -648,12 +643,12 @@ print_multibuf_info(Display *dpy, const char *extname)
ProgramName, scr);
} else {
printf (" screen %d number of mono multibuffer types: %d\n", i, nmono);
for (j = 0; j < nmono; j++) {
for (int j = 0; j < nmono; j++) {
printf (MULTIBUF_FMT, mono_info[j].visualid,
mono_info[j].max_buffers, mono_info[j].depth);
}
printf (" number of stereo multibuffer types: %d\n", nstereo);
for (j = 0; j < nstereo; j++) {
for (int j = 0; j < nstereo; j++) {
printf (MULTIBUF_FMT, stereo_info[j].visualid,
stereo_info[j].max_buffers, stereo_info[j].depth);
}
@ -681,7 +676,7 @@ print_sync_info(Display *dpy, const char *extname)
{
int majorrev, minorrev;
XSyncSystemCounter *syscounters;
int ncounters, i;
int ncounters;
if (!XSyncInitialize(dpy, &majorrev, &minorrev))
return 0;
@ -689,7 +684,7 @@ print_sync_info(Display *dpy, const char *extname)
syscounters = XSyncListSystemCounters(dpy, &ncounters);
printf(" system counters: %d\n", ncounters);
for (i = 0; i < ncounters; i++)
for (int i = 0; i < ncounters; i++)
{
printf(" %s id: 0x%08x resolution_lo: %d resolution_hi: %d\n",
syscounters[i].name, (unsigned int)syscounters[i].counter,
@ -768,7 +763,7 @@ print_XF86VidMode_modeline(
unsigned int flags)
{
printf(" %6.2f %4d %4d %4d %4d %4d %4d %4d %4d ",
(float)dotclock/1000.0,
dotclock/1000.0,
hdisplay, hsyncstart, hsyncend, htotal,
vdisplay, vsyncstart, vsyncend, vtotal);
if (flags & V_PHSYNC) printf(" +hsync");
@ -786,10 +781,8 @@ print_XF86VidMode_modeline(
static int
print_XF86VidMode_info(Display *dpy, const char *extname)
{
int majorrev, minorrev, modecount, dotclock, i;
int majorrev, minorrev;
XF86VidModeMonitor monitor;
XF86VidModeModeLine modeline;
XF86VidModeModeInfo **modelines;
if (!XF86VidModeQueryVersion(dpy, &majorrev, &minorrev))
return 0;
@ -802,11 +795,11 @@ print_XF86VidMode_info(Display *dpy, const char *extname)
monitor.model == NULL ? "" : monitor.model);
printf(" Num hsync: %d, Num vsync: %d\n",
monitor.nhsync, monitor.nvsync);
for (i = 0; i < monitor.nhsync; i++) {
for (int i = 0; i < monitor.nhsync; i++) {
printf(" hsync range %d: %6.2f - %6.2f\n", i,
monitor.hsync[i].lo, monitor.hsync[i].hi);
}
for (i = 0; i < monitor.nvsync; i++) {
for (int i = 0; i < monitor.nvsync; i++) {
printf(" vsync range %d: %6.2f - %6.2f\n", i,
monitor.vsync[i].lo, monitor.vsync[i].hi);
}
@ -819,11 +812,15 @@ print_XF86VidMode_info(Display *dpy, const char *extname)
}
if ((majorrev > 0) || (majorrev == 0 && minorrev > 5)) {
int modecount, dotclock;
XF86VidModeModeLine modeline;
XF86VidModeModeInfo **modelines;
if (XF86VidModeGetAllModeLines(dpy, DefaultScreen(dpy), &modecount,
&modelines)) {
printf(" Available Video Mode Settings:\n");
printf(" Clock Hdsp Hbeg Hend Httl Vdsp Vbeg Vend Vttl Flags\n");
for (i = 0; i < modecount; i++) {
for (int i = 0; i < modecount; i++) {
print_XF86VidMode_modeline
(modelines[i]->dotclock, modelines[i]->hdisplay,
modelines[i]->hsyncstart, modelines[i]->hsyncend,
@ -872,8 +869,6 @@ static int
print_XF86Misc_info(Display *dpy, const char *extname)
{
int majorrev, minorrev;
XF86MiscMouseSettings mouseinfo;
XF86MiscKbdSettings kbdinfo;
if (!XF86MiscQueryVersion(dpy, &majorrev, &minorrev))
return 0;
@ -882,6 +877,9 @@ print_XF86Misc_info(Display *dpy, const char *extname)
old_handler = XSetErrorHandler(silent_errors);
if ((majorrev > 0) || (majorrev == 0 && minorrev > 0)) {
XF86MiscKbdSettings kbdinfo;
XF86MiscMouseSettings mouseinfo;
if (!XF86MiscGetKbdSettings(dpy, &kbdinfo))
return 0;
printf(" Keyboard Settings- Type: %s, Rate: %d, Delay: %d, ServerNumLock: %s\n",
@ -971,17 +969,16 @@ print_dbe_info(Display *dpy, const char *extname)
int majorrev, minorrev;
XdbeScreenVisualInfo *svi;
int numscreens = 0;
int iscrn, ivis;
if (!XdbeQueryExtension(dpy, &majorrev, &minorrev))
return 0;
print_standard_extension_info(dpy, extname, majorrev, minorrev);
svi = XdbeGetVisualInfo(dpy, (Drawable *)NULL, &numscreens);
for (iscrn = 0; iscrn < numscreens; iscrn++)
for (int iscrn = 0; iscrn < numscreens; iscrn++)
{
printf(" Double-buffered visuals on screen %d\n", iscrn);
for (ivis = 0; ivis < svi[iscrn].count; ivis++)
for (int ivis = 0; ivis < svi[iscrn].count; ivis++)
{
printf(" visual id 0x%lx depth %d perflevel %d\n",
svi[iscrn].visinfo[ivis].visual,
@ -1008,9 +1005,8 @@ print_record_info(Display *dpy, const char *extname)
static int
print_xinput_info(Display *dpy, const char *extname)
{
int loop, num_extensions, num_devices;
int loop, num_extensions;
char **extensions;
XDeviceInfo *devices;
XExtensionVersion *ext;
ext = XGetExtensionVersion(dpy, extname);
@ -1027,6 +1023,9 @@ print_xinput_info(Display *dpy, const char *extname)
(strcmp(extensions[loop], extname) != 0); loop++);
XFreeExtensionList(extensions);
if (loop != num_extensions) {
int num_devices;
XDeviceInfo *devices;
printf(" Extended devices :\n");
devices = XListInputDevices(dpy, &num_devices);
for(loop=0; loop<num_devices; loop++) {
@ -1070,18 +1069,7 @@ print_xrender_info(Display *dpy, const char *extname)
{
int loop, num_extensions;
char **extensions;
XRenderPictFormat *pictform;
int count;
int major, minor;
int i, j;
XVisualInfo viproto; /* fill in for getting info */
XVisualInfo *vip; /* returned info */
int nvi; /* number of elements returned */
int ndepths = 0, *depths = NULL;
#if RENDER_MAJOR > 0 || RENDER_MINOR >= 6
XFilters *filters;
int f;
#endif
if (!XRenderQueryVersion (dpy, &major, &minor))
return 0;
@ -1093,8 +1081,11 @@ print_xrender_info(Display *dpy, const char *extname)
(strcmp(extensions[loop], extname) != 0); loop++);
XFreeExtensionList(extensions);
if (loop != num_extensions) {
XRenderPictFormat *pictform;
printf (" Render formats :\n");
for (count = 0; (pictform = XRenderFindFormat (dpy, 0, NULL, count)); count++)
for (int count = 0; (pictform = XRenderFindFormat (dpy, 0, NULL, count));
count++)
{
printf (" pict format:\n");
printf ("\tformat id: 0x%lx\n", pictform->id);
@ -1111,7 +1102,15 @@ print_xrender_info(Display *dpy, const char *extname)
printf("\tcolormap 0x%lx\n", pictform->colormap);
}
printf (" Screen formats :\n");
for (i = 0; i < ScreenCount (dpy); i++) {
for (int i = 0; i < ScreenCount (dpy); i++) {
int nvi; /* number of elements returned */
XVisualInfo viproto; /* fill in for getting info */
XVisualInfo *vip; /* returned info */
int ndepths = 0, *depths = NULL;
#if RENDER_MAJOR > 0 || RENDER_MINOR >= 6
XFilters *filters;
#endif
nvi = 0;
viproto.screen = i;
vip = XGetVisualInfo (dpy, VisualScreenMask, &viproto, &nvi);
@ -1130,7 +1129,7 @@ print_xrender_info(Display *dpy, const char *extname)
if (filters)
{
printf (" filters: ");
for (f = 0; f < filters->nfilter; f++)
for (int f = 0; f < filters->nfilter; f++)
{
printf ("%s", filters->filter[f]);
if (f < filters->nalias && filters->alias[f] != FilterAliasNone)
@ -1142,7 +1141,7 @@ print_xrender_info(Display *dpy, const char *extname)
}
#endif
printf ("\n");
for (j = 0; j < nvi; j++)
for (int j = 0; j < nvi; j++)
{
printf (" visual format:\n");
printf (" visual id: 0x%lx\n", vip[j].visualid);
@ -1155,15 +1154,18 @@ print_xrender_info(Display *dpy, const char *extname)
if (vip) XFree ((char *) vip);
depths = XListDepths (dpy, i, &ndepths);
if (!depths) ndepths = 0;
for (j = 0; j < ndepths; j++)
for (int j = 0; j < ndepths; j++)
{
XRenderPictFormat templ;
templ.depth = depths[j];
printf (" depth formats:\n");
printf (" depth %d\n", depths[j]);
for (count = 0; (pictform = XRenderFindFormat (dpy, PictFormatDepth, &templ, count)); count++)
for (int count = 0;
(pictform = XRenderFindFormat (dpy, PictFormatDepth, &templ, count));
count++) {
printf(" pict format id: 0x%lx\n", pictform->id);
}
}
if (depths) XFree (depths);
}
@ -1204,10 +1206,10 @@ print_xinerama_info(Display *dpy, const char *extname)
if (!XineramaIsActive(dpy)) {
printf(" Xinerama is inactive.\n");
} else {
int i, count = 0;
int count = 0;
XineramaScreenInfo *xineramaScreens = XineramaQueryScreens(dpy, &count);
for (i = 0; i < count; i++) {
for (int i = 0; i < count; i++) {
XineramaScreenInfo *xs = &xineramaScreens[i];
printf(" head #%d: %dx%d @ %d,%d\n", xs->screen_number,
xs->width, xs->height, xs->x_org, xs->y_org);
@ -1233,10 +1235,7 @@ static int print_dmx_info(Display *dpy, const char *extname)
{
int event_base, error_base;
int major_version, minor_version, patch_version;
DMXScreenAttributes sinfo;
DMXInputAttributes iinfo;
int count;
int i;
if (!DMXQueryExtension(dpy, &event_base, &error_base)
|| !DMXQueryVersion(dpy, &major_version, &minor_version,
@ -1246,7 +1245,9 @@ static int print_dmx_info(Display *dpy, const char *extname)
if (!DMXGetScreenCount(dpy, &count)) return 1;
printf(" Screen count: %d\n", count);
for (i = 0; i < count; i++) {
for (int i = 0; i < count; i++) {
DMXScreenAttributes sinfo;
if (DMXGetScreenAttributes(dpy, i, &sinfo)) {
printf(" %2d %s %ux%u+%d+%d %d @%dx%d\n",
i, sinfo.displayName,
@ -1263,7 +1264,8 @@ static int print_dmx_info(Display *dpy, const char *extname)
return 1;
printf(" Input count = %d\n", count);
for (i = 0; i < count; i++) {
for (int i = 0; i < count; i++) {
DMXInputAttributes iinfo;
#ifdef XINPUT
Display *backend;
char *backendname = NULL;
@ -1286,11 +1288,11 @@ static int print_dmx_info(Display *dpy, const char *extname)
if (ext
&& ext != (XExtensionVersion *)NoSuchExtension) {
int dcount, d;
int dcount;
XDeviceInfo *devInfo = XListInputDevices(backend,
&dcount);
if (devInfo) {
for (d = 0; d < dcount; d++) {
for (int d = 0; d < dcount; d++) {
if ((unsigned)iinfo.physicalId
== devInfo[d].id
&& devInfo[d].name) {
@ -1403,16 +1405,14 @@ print_known_extensions(FILE *f)
static void
mark_extension_for_printing(const char *extname)
{
int i;
if (strcmp(extname, "all") == 0)
{
for (i = 0; i < num_known_extensions; i++)
for (int i = 0; i < num_known_extensions; i++)
known_extensions[i].printit = True;
}
else
{
for (i = 0; i < num_known_extensions; i++)
for (int i = 0; i < num_known_extensions; i++)
{
if (strcmp(extname, known_extensions[i].extname) == 0)
{
@ -1427,8 +1427,7 @@ mark_extension_for_printing(const char *extname)
static void
print_marked_extensions(Display *dpy)
{
int i;
for (i = 0; i < num_known_extensions; i++)
for (int i = 0; i < num_known_extensions; i++)
{
if (known_extensions[i].printit)
{
@ -1462,11 +1461,10 @@ main(int argc, char *argv[])
{
Display *dpy; /* X connection */
char *displayname = NULL; /* server to contact */
int i; /* temp variable: iterator */
ProgramName = argv[0];
for (i = 1; i < argc; i++) {
for (int i = 1; i < argc; i++) {
char *arg = argv[i];
size_t len = strlen(arg);
@ -1504,7 +1502,7 @@ main(int argc, char *argv[])
}
print_display_info (dpy);
for (i = 0; i < ScreenCount (dpy); i++) {
for (int i = 0; i < ScreenCount (dpy); i++) {
print_screen_info (dpy, i);
}