Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package xrandr for openSUSE:Factory checked in at 2022-12-07 17:33:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/xrandr (Old) and /work/SRC/openSUSE:Factory/.xrandr.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xrandr" Wed Dec 7 17:33:17 2022 rev:16 rq:1040097 version:1.5.2 Changes: -------- --- /work/SRC/openSUSE:Factory/xrandr/xrandr.changes 2021-03-16 15:43:12.124921733 +0100 +++ /work/SRC/openSUSE:Factory/.xrandr.new.1835/xrandr.changes 2022-12-07 17:33:23.284021056 +0100 @@ -1,0 +2,14 @@ +Sun Dec 4 22:32:04 UTC 2022 - Stefan Dirsch <[email protected]> + +- Update to version 1.5.2 + * gitlab CI: add a basic build test + * Fix spelling/wording issues + * gitlab CI: stop requiring Signed-off-by in commits + * Variable scope reductions as suggested by cppcheck + * Fix a -Wsign-compare warning + * Remove unused macros left over from original RandR 1.2 code + * Remove unused definition of rectangle_t + * Constify array argument to find_last_non_clamped() +- refreshed xrandr-print-outputs-per-provider.patch + +------------------------------------------------------------------- Old: ---- xrandr-1.5.1.tar.xz New: ---- xrandr-1.5.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xrandr.spec ++++++ --- /var/tmp/diff_new_pack.ARAbYM/_old 2022-12-07 17:33:23.636022983 +0100 +++ /var/tmp/diff_new_pack.ARAbYM/_new 2022-12-07 17:33:23.640023005 +0100 @@ -1,7 +1,7 @@ # # spec file for package xrandr # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: xrandr -Version: 1.5.1 +Version: 1.5.2 Release: 0 Summary: Primitive command line interface to RandR extension License: MIT ++++++ xrandr-1.5.1.tar.xz -> xrandr-1.5.2.tar.xz ++++++ ++++ 21052 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/xrandr-1.5.1/ChangeLog new/xrandr-1.5.2/ChangeLog --- old/xrandr-1.5.1/ChangeLog 2019-08-12 19:50:54.000000000 +0200 +++ new/xrandr-1.5.2/ChangeLog 2022-12-04 00:49:18.000000000 +0100 @@ -1,3 +1,96 @@ +commit 6f714830da6c8d74f024be6b0bb32c1ea39c1217 +Author: Alan Coopersmith <[email protected]> +Date: Sat Dec 3 15:47:06 2022 -0800 + + xrandr 1.5.2 + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 213e10f1996b08305df55c237c90152227e0c5f7 +Author: Alan Coopersmith <[email protected]> +Date: Fri Oct 28 18:29:04 2022 -0700 + + Constify array argument to find_last_non_clamped() + + Suggested by cppcheck: + + xrandr.c:1046:30: style: Parameter 'array' can be declared with const [constParameter] + find_last_non_clamped(CARD16 array[], int size) + ^ + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit fc331d39447412320e856f56bab88613264cd8f5 +Author: Alan Coopersmith <[email protected]> +Date: Fri Oct 28 18:25:19 2022 -0700 + + Remove unused definition of rectangle_t + + Was added in commit 854a7c2916455fec5e but never used. + Reported by cppcheck unusedStructMember warning. + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit e8c4a2727196c8f9bf76df30c5c0a8671e0e5dfe +Author: Alan Coopersmith <[email protected]> +Date: Fri Oct 28 18:22:11 2022 -0700 + + Remove unused macros left over from original RandR 1.2 code + + Use of these was removed in commit cb017692883daf64 in 2006. + Reported by clang -Wunused-macros + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 3613fea4472741d8423c38a82e5569739d53bbb7 +Author: Alan Coopersmith <[email protected]> +Date: Fri Oct 28 18:09:58 2022 -0700 + + Fix a -Wsign-compare warning + + xrandr.c: In function âmainâ: + xrandr.c:2780:24: warning: comparison between signed and unsigned integer + expressions [-Wsign-compare] + for (int t = 0; t < sizeof(filter_names) / sizeof(filter_names[0]); t++) + ^ + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 289722fc8f2c9916a9631c7e4c796269b99b98f8 +Author: Alan Coopersmith <[email protected]> +Date: Fri Oct 28 18:07:20 2022 -0700 + + Variable scope reductions as suggested by cppcheck + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 8231beec67ee274d10b5d4c5b910d673dc6d1cc8 +Author: Alan Coopersmith <[email protected]> +Date: Thu Jul 28 17:30:21 2022 -0700 + + gitlab CI: stop requiring Signed-off-by in commits + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 2fb90d4d626dcc0432f96da3fa438724d637bdd3 +Author: Alan Coopersmith <[email protected]> +Date: Sun Jan 9 12:38:26 2022 -0800 + + Fix spelling/wording issues + + Found by using: + codespell --builtin clear,rare,usage,informal,code,names + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 296effc3ac7b2f095e889488d82e9d1a4fffd824 +Author: Alan Coopersmith <[email protected]> +Date: Tue Dec 7 13:34:30 2021 -0800 + + gitlab CI: add a basic build test + + Signed-off-by: Alan Coopersmith <[email protected]> + commit 824484e5ba50f1e6858ea990393c181a249c3a5e Author: Matt Turner <[email protected]> Date: Mon Aug 12 10:42:41 2019 -0700 @@ -86,7 +179,7 @@ Signed-off-by: Peter Hutterer <[email protected]> commit 9882680c9f7f433a47514a9cb799c79e3e10a024 -Author: Pali Rohár <[email protected]> +Author: Pali Rohár <[email protected]> Date: Sat Mar 10 16:23:29 2018 +0100 Document that --dpi and --fbmm options set DPI of whole X screen @@ -197,7 +290,7 @@ Signed-off-by: Aaron Plattner <[email protected]> commit 5d5db88d106a49d7560a8042fa054df8b609f00a -Author: Pali Rohár <[email protected]> +Author: Pali Rohár <[email protected]> Date: Sun May 28 23:33:26 2017 +0200 Document format of --dpi option in non-ambiguous way @@ -411,7 +504,7 @@ xrandr.c commit 193a358563a59c1a3fc55f55029c605e2419c80b -Author: Stéphane Aulery <[email protected]> +Author: Stéphane Aulery <[email protected]> Date: Sat Jun 29 16:50:25 2013 -0700 Mention of --brightness with -h option @@ -516,7 +609,7 @@ Signed-off-by: Aaron Plattner <[email protected]> commit 00c795e99fe29ecd56e05e915e508c7af0ac39ad -Author: Ville Syrjälä <[email protected]> +Author: Ville Syrjälä < <[email protected]> Date: Fri May 31 17:01:54 2013 +0300 xrandr: Use floating point for VTotal when calculating refresh rate @@ -529,7 +622,7 @@ Reviewed-by: Aaron Plattner <[email protected]> commit 8f9b993342fddfceaa1afbec2996ce10038f10d7 -Author: Ville Syrjälä <[email protected]> +Author: Ville Syrjälä < <[email protected]> Date: Fri May 31 17:01:53 2013 +0300 xrandr: Use more decimal places when printing various rates @@ -1437,7 +1530,7 @@ Signed-off-by: Gaetan Nadon <[email protected]> commit ac6606d8da914610446c5327813798bfbba4d6c2 -Author: Ãric Piel <[email protected]> +Author: Ãric Piel <[email protected]> Date: Wed Jan 6 14:42:15 2010 +0100 xrandr: fix brightness to prevent gamma to overflow and to allow 0 @@ -1593,7 +1686,7 @@ Reviewed-by: Rémi Cardona <[email protected]> commit b84560759141ed52b8779c184184f888e9be8b2f -Author: Ãric Piel <[email protected]> +Author: Ãric Piel <[email protected]> Date: Mon Oct 26 14:11:02 2009 +0100 xrandr: do not segfault when "--scale" or "--transform" have no output @@ -1607,7 +1700,7 @@ Signed-off-by: Matthias Hopf <[email protected]> commit 34829957441a10f6b6e31141aa1018f7a72aeaf9 -Author: Ãric Piel <[email protected]> +Author: Ãric Piel <[email protected]> Date: Mon Oct 26 13:57:10 2009 +0100 xrandr: make --query really the default option @@ -1697,7 +1790,7 @@ Signed-off-by: Federico Mena Quintero <[email protected]> commit 68d5134142e3c616f3996c7ea8d08c887ce56118 -Author: Ãric Piel <[email protected]> +Author: Ãric Piel <[email protected]> Date: Tue Jul 14 21:36:32 2009 +0200 xrandr: Document --nograb option @@ -1830,7 +1923,7 @@ Several fatal() were missing \n. commit 9ea6e4210d49c13991a7d07e54f6f59e3dc8ce72 -Author: Ãric Piel <[email protected]> +Author: Ãric Piel <[email protected]> Date: Mon Jan 19 16:18:46 2009 +0100 Add docs for --transform and --scale. @@ -2947,7 +3040,7 @@ configure cache, you cache it, and the cached value is probably wrong. commit 5666f22654447eb381186a85a8e1630d419b0a88 -Author: Søren Sandmann Pedersen <[email protected]> +Author: Søren Sandmann Pedersen <[email protected]> Date: Fri Jul 1 20:27:45 2005 +0000 Build systems for xrdb, xrandr, xrefresh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/xrandr-1.5.1/README.md new/xrandr-1.5.2/README.md --- old/xrandr-1.5.1/README.md 2019-08-12 19:50:48.000000000 +0200 +++ new/xrandr-1.5.2/README.md 2022-12-04 00:49:09.000000000 +0100 @@ -6,7 +6,7 @@ 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/app/xrandr diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/xrandr-1.5.1/compile new/xrandr-1.5.2/compile --- old/xrandr-1.5.1/compile 2019-08-12 19:50:51.000000000 +0200 +++ new/xrandr-1.5.2/compile 2022-12-04 00:49:13.000000000 +0100 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2018 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 @@ -53,7 +53,7 @@ MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/xrandr-1.5.1/config.h.in new/xrandr-1.5.2/config.h.in --- old/xrandr-1.5.1/config.h.in 2019-08-12 19:50:50.000000000 +0200 +++ new/xrandr-1.5.2/config.h.in 2022-12-04 00:49:13.000000000 +0100 @@ -6,12 +6,12 @@ /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM -/* Define to 1 if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H +/* Define to 1 if you have the <stdio.h> header file. */ +#undef HAVE_STDIO_H + /* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H @@ -60,7 +60,9 @@ /* Patch version of this package */ #undef PACKAGE_VERSION_PATCHLEVEL -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Version number of package */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/xrandr-1.5.1/configure.ac new/xrandr-1.5.2/configure.ac --- old/xrandr-1.5.1/configure.ac 2019-08-12 19:50:48.000000000 +0200 +++ new/xrandr-1.5.2/configure.ac 2022-12-04 00:49:09.000000000 +0100 @@ -22,8 +22,8 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([xrandr], [1.5.1], - [https://gitlab.freedesktop.org/xorg/app/xrandr/issues], [xrandr]) +AC_INIT([xrandr], [1.5.2], + [https://gitlab.freedesktop.org/xorg/app/xrandr/-/issues], [xrandr]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/xrandr-1.5.1/man/xrandr.man new/xrandr-1.5.2/man/xrandr.man --- old/xrandr-1.5.1/man/xrandr.man 2019-08-12 19:50:48.000000000 +0200 +++ new/xrandr-1.5.2/man/xrandr.man 2022-12-04 00:49:09.000000000 +0100 @@ -96,7 +96,7 @@ .IP \-\-verbose Causes xrandr to be more verbose. When used with \-q (or without other options), xrandr will display more information about the server state. Please -note that the gamma and brightness informations are only approximations of the +note that the gamma and brightness information are only approximations of the complete color profile stored in the server. When used along with options that reconfigure the system, progress will be reported while executing the configuration changes. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/xrandr-1.5.1/missing new/xrandr-1.5.2/missing --- old/xrandr-1.5.1/missing 2019-08-12 19:50:51.000000000 +0200 +++ new/xrandr-1.5.2/missing 2022-12-04 00:49:13.000000000 +0100 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <[email protected]>, 1996. # This program is free software; you can redistribute it and/or modify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/xrandr-1.5.1/xrandr.c new/xrandr-1.5.2/xrandr.c --- old/xrandr-1.5.1/xrandr.c 2019-08-12 19:50:48.000000000 +0200 +++ new/xrandr-1.5.2/xrandr.c 2022-12-04 00:49:09.000000000 +0100 @@ -204,7 +204,7 @@ /*NOTREACHED*/ } -/* Because fmin requires C99 suppport */ +/* Because fmin requires C99 support */ static inline double dmin (double x, double y) { return x < y ? x : y; @@ -213,11 +213,9 @@ 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"; @@ -265,10 +263,6 @@ } relation_t; typedef struct { - int x, y, width, height; -} rectangle_t; - -typedef struct { int x1, y1, x2, y2; } box_t; @@ -431,19 +425,6 @@ "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; @@ -500,22 +481,21 @@ { 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; @@ -528,11 +508,10 @@ 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); @@ -613,12 +592,10 @@ 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) @@ -711,9 +688,8 @@ 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; @@ -813,10 +789,9 @@ 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; @@ -847,11 +822,10 @@ 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) @@ -903,11 +877,10 @@ 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; @@ -944,13 +917,10 @@ preferred_mode (output_t *output) { XRROutputInfo *output_info = output->output_info; - int m; - XRRModeInfo *best; - int bestDist; - - best = NULL; - bestDist = 0; - for (m = 0; m < output_info->nmode; m++) + XRRModeInfo *best = NULL; + int bestDist = 0; + + for (int m = 0; m < output_info->nmode; m++) { XRRModeInfo *mode_info = find_mode_by_xid (output_info->modes[m]); int dist; @@ -977,9 +947,8 @@ 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; @@ -989,9 +958,8 @@ 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; @@ -1030,9 +998,8 @@ 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) @@ -1051,14 +1018,13 @@ 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)) @@ -1077,9 +1043,9 @@ /* 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; } @@ -1351,13 +1317,11 @@ 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; @@ -1453,9 +1417,7 @@ 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; @@ -1540,12 +1502,10 @@ 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) @@ -1603,7 +1563,6 @@ crtc_apply (crtc_t *crtc) { RROutput *rr_outputs; - int o; Status s; RRMode mode = None; @@ -1613,14 +1572,14 @@ 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"); } @@ -1682,15 +1641,13 @@ 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]); } @@ -1723,7 +1680,6 @@ apply (void) { Status s; - int c; /* * Hold the server grabbed while messing with @@ -1738,7 +1694,7 @@ * 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; @@ -1789,7 +1745,7 @@ * Set crtcs */ - for (c = 0; c < res->ncrtc; c++) + for (int c = 0; c < res->ncrtc; c++) { crtc_t *crtc = &crtcs[c]; @@ -1814,10 +1770,7 @@ 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; @@ -1886,7 +1839,7 @@ 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) { @@ -1899,16 +1852,13 @@ 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", @@ -1917,7 +1867,7 @@ 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) @@ -1995,9 +1945,7 @@ 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; @@ -2014,14 +1962,13 @@ 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; @@ -2113,10 +2060,9 @@ 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; @@ -2194,7 +2140,6 @@ int my_score; int score; crtc_t *best_crtc; - int c; if (!outputs) return 0; @@ -2213,7 +2158,7 @@ /* * 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; @@ -2257,7 +2202,6 @@ { output_t *output; int saved_crtc_noutput[num_crtcs]; - int n; /* * First try to match up newly enabled outputs with spare crtcs @@ -2291,14 +2235,14 @@ 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) @@ -2335,7 +2279,7 @@ 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; @@ -2359,7 +2303,7 @@ 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); @@ -2485,11 +2429,9 @@ 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) { @@ -2505,11 +2447,9 @@ 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) @@ -2529,7 +2469,6 @@ const unsigned char *prop) { int bytes_per_item; - int k; switch (value_format) { case 8: @@ -2560,7 +2499,7 @@ return; } - for (k = 0; k < nitems; k++) + for (int k = 0; k < nitems; k++) { if (k != 0) { @@ -2581,7 +2520,6 @@ get_providers (void) { XRRProviderResources *pr; - int i; if (!has_1_4 || providers) return; @@ -2592,7 +2530,7 @@ 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]); @@ -2609,11 +2547,9 @@ 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; @@ -2655,7 +2591,6 @@ XRRScreenConfiguration *sc; int nsize; int nrate; - short *rates; Status status = RRSetConfigFailed; int rot = -1; int query = False; @@ -2663,8 +2598,7 @@ 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; @@ -2695,7 +2629,7 @@ 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]); @@ -2822,13 +2756,11 @@ continue; } if (!strcmp("--filter", argv[i])) { - int t; - 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 (t = 0; t < sizeof(filter_names) / sizeof(filter_names[0]); t++) + for (size_t t = 0; t < sizeof(filter_names) / sizeof(filter_names[0]); t++) { if (!strcmp(filter_names[t], argv[i])) { @@ -3066,7 +2998,7 @@ } 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); @@ -3079,8 +3011,8 @@ != 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"; @@ -3278,7 +3210,6 @@ if (!strcmp("--setmonitor", argv[i])) { umonitor_t *m = calloc(1, sizeof (umonitor_t)), **l; - char *t; char *o; char *n; char *geom; @@ -3301,6 +3232,8 @@ 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)); @@ -3375,13 +3308,11 @@ 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; @@ -3424,17 +3355,13 @@ } 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; @@ -3633,9 +3560,6 @@ } } if (monitorit) { - umonitor_t *u; - Atom name; - if (!has_1_5) { printf("RandR 1.5 not supported\n"); exit(0); @@ -3646,13 +3570,10 @@ 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; @@ -3662,7 +3583,7 @@ 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"); @@ -3673,15 +3594,16 @@ 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; @@ -3699,9 +3621,7 @@ } if (query_1_2 || (query && has_1_2 && !query_1)) { - output_t *output; - int m; - + #define ModeShown 0x80000000 get_screen (current); @@ -3713,15 +3633,13 @@ 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]); @@ -3753,7 +3671,7 @@ { Bool first = True; printf (" ("); - for (i = 0; i < 4; i ++) { + for (int i = 0; i < 4; i ++) { if ((rotations >> i) & 1) { if (!first) printf (" "); printf("%s", direction[i]); @@ -3815,7 +3733,7 @@ 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]); @@ -3825,7 +3743,7 @@ 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) @@ -3846,12 +3764,10 @@ } 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 "); @@ -3862,16 +3778,16 @@ } 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, @@ -3891,7 +3807,7 @@ { 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, @@ -3908,7 +3824,7 @@ 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])); @@ -3924,7 +3840,7 @@ 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) @@ -3941,12 +3857,11 @@ } 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; @@ -3959,7 +3874,7 @@ } 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]); @@ -3982,7 +3897,7 @@ free (mode_shown); } } - for (m = 0; m < res->nmode; m++) + for (int m = 0; m < res->nmode; m++) { XRRModeInfo *mode = &res->modes[m]; @@ -3992,8 +3907,6 @@ exit (0); } if (list_providers) { - int k; - if (!has_1_4) { printf ("RandR 1.4 not supported\n"); exit (0); @@ -4003,16 +3916,14 @@ 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)); @@ -4033,11 +3944,9 @@ 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 ? "+" : "", @@ -4049,7 +3958,7 @@ 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); @@ -4109,7 +4018,9 @@ } 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; @@ -4128,8 +4039,8 @@ 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 ? '*' : ' ', @@ -4137,7 +4048,7 @@ 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]); @@ -4159,7 +4070,7 @@ 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"); ++++++ xrandr-print-outputs-per-provider.patch ++++++ --- /var/tmp/diff_new_pack.ARAbYM/_old 2022-12-07 17:33:23.788023815 +0100 +++ /var/tmp/diff_new_pack.ARAbYM/_new 2022-12-07 17:33:23.792023837 +0100 @@ -1,8 +1,8 @@ -Index: xrandr-1.5.0/xrandr.c +Index: xrandr-1.5.2/xrandr.c =================================================================== ---- xrandr-1.5.0.orig/xrandr.c -+++ xrandr-1.5.0/xrandr.c -@@ -2635,6 +2635,53 @@ get_monitors(Bool get_active) +--- xrandr-1.5.2.orig/xrandr.c ++++ xrandr-1.5.2/xrandr.c +@@ -2584,6 +2584,53 @@ get_monitors(Bool get_active) monitors->monitors = m; } @@ -56,13 +56,11 @@ int main (int argc, char **argv) { -@@ -3924,35 +3971,8 @@ main (int argc, char **argv) +@@ -3906,31 +3953,8 @@ 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); @@ -72,16 +70,14 @@ - 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)); - @@ -90,7 +86,7 @@ - } - } + if (list_providers) -+ print_providers (current); ++ print_providers (current); if (list_monitors || list_active_monitors) { if (!has_1_5) {
