Module Name: xsrc
Committed By: mrg
Date: Sun Jan 8 09:59:52 UTC 2023
Modified Files:
xsrc/external/mit/xinit/dist: compile startx.cpp xinit.c
xsrc/external/mit/xinit/dist/man: startx.man
xsrc/external/mit/xprop/include: config.h
xsrc/external/mit/xrandr/dist: compile xrandr.c
xsrc/external/mit/xstdcmap/dist: compile
Removed Files:
xsrc/external/mit/xinit/dist/launchd: console_redirect.c
console_redirect.h
xsrc/external/mit/xrandr/dist: README
xsrc/external/mit/xset/dist: README
Log Message:
merge xinit 1.4.2, xprop 1.2.6, xrandr 1.5.2, xset 1.2.5, and xstdcmap 1.0.5
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/xinit/dist/compile
cvs rdiff -u -r1.9 -r1.10 xsrc/external/mit/xinit/dist/startx.cpp
cvs rdiff -u -r1.8 -r1.9 xsrc/external/mit/xinit/dist/xinit.c
cvs rdiff -u -r1.1.1.1 -r0 \
xsrc/external/mit/xinit/dist/launchd/console_redirect.c \
xsrc/external/mit/xinit/dist/launchd/console_redirect.h
cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/xinit/dist/man/startx.man
cvs rdiff -u -r1.7 -r1.8 xsrc/external/mit/xprop/include/config.h
cvs rdiff -u -r1.1.1.2 -r0 xsrc/external/mit/xrandr/dist/README
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/xrandr/dist/compile
cvs rdiff -u -r1.14 -r1.15 xsrc/external/mit/xrandr/dist/xrandr.c
cvs rdiff -u -r1.1.1.2 -r0 xsrc/external/mit/xset/dist/README
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/xstdcmap/dist/compile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: xsrc/external/mit/xinit/dist/compile
diff -u xsrc/external/mit/xinit/dist/compile:1.4 xsrc/external/mit/xinit/dist/compile:1.5
--- xsrc/external/mit/xinit/dist/compile:1.4 Sun Mar 11 10:46:02 2018
+++ xsrc/external/mit/xinit/dist/compile Sun Jan 8 09:59:51 2023
@@ -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 <[email protected]>.
#
# 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:
Index: xsrc/external/mit/xinit/dist/startx.cpp
diff -u xsrc/external/mit/xinit/dist/startx.cpp:1.9 xsrc/external/mit/xinit/dist/startx.cpp:1.10
--- xsrc/external/mit/xinit/dist/startx.cpp:1.9 Thu Apr 7 20:28:49 2022
+++ xsrc/external/mit/xinit/dist/startx.cpp Sun Jan 8 09:59:51 2023
@@ -2,16 +2,16 @@ XCOMM!SHELL_CMD
XCOMM
XCOMM This is just a sample implementation of a slightly less primitive
-XCOMM interface than xinit. It looks for user .xinitrc and .xserverrc
-XCOMM files, then system xinitrc and xserverrc files, else lets xinit choose
-XCOMM its default. The system xinitrc should probably do things like check
-XCOMM for .Xresources files and merge them in, start up a window manager,
-XCOMM and pop a clock and several xterms.
+XCOMM interface than xinit. It looks for XINITRC and XSERVERRC environment
+XCOMM variables, then user .xinitrc and .xserverrc files, and then system
+XCOMM xinitrc and xserverrc files, else lets xinit choose its default.
+XCOMM The system xinitrc should probably do things like check for
+XCOMM .Xresources files and merge them in, start up a window manager, and
+XCOMM pop a clock and several xterms.
XCOMM
XCOMM Site administrators are STRONGLY urged to write nicer versions.
XCOMM
-unset DBUS_SESSION_BUS_ADDRESS
unset SESSION_MANAGER
#ifdef __APPLE__
@@ -48,9 +48,11 @@ export PATH
#endif
userclientrc=$HOME/.xinitrc
+[ -f "${XINITRC}" ] && userclientrc="${XINITRC}"
sysclientrc=XINITDIR/xinitrc
userserverrc=$HOME/.xserverrc
+[ -f "${XSERVERRC}" ] && userclientrc="${XSERVERRC}"
sysserverrc=XINITDIR/xserverrc
defaultclient=XTERM
defaultserver=XSERVER
@@ -87,17 +89,17 @@ fi
XCOMM First, start caching fonts
if [ x`defaults read $X11_PREFS_DOMAIN cache_fonts` = x1 ] ; then
if [ -x $bindir/font_cache ] ; then
- $bindir/font_cache &
+ $bindir/font_cache
elif [ -x $bindir/font_cache.sh ] ; then
- $bindir/font_cache.sh &
+ $bindir/font_cache.sh
elif [ -x $bindir/fc-cache ] ; then
- $bindir/fc-cache &
+ $bindir/fc-cache
fi
fi
if [ -x __libexecdir__/privileged_startx ] ; then
- # Don't push this into the background becasue it can cause
- # a race to create /tmp/.X11-unix
+ XCOMM Don't push this into the background because it can cause
+ XCOMM a race to create /tmp/.X11-unix
__libexecdir__/privileged_startx
fi
@@ -114,7 +116,7 @@ else
fi
if [ x`defaults read $X11_PREFS_DOMAIN enable_iglx` = x1 ] ; then
- defaultserverargs="$defaultserverargs +iglx"
+ defaultserverargs="$defaultserverargs +iglx +extension GLX"
else
defaultserverargs="$defaultserverargs -iglx"
fi
@@ -206,7 +208,7 @@ if [ x"$server" = x ]; then
XCOMM "https://bugzilla.redhat.com/show_bug.cgi?id=806491"
tty=$(tty)
if expr "$tty" : '/dev/tty[0-9][0-9]*$' > /dev/null; then
- tty_num=$(echo "$tty" | grep -oE '[0-9]+$')
+ tty_num=${tty#/dev/tty}
vtarg="vt$tty_num -keeptty"
fi
#endif
@@ -251,18 +253,7 @@ if [ x"$enable_xauth" = x1 ] ; then
removelist=
XCOMM set up default Xauth info for this machine
- case `uname` in
- Linux*)
- if [ -z "`hostname --version 2>&1 | grep GNU`" ]; then
- hostname=`hostname -f`
- else
- hostname=`hostname`
- fi
- ;;
- *)
- hostname=`hostname`
- ;;
- esac
+ hostname=`uname -n`
authdisplay=${display:-:0}
#if defined(HAS_COOKIE_MAKER) && defined(MK_COOKIE)
Index: xsrc/external/mit/xinit/dist/xinit.c
diff -u xsrc/external/mit/xinit/dist/xinit.c:1.8 xsrc/external/mit/xinit/dist/xinit.c:1.9
--- xsrc/external/mit/xinit/dist/xinit.c:1.8 Sun Mar 3 21:38:01 2019
+++ xsrc/external/mit/xinit/dist/xinit.c Sun Jan 8 09:59:51 2023
@@ -263,7 +263,6 @@ main(int argc, char *argv[])
/*
* Start the server and client.
*/
- signal(SIGCHLD, SIG_DFL); /* Insurance */
/* Let those signal interrupt the wait() call in the main loop */
memset(&sa, 0, sizeof sa);
@@ -284,6 +283,7 @@ main(int argc, char *argv[])
sigaction(SIGALRM, &si, NULL);
sigaction(SIGUSR1, &si, NULL);
+ sigaction(SIGCHLD, &si, NULL);
#ifdef __APPLE__
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
Index: xsrc/external/mit/xinit/dist/man/startx.man
diff -u xsrc/external/mit/xinit/dist/man/startx.man:1.2 xsrc/external/mit/xinit/dist/man/startx.man:1.3
--- xsrc/external/mit/xinit/dist/man/startx.man:1.2 Mon Mar 11 05:08:42 2019
+++ xsrc/external/mit/xinit/dist/man/startx.man Sun Jan 8 09:59:51 2023
@@ -71,7 +71,10 @@ startx \-\^\- \-layout Multihead
.PP
To determine the client to run,
.B startx
-looks for the following files, in order:
+first checks the environment variable
+.I XINITRC
+for a filename. If that variable is unset, or does not contain a filename,
+it looks for the following files, in order:
.RS
.PP
.I $(HOME)/.startxrc
@@ -87,7 +90,10 @@ behavior and revert to the
behavior.
To determine the server to run,
.B startx
-first looks for a file called
+checks the environment variable
+.I XSERVERRC
+for a filename. If that variable is unset, or does not contain a filename,
+it looks for a file called
.I .xserverrc
in the user's home directory. If that is not found, it uses
the file
@@ -163,6 +169,20 @@ for the local host. See the
and
.IR Xsecurity (__miscmansuffix__)
manual pages for more information on X client/server authentication.
+.TP 25
+XINITRC
+This variable should contain the location of an xinitrc file. If unset,
+.I $(HOME)/.xinitrc
+or
+.I __xinitdir__/xinitrc
+will be used.
+.TP 25
+XSERVERRC
+This variable should contain the location of an xserver file. If unset,
+.I $(HOME)/.xinitrc
+or
+.I __xinitdir__/xserverrc
+will be used.
.SH FILES
.TP 25
.I $(HOME)/.xinitrc
Index: xsrc/external/mit/xprop/include/config.h
diff -u xsrc/external/mit/xprop/include/config.h:1.7 xsrc/external/mit/xprop/include/config.h:1.8
--- xsrc/external/mit/xprop/include/config.h:1.7 Tue Apr 27 01:22:56 2021
+++ xsrc/external/mit/xprop/include/config.h Sun Jan 8 09:59:51 2023
@@ -47,7 +47,7 @@
#define PACKAGE_NAME "xprop"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "xprop 1.2.5"
+#define PACKAGE_STRING "xprop 1.2.6"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "xprop"
@@ -56,7 +56,7 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "1.2.5"
+#define PACKAGE_VERSION "1.2.6"
/* Major version of this package */
#define PACKAGE_VERSION_MAJOR 1
@@ -65,10 +65,10 @@
#define PACKAGE_VERSION_MINOR 2
/* Patch version of this package */
-#define PACKAGE_VERSION_PATCHLEVEL 5
+#define PACKAGE_VERSION_PATCHLEVEL 6
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
-#define VERSION "1.2.5"
+#define VERSION "1.2.6"
Index: xsrc/external/mit/xrandr/dist/compile
diff -u xsrc/external/mit/xrandr/dist/compile:1.3 xsrc/external/mit/xrandr/dist/compile:1.4
--- xsrc/external/mit/xrandr/dist/compile:1.3 Wed Apr 27 07:23:01 2016
+++ xsrc/external/mit/xrandr/dist/compile Sun Jan 8 09:59:51 2023
@@ -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 <[email protected]>.
#
# 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:
Index: xsrc/external/mit/xrandr/dist/xrandr.c
diff -u xsrc/external/mit/xrandr/dist/xrandr.c:1.14 xsrc/external/mit/xrandr/dist/xrandr.c:1.15
--- xsrc/external/mit/xrandr/dist/xrandr.c:1.14 Wed May 4 02:19:25 2016
+++ xsrc/external/mit/xrandr/dist/xrandr.c Sun Jan 8 09:59:51 2023
@@ -54,6 +54,11 @@ static Bool automatic = False;
static Bool properties = False;
static Bool grab_server = True;
static Bool no_primary = False;
+static int filter_type = -1;
+
+static const char *filter_names[2] = {
+ "bilinear",
+ "nearest"};
static const char *direction[5] = {
"normal",
@@ -132,13 +137,14 @@ usage(void)
" --below <output>\n"
" --same-as <output>\n"
" --set <property> <value>\n"
- " --scale <x>x<y>\n"
+ " --scale <x>[x<y>]\n"
" --scale-from <w>x<h>\n"
" --transform <a>,<b>,<c>,<d>,<e>,<f>,<g>,<h>,<i>\n"
+ " --filter nearest,bilinear\n"
" --off\n"
" --crtc <crtc>\n"
" --panning <w>x<h>[+<x>+<y>[/<track:w>x<h>+<x>+<y>[/<border:l>/<t>/<r>/<b>]]]\n"
- " --gamma <r>:<g>:<b>\n"
+ " --gamma <r>[:<g>:<b>]\n"
" --brightness <value>\n"
" --primary\n"
" --noprimary\n"
@@ -198,7 +204,7 @@ argerr (const char *format, ...)
/*NOTREACHED*/
}
-/* Because fmin requires C99 suppport */
+/* Because fmin requires C99 support */
static inline double dmin (double x, double y)
{
return x < y ? x : y;
@@ -207,11 +213,9 @@ static inline double dmin (double x, dou
static const char *
rotation_name (Rotation rotation)
{
- int i;
-
if ((rotation & 0xf) == 0)
return "normal";
- for (i = 0; i < 4; i++)
+ for (int i = 0; i < 4; i++)
if (rotation & (1 << i))
return direction[i];
return "invalid rotation";
@@ -259,10 +263,6 @@ typedef enum _relation {
} relation_t;
typedef struct {
- int x, y, width, height;
-} rectangle_t;
-
-typedef struct {
int x1, y1, x2, y2;
} box_t;
@@ -285,6 +285,7 @@ typedef enum _changes {
changes_panning = (1 << 10),
changes_gamma = (1 << 11),
changes_primary = (1 << 12),
+ changes_filter = (1 << 13),
} changes_t;
typedef enum _name_kind {
@@ -424,19 +425,6 @@ static const char *connection[3] = {
"disconnected",
"unknown connection"};
-#define OUTPUT_NAME 1
-
-#define CRTC_OFF 2
-#define CRTC_UNSET 3
-#define CRTC_INDEX 0x40000000
-
-#define MODE_NAME 1
-#define MODE_OFF 2
-#define MODE_UNSET 3
-#define MODE_PREF 4
-
-#define POS_UNSET -1
-
static output_t *all_outputs = NULL;
static output_t **all_outputs_tail = &all_outputs;
static crtc_t *crtcs;
@@ -493,22 +481,21 @@ transform_point (XTransform *transform,
{
double vector[3];
double result[3];
- int i, j;
- double v;
+
vector[0] = *xp;
vector[1] = *yp;
vector[2] = 1;
- for (j = 0; j < 3; j++)
+ for (int j = 0; j < 3; j++)
{
- v = 0;
- for (i = 0; i < 3; i++)
+ double v = 0;
+ for (int i = 0; i < 3; i++)
v += (XFixedToDouble (transform->matrix[j][i]) * vector[i]);
result[j] = v;
}
if (!result[2])
return False;
- for (j = 0; j < 2; j++) {
+ for (int j = 0; j < 2; j++) {
vector[j] = result[j] / result[2];
if (vector[j] > 32767 || vector[j] < -32767)
return False;
@@ -521,11 +508,10 @@ transform_point (XTransform *transform,
static void
path_bounds (XTransform *transform, point_t *points, int npoints, box_t *box)
{
- int i;
- box_t point;
-
- for (i = 0; i < npoints; i++) {
+ for (int i = 0; i < npoints; i++) {
double x, y;
+ box_t point;
+
x = points[i].x;
y = points[i].y;
transform_point (transform, &x, &y);
@@ -606,12 +592,10 @@ mode_hsync (const XRRModeInfo *mode_info
static void
print_verbose_mode (const XRRModeInfo *mode, Bool current, Bool preferred)
{
- int f;
-
printf (" %s (0x%x) %6.3fMHz",
mode->name, (int)mode->id,
(double)mode->dotClock / 1000000.0);
- for (f = 0; mode_flags[f].flag; f++)
+ for (int f = 0; mode_flags[f].flag; f++)
if (mode->modeFlags & mode_flags[f].flag)
printf (" %s", mode_flags[f].string);
if (current)
@@ -630,6 +614,7 @@ print_verbose_mode (const XRRModeInfo *m
static void
init_name (name_t *name)
{
+ memset(name, 0, sizeof(*name));
name->kind = name_none;
}
@@ -703,9 +688,8 @@ print_name (const name_t *name)
static void
init_transform (transform_t *transform)
{
- int x;
memset (&transform->transform, '\0', sizeof (transform->transform));
- for (x = 0; x < 3; x++)
+ for (int x = 0; x < 3; x++)
transform->transform.matrix[x][x] = XDoubleToFixed (1.0);
transform->filter = "";
transform->nparams = 0;
@@ -805,10 +789,9 @@ find_output_by_name (char *name)
static crtc_t *
find_crtc (name_t *name)
{
- int c;
crtc_t *crtc = NULL;
- for (c = 0; c < num_crtcs; c++)
+ for (int c = 0; c < num_crtcs; c++)
{
name_kind_t common;
@@ -839,11 +822,10 @@ find_crtc_by_xid (RRCrtc crtc)
static XRRModeInfo *
find_mode (name_t *name, double refresh)
{
- int m;
XRRModeInfo *best = NULL;
double bestDist = 0;
- for (m = 0; m < res->nmode; m++)
+ for (int m = 0; m < res->nmode; m++)
{
XRRModeInfo *mode = &res->modes[m];
if ((name->kind & name_xid) && name->xid == mode->id)
@@ -895,11 +877,10 @@ XRRModeInfo *
find_mode_for_output (output_t *output, name_t *name)
{
XRROutputInfo *output_info = output->output_info;
- int m;
XRRModeInfo *best = NULL;
double bestDist = 0;
- for (m = 0; m < output_info->nmode; m++)
+ for (int m = 0; m < output_info->nmode; m++)
{
XRRModeInfo *mode;
@@ -936,13 +917,10 @@ static XRRModeInfo *
preferred_mode (output_t *output)
{
XRROutputInfo *output_info = output->output_info;
- int m;
- XRRModeInfo *best;
- int bestDist;
+ XRRModeInfo *best = NULL;
+ int bestDist = 0;
- best = NULL;
- bestDist = 0;
- for (m = 0; m < output_info->nmode; m++)
+ for (int m = 0; m < output_info->nmode; m++)
{
XRRModeInfo *mode_info = find_mode_by_xid (output_info->modes[m]);
int dist;
@@ -969,9 +947,8 @@ static Bool
output_can_use_crtc (output_t *output, crtc_t *crtc)
{
XRROutputInfo *output_info = output->output_info;
- int c;
- for (c = 0; c < output_info->ncrtc; c++)
+ for (int c = 0; c < output_info->ncrtc; c++)
if (output_info->crtcs[c] == crtc->crtc.xid)
return True;
return False;
@@ -981,9 +958,8 @@ static Bool
output_can_use_mode (output_t *output, XRRModeInfo *mode)
{
XRROutputInfo *output_info = output->output_info;
- int m;
- for (m = 0; m < output_info->nmode; m++)
+ for (int m = 0; m < output_info->nmode; m++)
if (output_info->modes[m] == mode->id)
return True;
return False;
@@ -1022,9 +998,8 @@ output_rotations (output_t *output)
Bool found = False;
Rotation rotation = RR_Rotate_0;
XRROutputInfo *output_info = output->output_info;
- int c;
- for (c = 0; c < output_info->ncrtc; c++)
+ for (int c = 0; c < output_info->ncrtc; c++)
{
crtc_t *crtc = find_crtc_by_xid (output_info->crtcs[c]);
if (crtc)
@@ -1043,14 +1018,13 @@ static Bool
output_can_use_rotation (output_t *output, Rotation rotation)
{
XRROutputInfo *output_info = output->output_info;
- int c;
/* make sure all of the crtcs can use this rotation.
* yes, this is not strictly necessary, but it is
* simpler,and we expect most drivers to either
* support rotation everywhere or nowhere
*/
- for (c = 0; c < output_info->ncrtc; c++)
+ for (int c = 0; c < output_info->ncrtc; c++)
{
crtc_t *crtc = find_crtc_by_xid (output_info->crtcs[c]);
if (crtc && !crtc_can_use_rotation (crtc, rotation))
@@ -1069,9 +1043,9 @@ output_is_primary(output_t *output)
/* Returns the index of the last value in an array < 0xffff */
static int
-find_last_non_clamped(CARD16 array[], int size) {
- int i;
- for (i = size - 1; i > 0; i--) {
+find_last_non_clamped(const CARD16 array[], int size)
+{
+ for (int i = size - 1; i > 0; i--) {
if (array[i] < 0xffff)
return i;
}
@@ -1311,6 +1285,10 @@ set_output_info (output_t *output, RROut
output->transform.params = NULL;
}
}
+ if (output->changes & changes_filter)
+ {
+ output->transform.filter = filter_names[filter_type];
+ }
/* set primary */
if (!(output->changes & changes_primary))
@@ -1339,13 +1317,11 @@ get_screen (Bool current)
static void
get_crtcs (void)
{
- int c;
-
num_crtcs = res->ncrtc;
crtcs = calloc (num_crtcs, sizeof (crtc_t));
if (!crtcs) fatal ("out of memory\n");
- for (c = 0; c < res->ncrtc; c++)
+ for (int c = 0; c < res->ncrtc; c++)
{
XRRCrtcInfo *crtc_info = XRRGetCrtcInfo (dpy, res, res->crtcs[c]);
XRRCrtcTransformAttributes *attr;
@@ -1441,9 +1417,7 @@ set_panning (void)
static void
set_gamma(void)
{
- output_t *output;
-
- for (output = all_outputs; output; output = output->next) {
+ for (output_t *output = all_outputs; output; output = output->next) {
int i, size;
crtc_t *crtc;
XRRCrtcGamma *crtc_gamma;
@@ -1528,12 +1502,10 @@ set_gamma(void)
static void
set_primary(void)
{
- output_t *output;
-
if (no_primary) {
XRRSetOutputPrimary(dpy, root, None);
} else {
- for (output = all_outputs; output; output = output->next) {
+ for (output_t *output = all_outputs; output; output = output->next) {
if (!(output->changes & changes_primary))
continue;
if (output->primary)
@@ -1591,7 +1563,6 @@ static Status
crtc_apply (crtc_t *crtc)
{
RROutput *rr_outputs;
- int o;
Status s;
RRMode mode = None;
@@ -1601,14 +1572,14 @@ crtc_apply (crtc_t *crtc)
rr_outputs = calloc (crtc->noutput, sizeof (RROutput));
if (!rr_outputs)
return BadAlloc;
- for (o = 0; o < crtc->noutput; o++)
+ for (int o = 0; o < crtc->noutput; o++)
rr_outputs[o] = crtc->outputs[o]->output.xid;
mode = crtc->mode_info->id;
if (verbose) {
printf ("crtc %d: %12s %6.2f +%d+%d", crtc->crtc.index,
crtc->mode_info->name, mode_refresh (crtc->mode_info),
crtc->x, crtc->y);
- for (o = 0; o < crtc->noutput; o++)
+ for (int o = 0; o < crtc->noutput; o++)
printf (" \"%s\"", crtc->outputs[o]->output.string);
printf ("\n");
}
@@ -1670,15 +1641,13 @@ screen_apply (void)
static void
revert (void)
{
- int c;
-
/* first disable all crtcs */
- for (c = 0; c < res->ncrtc; c++)
+ for (int c = 0; c < res->ncrtc; c++)
crtc_disable (&crtcs[c]);
/* next reset screen size */
screen_revert ();
/* now restore all crtcs */
- for (c = 0; c < res->ncrtc; c++)
+ for (int c = 0; c < res->ncrtc; c++)
crtc_revert (&crtcs[c]);
}
@@ -1711,7 +1680,6 @@ static void
apply (void)
{
Status s;
- int c;
/*
* Hold the server grabbed while messing with
@@ -1726,7 +1694,7 @@ apply (void)
* Turn off any crtcs which are to be disabled or which are
* larger than the target size
*/
- for (c = 0; c < res->ncrtc; c++)
+ for (int c = 0; c < res->ncrtc; c++)
{
crtc_t *crtc = &crtcs[c];
XRRCrtcInfo *crtc_info = crtc->crtc_info;
@@ -1777,7 +1745,7 @@ apply (void)
* Set crtcs
*/
- for (c = 0; c < res->ncrtc; c++)
+ for (int c = 0; c < res->ncrtc; c++)
{
crtc_t *crtc = &crtcs[c];
@@ -1802,15 +1770,13 @@ apply (void)
static void
get_outputs (void)
{
- int o;
- output_t *q;
-
- for (o = 0; o < res->noutput; o++)
+ for (int o = 0; o < res->noutput; o++)
{
XRROutputInfo *output_info = XRRGetOutputInfo (dpy, res, res->outputs[o]);
output_t *output;
name_t output_name;
if (!output_info) fatal ("could not get output 0x%lx information\n", res->outputs[o]);
+ init_name(&output_name);
set_name_xid (&output_name, res->outputs[o]);
set_name_index (&output_name, o);
set_name_string (&output_name, output_info->name);
@@ -1873,7 +1839,7 @@ get_outputs (void)
set_output_info (output, res->outputs[o], output_info);
}
- for (q = all_outputs; q; q = q->next)
+ for (output_t *q = all_outputs; q; q = q->next)
{
if (!q->found)
{
@@ -1886,16 +1852,13 @@ get_outputs (void)
static void
mark_changing_crtcs (void)
{
- int c;
-
- for (c = 0; c < num_crtcs; c++)
+ for (int c = 0; c < num_crtcs; c++)
{
crtc_t *crtc = &crtcs[c];
- int o;
output_t *output;
/* walk old output list (to catch disables) */
- for (o = 0; o < crtc->crtc_info->noutput; o++)
+ for (int o = 0; o < crtc->crtc_info->noutput; o++)
{
output = find_output_by_xid (crtc->crtc_info->outputs[o]);
if (!output) fatal ("cannot find output 0x%lx\n",
@@ -1904,7 +1867,7 @@ mark_changing_crtcs (void)
crtc->changing = True;
}
/* walk new output list */
- for (o = 0; o < crtc->noutput; o++)
+ for (int o = 0; o < crtc->noutput; o++)
{
output = crtc->outputs[o];
if (output->changes)
@@ -1982,9 +1945,7 @@ check_crtc_for_output (crtc_t *crtc, out
static crtc_t *
find_crtc_for_output (output_t *output)
{
- int c;
-
- for (c = 0; c < output->output_info->ncrtc; c++)
+ for (int c = 0; c < output->output_info->ncrtc; c++)
{
crtc_t *crtc;
@@ -2001,14 +1962,13 @@ static void
set_positions (void)
{
output_t *output;
- Bool keep_going;
- Bool any_set;
int min_x, min_y;
for (;;)
{
- any_set = False;
- keep_going = False;
+ Bool any_set = False;
+ Bool keep_going = False;
+
for (output = all_outputs; output; output = output->next)
{
output_t *relation;
@@ -2100,10 +2060,9 @@ set_positions (void)
static void
set_screen_size (void)
{
- output_t *output;
Bool fb_specified = fb_width != 0 && fb_height != 0;
- for (output = all_outputs; output; output = output->next)
+ for (output_t *output = all_outputs; output; output = output->next)
{
XRRModeInfo *mode_info = output->mode_info;
int x, y, w, h;
@@ -2181,7 +2140,6 @@ pick_crtcs_score (output_t *outputs)
int my_score;
int score;
crtc_t *best_crtc;
- int c;
if (!outputs)
return 0;
@@ -2200,7 +2158,7 @@ pick_crtcs_score (output_t *outputs)
/*
* Now score with this output any valid crtc
*/
- for (c = 0; c < output->output_info->ncrtc; c++)
+ for (int c = 0; c < output->output_info->ncrtc; c++)
{
crtc_t *crtc;
@@ -2244,7 +2202,6 @@ pick_crtcs (void)
{
output_t *output;
int saved_crtc_noutput[num_crtcs];
- int n;
/*
* First try to match up newly enabled outputs with spare crtcs
@@ -2278,14 +2235,14 @@ pick_crtcs (void)
output->current_crtc_info = output->crtc_info;
/* Mark all CRTC as currently unused */
- for (n = 0; n < num_crtcs; n++) {
+ for (int n = 0; n < num_crtcs; n++) {
saved_crtc_noutput[n] = crtcs[n].crtc_info->noutput;
crtcs[n].crtc_info->noutput = 0;
}
pick_crtcs_score (all_outputs);
- for (n = 0; n < num_crtcs; n++)
+ for (int n = 0; n < num_crtcs; n++)
crtcs[n].crtc_info->noutput = saved_crtc_noutput[n];
for (output = all_outputs; output; output = output->next)
@@ -2322,7 +2279,7 @@ static void *
property_values_from_string(const char *str, const Atom type, const int format,
int *returned_nitems)
{
- char *token, *tmp;
+ char *tmp;
void *returned_bytes = NULL;
int nitems = 0, bytes_per_item;
@@ -2346,7 +2303,7 @@ property_values_from_string(const char *
tmp = strdup (str);
- for (token = strtok (tmp, ","); token; token = strtok (NULL, ","))
+ for (char *token = strtok (tmp, ","); token; token = strtok (NULL, ","))
{
char *endptr;
long int val = strtol (token, &endptr, 0);
@@ -2472,11 +2429,9 @@ print_output_property_value(int value_fo
static void
print_edid(int nitems, const unsigned char *prop)
{
- int k;
-
printf ("\n\t\t");
- for (k = 0; k < nitems; k++)
+ for (int k = 0; k < nitems; k++)
{
if (k != 0 && (k % 16) == 0)
{
@@ -2492,11 +2447,9 @@ print_edid(int nitems, const unsigned ch
static void
print_guid(const unsigned char *prop)
{
- int k;
-
printf("{");
- for (k = 0; k < 16; k++)
+ for (int k = 0; k < 16; k++)
{
printf("%02" PRIX8, prop[k]);
if (k == 3 || k == 5 || k == 7 || k == 9)
@@ -2516,7 +2469,6 @@ print_output_property(const char *atom_n
const unsigned char *prop)
{
int bytes_per_item;
- int k;
switch (value_format) {
case 8:
@@ -2547,7 +2499,7 @@ print_output_property(const char *atom_n
return;
}
- for (k = 0; k < nitems; k++)
+ for (int k = 0; k < nitems; k++)
{
if (k != 0)
{
@@ -2568,7 +2520,6 @@ static void
get_providers (void)
{
XRRProviderResources *pr;
- int i;
if (!has_1_4 || providers)
return;
@@ -2579,7 +2530,7 @@ get_providers (void)
if (!providers)
fatal ("out of memory\n");
- for (i = 0; i < num_providers; i++) {
+ for (int i = 0; i < num_providers; i++) {
provider_t *provider = &providers[i];
name_t *name = &provider->provider;
XRRProviderInfo *info = XRRGetProviderInfo(dpy, res, pr->providers[i]);
@@ -2596,11 +2547,9 @@ get_providers (void)
static provider_t *
find_provider (name_t *name)
{
- int i;
-
if ((name->kind & name_xid) && name->xid == 0)
return NULL;
- for (i = 0; i < num_providers; i++) {
+ for (int i = 0; i < num_providers; i++) {
provider_t *p = &providers[i];
name_kind_t common = name->kind & p->provider.kind;
@@ -2642,7 +2591,6 @@ main (int argc, char **argv)
XRRScreenConfiguration *sc;
int nsize;
int nrate;
- short *rates;
Status status = RRSetConfigFailed;
int rot = -1;
int query = False;
@@ -2650,8 +2598,7 @@ main (int argc, char **argv)
Rotation current_rotation;
XEvent event;
XRRScreenChangeNotifyEvent *sce;
- char *display_name = NULL;
- int i;
+ char *display_name = NULL;
SizeID current_size;
short current_rate;
double rate = -1;
@@ -2682,7 +2629,7 @@ main (int argc, char **argv)
Bool toggle_y = False;
program_name = argv[0];
- for (i = 1; i < argc; i++) {
+ for (int i = 1; i < argc; i++) {
if (!strcmp ("-display", argv[i]) || !strcmp ("--display", argv[i]) ||
!strcmp ("-d", argv[i])) {
if (++i >= argc) argerr ("%s requires an argument\n", argv[i-1]);
@@ -2808,6 +2755,26 @@ main (int argc, char **argv)
action_requested = True;
continue;
}
+ if (!strcmp("--filter", argv[i])) {
+ if (!config_output) argerr ("%s must be used after --output\n", argv[i]);
+ if (++i >= argc) argerr("%s requires an argument\n", argv[i-1]);
+
+ filter_type = -1;
+ for (size_t t = 0; t < sizeof(filter_names) / sizeof(filter_names[0]); t++)
+ {
+ if (!strcmp(filter_names[t], argv[i]))
+ {
+ filter_type = t;
+ break;
+ }
+ }
+
+ if (filter_type == -1) argerr("Bad argument: %s, for a filter\n", argv[i]);
+
+ config_output->changes |= changes_filter;
+ action_requested = True;
+ continue;
+ }
if (!strcmp ("--crtc", argv[i])) {
if (!config_output) argerr ("%s must be used after --output\n", argv[i]);
if (++i >= argc) argerr ("%s requires an argument\n", argv[i-1]);
@@ -2934,11 +2901,21 @@ main (int argc, char **argv)
continue;
}
if (!strcmp ("--gamma", argv[i])) {
+ char junk;
if (!config_output) argerr ("%s must be used after --output\n", argv[i]);
if (++i >= argc) argerr ("%s requires an argument\n", argv[i-1]);
- if (sscanf(argv[i], "%f:%f:%f", &config_output->gamma.red,
- &config_output->gamma.green, &config_output->gamma.blue) != 3)
- argerr ("%s: invalid argument '%s'\n", argv[i-1], argv[i]);
+ if (sscanf(argv[i], "%f:%f:%f%c", &config_output->gamma.red,
+ &config_output->gamma.green, &config_output->gamma.blue, &junk) != 3)
+ {
+ /* check if it's a single floating-point value,
+ * to be applied to all components */
+ if (sscanf(argv[i], "%f%c", &config_output->gamma.red, &junk) != 1)
+ argerr ("%s: invalid argument '%s'\n", argv[i-1], argv[i]);
+ config_output->gamma.green = config_output->gamma.blue = config_output->gamma.red;
+ }
+ if (config_output->gamma.red <= 0.0 || config_output->gamma.green <= 0.0 ||
+ config_output->gamma.blue <= 0.0)
+ argerr ("gamma correction factors must be positive\n");
config_output->changes |= changes_gamma;
setit_1_2 = True;
continue;
@@ -2981,10 +2958,17 @@ main (int argc, char **argv)
if (!strcmp ("--scale", argv[i]))
{
double sx, sy;
+ char junk;
if (!config_output) argerr ("%s must be used after --output\n", argv[i]);
if (++i >= argc) argerr ("%s requires an argument\n", argv[i-1]);
- if (sscanf (argv[i], "%lfx%lf", &sx, &sy) != 2)
- argerr ("failed to parse '%s' as a scaling factor\n", argv[i]);
+ if (sscanf (argv[i], "%lfx%lf%c", &sx, &sy, &junk) != 2)
+ {
+ if (sscanf (argv[i], "%lf%c", &sx, &junk) != 1)
+ argerr ("failed to parse '%s' as a scaling factor\n", argv[i]);
+ sy = sx;
+ }
+ if (sx <= 0.0 || sy <= 0.0)
+ argerr ("scaling factors must be positive\n");
init_transform (&config_output->transform);
config_output->transform.transform.matrix[0][0] = XDoubleToFixed (sx);
config_output->transform.transform.matrix[1][1] = XDoubleToFixed (sy);
@@ -3014,7 +2998,7 @@ main (int argc, char **argv)
}
if (!strcmp ("--transform", argv[i])) {
double transform[3][3];
- int k, l;
+
if (!config_output) argerr ("%s must be used after --output\n", argv[i]);
if (++i >= argc) argerr ("%s requires an argument\n", argv[i-1]);
init_transform (&config_output->transform);
@@ -3027,8 +3011,8 @@ main (int argc, char **argv)
!= 9)
argerr ("failed to parse '%s' as a transformation\n", argv[i]);
init_transform (&config_output->transform);
- for (k = 0; k < 3; k++)
- for (l = 0; l < 3; l++) {
+ for (int k = 0; k < 3; k++)
+ for (int l = 0; l < 3; l++) {
config_output->transform.transform.matrix[k][l] = XDoubleToFixed (transform[k][l]);
}
config_output->transform.filter = "bilinear";
@@ -3226,7 +3210,6 @@ main (int argc, char **argv)
if (!strcmp("--setmonitor", argv[i]))
{
umonitor_t *m = calloc(1, sizeof (umonitor_t)), **l;
- char *t;
char *o;
char *n;
char *geom;
@@ -3249,6 +3232,8 @@ main (int argc, char **argv)
o = argv[++i];
if (strcmp(o, "none") != 0) {
+ char *t;
+
printf ("output list %s\n", o);
for (; (t = strtok(o, ",")) != NULL; o = NULL) {
m->outputs = realloc(m->outputs, (m->noutput + 1) * sizeof (name_t));
@@ -3323,13 +3308,11 @@ main (int argc, char **argv)
has_1_5 = True;
if (has_1_2 && modeit)
{
- umode_t *m;
-
get_screen (True);
get_crtcs();
get_outputs();
- for (m = umodes; m; m = m->next)
+ for (umode_t *m = umodes; m; m = m->next)
{
XRRModeInfo *e;
output_t *o;
@@ -3372,17 +3355,13 @@ main (int argc, char **argv)
}
if (has_1_2 && propit)
{
- output_t *output;
-
get_screen (True);
get_crtcs();
get_outputs();
- for (output = all_outputs; output; output = output->next)
+ for (output_t *output = all_outputs; output; output = output->next)
{
- output_prop_t *prop;
-
- for (prop = output->props; prop; prop = prop->next)
+ for (output_prop_t *prop = output->props; prop; prop = prop->next)
{
Atom name = XInternAtom (dpy, prop->name, False);
Atom type;
@@ -3581,26 +3560,20 @@ main (int argc, char **argv)
}
}
if (monitorit) {
- umonitor_t *u;
- Atom name;
-
if (!has_1_5) {
printf("RandR 1.5 not supported\n");
exit(0);
}
get_screen(True);
- get_monitors(True);
+ get_monitors(False);
get_crtcs();
get_outputs();
- for (u = umonitors; u; u = u->next) {
+ for (umonitor_t *u = umonitors; u; u = u->next) {
if (u->set) {
- XRRMonitorInfo *m;
- int o;
-
- name = XInternAtom(dpy, u->name, False);
- m = XRRAllocateMonitor(dpy, u->noutput);
+ Atom name = XInternAtom(dpy, u->name, False);
+ XRRMonitorInfo *m = XRRAllocateMonitor(dpy, u->noutput);
m->name = name;
m->primary = u->primary;
@@ -3610,7 +3583,7 @@ main (int argc, char **argv)
m->height = u->height;
m->mwidth = u->mmwidth;
m->mheight = u->mmheight;
- for (o = 0; o < u->noutput; o++) {
+ for (int o = 0; o < u->noutput; o++) {
output_t *output = find_output(&u->outputs[o]);
if (!output)
fatal("cannot find output\n");
@@ -3621,15 +3594,16 @@ main (int argc, char **argv)
XRRFreeMonitors(m);
} else {
- int m;
+ Atom name = XInternAtom(dpy, u->name, True);
- name = XInternAtom(dpy, u->name, True);
if (!name) {
printf("No monitor named '%s'\n", u->name);
} else {
if (!monitors)
printf ("No monitors\n");
else {
+ int m;
+
for (m = 0; m < monitors->n; m++) {
if (monitors->monitors[m].name == name)
break;
@@ -3647,9 +3621,7 @@ main (int argc, char **argv)
}
if (query_1_2 || (query && has_1_2 && !query_1))
{
- output_t *output;
- int m;
-
+
#define ModeShown 0x80000000
get_screen (current);
@@ -3661,15 +3633,13 @@ main (int argc, char **argv)
DisplayWidth (dpy, screen), DisplayHeight(dpy, screen),
maxWidth, maxHeight);
- for (output = all_outputs; output; output = output->next)
+ for (output_t *output = all_outputs; output; output = output->next)
{
XRROutputInfo *output_info = output->output_info;
crtc_t *cur_crtc = output->crtc_info;
XRRCrtcInfo *crtc_info = cur_crtc ? cur_crtc->crtc_info : NULL;
XRRModeInfo *cur_mode = output->mode_info;
- Atom *props;
- int j, nprop;
- Bool *mode_shown;
+ int nprop;
Rotation rotations = output_rotations (output);
printf ("%s %s", output_info->name, connection[output_info->connection]);
@@ -3701,16 +3671,18 @@ main (int argc, char **argv)
{
Bool first = True;
printf (" (");
- for (i = 0; i < 4; i ++) {
+ for (int i = 0; i < 4; i ++) {
if ((rotations >> i) & 1) {
- if (!first) printf (" "); first = False;
+ if (!first) printf (" ");
printf("%s", direction[i]);
+ first = False;
}
}
if (rotations & RR_Reflect_X)
{
- if (!first) printf (" "); first = False;
+ if (!first) printf (" ");
printf ("x axis");
+ first = False;
}
if (rotations & RR_Reflect_Y)
{
@@ -3761,7 +3733,7 @@ main (int argc, char **argv)
printf ("\tBrightness: %#.2g\n", output->brightness);
}
printf ("\tClones: ");
- for (j = 0; j < output_info->nclone; j++)
+ for (int j = 0; j < output_info->nclone; j++)
{
output_t *clone = find_output_by_xid (output_info->clones[j]);
@@ -3771,7 +3743,7 @@ main (int argc, char **argv)
if (output->crtc_info)
printf ("\tCRTC: %d\n", output->crtc_info->crtc.index);
printf ("\tCRTCs: ");
- for (j = 0; j < output_info->ncrtc; j++)
+ for (int j = 0; j < output_info->ncrtc; j++)
{
crtc_t *crtc = find_crtc_by_xid (output_info->crtcs[j]);
if (crtc)
@@ -3792,12 +3764,10 @@ main (int argc, char **argv)
}
if (verbose)
{
- int x, y;
-
printf ("\tTransform: ");
- for (y = 0; y < 3; y++)
+ for (int y = 0; y < 3; y++)
{
- for (x = 0; x < 3; x++)
+ for (int x = 0; x < 3; x++)
printf (" %f", XFixedToDouble (output->transform.transform.matrix[y][x]));
if (y < 2)
printf ("\n\t ");
@@ -3808,16 +3778,16 @@ main (int argc, char **argv)
}
if (verbose || properties)
{
- props = XRRListOutputProperties (dpy, output->output.xid,
- &nprop);
- for (j = 0; j < nprop; j++) {
+ Atom *props = XRRListOutputProperties (dpy, output->output.xid,
+ &nprop);
+
+ for (int j = 0; j < nprop; j++) {
unsigned char *prop;
int actual_format;
unsigned long nitems, bytes_after;
Atom actual_type;
XRRPropertyInfo *propinfo;
char *atom_name = XGetAtomName (dpy, props[j]);
- int k;
XRRGetOutputProperty (dpy, output->output.xid, props[j],
0, 100, False, False,
@@ -3837,7 +3807,7 @@ main (int argc, char **argv)
{
printf ("\t\trange%s: ",
(propinfo->num_values == 2) ? "" : "s");
- for (k = 0; k < propinfo->num_values / 2; k++)
+ for (int k = 0; k < propinfo->num_values / 2; k++)
{
printf ("(");
print_output_property_value (32, actual_type,
@@ -3854,7 +3824,7 @@ main (int argc, char **argv)
if (!propinfo->range && propinfo->num_values > 0)
{
printf ("\t\tsupported: ");
- for (k = 0; k < propinfo->num_values; k++)
+ for (int k = 0; k < propinfo->num_values; k++)
{
print_output_property_value (32, actual_type,
(unsigned char *) &(propinfo->values[k]));
@@ -3870,9 +3840,15 @@ main (int argc, char **argv)
if (verbose)
{
- for (j = 0; j < output_info->nmode; j++)
+ for (int j = 0; j < output_info->nmode; j++)
{
XRRModeInfo *mode = find_mode_by_xid (output_info->modes[j]);
+ if (!mode)
+ {
+ printf (" [Unknown mode ID 0x%x]\n",
+ (int)output_info->modes[j]);
+ continue;
+ }
print_verbose_mode (mode, mode == output->mode_info,
j < output_info->npreferred);
@@ -3881,22 +3857,28 @@ main (int argc, char **argv)
}
else
{
- mode_shown = calloc (output_info->nmode, sizeof (Bool));
+ Bool *mode_shown = calloc (output_info->nmode, sizeof (Bool));
if (!mode_shown) fatal ("out of memory\n");
- for (j = 0; j < output_info->nmode; j++)
+ for (int j = 0; j < output_info->nmode; j++)
{
XRRModeInfo *jmode, *kmode;
- int k;
-
+
if (mode_shown[j]) continue;
-
+
jmode = find_mode_by_xid (output_info->modes[j]);
+ if (!jmode)
+ {
+ printf (" [Unknown mode ID 0x%x]\n",
+ (int)output_info->modes[j]);
+ continue;
+ }
printf (" ");
printf (" %-12s", jmode->name);
- for (k = j; k < output_info->nmode; k++)
+ for (int k = j; k < output_info->nmode; k++)
{
if (mode_shown[k]) continue;
kmode = find_mode_by_xid (output_info->modes[k]);
+ if (!kmode) continue;
if (strcmp (jmode->name, kmode->name) != 0) continue;
mode_shown[k] = True;
kmode->modeFlags |= ModeShown;
@@ -3915,7 +3897,7 @@ main (int argc, char **argv)
free (mode_shown);
}
}
- for (m = 0; m < res->nmode; m++)
+ for (int m = 0; m < res->nmode; m++)
{
XRRModeInfo *mode = &res->modes[m];
@@ -3925,8 +3907,6 @@ main (int argc, char **argv)
exit (0);
}
if (list_providers) {
- int k;
-
if (!has_1_4) {
printf ("RandR 1.4 not supported\n");
exit (0);
@@ -3936,16 +3916,14 @@ main (int argc, char **argv)
get_providers ();
if (providers) {
- int j;
-
printf("Providers: number : %d\n", num_providers);
- for (j = 0; j < num_providers; j++) {
+ for (int j = 0; j < num_providers; j++) {
provider_t *provider = &providers[j];
XRRProviderInfo *info = provider->info;
printf("Provider %d: id: 0x%x cap: 0x%x", j, (int)provider->provider.xid, info->capabilities);
- for (k = 0; k < 4; k++)
+ for (int k = 0; k < 4; k++)
if (info->capabilities & (1 << k))
printf(", %s", capability_name(1<<k));
@@ -3966,11 +3944,9 @@ main (int argc, char **argv)
get_outputs();
if (monitors) {
- int m, o;
-
printf("Monitors: %d\n", monitors->n);
- for (m = 0; m < monitors->n; m++) {
+ for (int m = 0; m < monitors->n; m++) {
printf (" %d: %s%s%s %d/%dx%d/%d+%d+%d ",
m,
monitors->monitors[m].automatic ? "+" : "",
@@ -3982,7 +3958,7 @@ main (int argc, char **argv)
monitors->monitors[m].mheight,
monitors->monitors[m].x,
monitors->monitors[m].y);
- for (o = 0; o < monitors->monitors[m].noutput; o++) {
+ for (int o = 0; o < monitors->monitors[m].noutput; o++) {
output_t *output = find_output_by_xid(monitors->monitors[m].outputs[o]);
if (output)
printf (" %s", output->output.string);
@@ -4042,7 +4018,9 @@ main (int argc, char **argv)
}
else
{
- rates = XRRConfigRates (sc, size, &nrate);
+ int i;
+ short *rates = XRRConfigRates (sc, size, &nrate);
+
for (i = 0; i < nrate; i++)
if (rate == rates[i])
break;
@@ -4061,8 +4039,8 @@ main (int argc, char **argv)
if (query || query_1) {
printf(" SZ: Pixels Physical Refresh\n");
- for (i = 0; i < nsize; i++) {
- int j;
+ for (int i = 0; i < nsize; i++) {
+ short *rates;
printf ("%c%-2d %5d x %-5d (%4dmm x%4dmm )",
i == current_size ? '*' : ' ',
@@ -4070,7 +4048,7 @@ main (int argc, char **argv)
sizes[i].mwidth, sizes[i].mheight);
rates = XRRConfigRates (sc, i, &nrate);
if (nrate) printf (" ");
- for (j = 0; j < nrate; j++)
+ for (int j = 0; j < nrate; j++)
printf ("%c%-4d",
i == current_size && rates[j] == current_rate ? '*' : ' ',
rates[j]);
@@ -4092,7 +4070,7 @@ main (int argc, char **argv)
reflection_name (current_rotation));
printf ("Rotations possible - ");
- for (i = 0; i < 4; i ++) {
+ for (int i = 0; i < 4; i ++) {
if ((rotations >> i) & 1) printf("%s ", direction[i]);
}
printf ("\n");
Index: xsrc/external/mit/xstdcmap/dist/compile
diff -u xsrc/external/mit/xstdcmap/dist/compile:1.3 xsrc/external/mit/xstdcmap/dist/compile:1.4
--- xsrc/external/mit/xstdcmap/dist/compile:1.3 Sun Mar 3 08:36:22 2019
+++ xsrc/external/mit/xstdcmap/dist/compile Sun Jan 8 09:59:52 2023
@@ -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 <[email protected]>.
#
# 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: