mirror of OpenBSD xenocara tree github.com/openbsd/xenocara
openbsd
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update to libXres 1.2.2

matthieu fd56d538 7b3412d5

+547 -323
+111 -5
lib/libXRes/ChangeLog
··· 1 + commit f77165c819b05af27d9878efe8526a157f569b1a 2 + Author: Alan Coopersmith <alan.coopersmith@oracle.com> 3 + Date: Sun Dec 4 15:17:26 2022 -0800 4 + 5 + libXres 1.2.2 6 + 7 + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> 8 + 9 + commit bed46b55c06a3488971fda8271cf9fc0e3dd84d5 10 + Author: Alan Coopersmith <alan.coopersmith@oracle.com> 11 + Date: Sun Nov 20 11:07:30 2022 -0800 12 + 13 + Use calloc instead of malloc to allocate arrays 14 + 15 + Makes code more consistent with other functions in this library 16 + which already do this and adds extra protection against overflows 17 + or failures to properly fill in values. 18 + 19 + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> 20 + 21 + commit c71236d5ae587f6a673a8bf1b6fd5de64a3ba78c 22 + Author: Alan Coopersmith <alan.coopersmith@oracle.com> 23 + Date: Sun Nov 20 11:03:55 2022 -0800 24 + 25 + Handle implicit conversion warnings from clang 26 + 27 + Clears 6 -Wimplicit-int-conversion, 6 -Wshorten-64-to-32, and 28 + 7 -Wsign-conversion warnings. 29 + 30 + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> 31 + 32 + commit 9e0db673a7869861eeb6eccbc8270a019f4aacd1 33 + Author: Alan Coopersmith <alan.coopersmith@oracle.com> 34 + Date: Sun Nov 20 10:31:39 2022 -0800 35 + 36 + Resolve -Wsign-compare warnings from gcc 37 + 38 + XRes.c: In function ‘XResQueryClients’: 39 + XRes.c:121:31: warning: comparison between signed and unsigned integer 40 + expressions [-Wsign-compare] 41 + for (int i = 0; i < rep.num_clients; i++) { 42 + ^ 43 + XRes.c: In function ‘XResQueryClientResources’: 44 + XRes.c:176:31: warning: comparison between signed and unsigned integer 45 + expressions [-Wsign-compare] 46 + for (int i = 0; i < rep.num_types; i++) { 47 + ^ 48 + 49 + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> 50 + 51 + commit a43105c0da6613798437afaa531c2a576f8efc99 52 + Author: Alan Coopersmith <alan.coopersmith@oracle.com> 53 + Date: Sun Nov 20 10:30:10 2022 -0800 54 + 55 + Variable scope reductions 56 + 57 + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> 58 + 59 + commit b1fb8150d6adac3b564575dec470a740457f66dc 60 + Author: Alan Coopersmith <alan.coopersmith@oracle.com> 61 + Date: Sun Nov 20 10:20:59 2022 -0800 62 + 63 + Add .git-blame-ignore-revs to hide whitespace commits from git blame 64 + 65 + To use this in your local repo clone, you will need to either run 66 + `git blame --ignore-revs-file .git-blame-ignore-revs` 67 + or set it permanently with 68 + `git config blame.ignoreRevsFile .git-blame-ignore-revs` 69 + 70 + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> 71 + 72 + commit fa5642244aa4b0882b8604d1e693d31882a7adda 73 + Author: Alan Coopersmith <alan.coopersmith@oracle.com> 74 + Date: Sun Nov 20 09:25:13 2022 -0800 75 + 76 + Reformat code to X.Org standard style 77 + 78 + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> 79 + 80 + commit 7bb6561cb44ce8f38615d2436dae89e7ca9a773b 81 + Author: Alan Coopersmith <alan.coopersmith@oracle.com> 82 + Date: Sun Jul 17 17:44:40 2022 -0700 83 + 84 + gitlab CI: add a basic build test 85 + 86 + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> 87 + 88 + commit 090026087de8961a7c49145f347e65afa1bbcb9b 89 + Author: Alan Coopersmith <alan.coopersmith@oracle.com> 90 + Date: Sun Jul 17 17:43:50 2022 -0700 91 + 92 + Fix spelling/wording issues 93 + 94 + Found by using: 95 + codespell --builtin clear,rare,usage,informal,code,names 96 + 97 + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> 98 + 99 + commit d5031be051ea7c969e7fdf5885235ae56825b697 100 + Author: Alan Coopersmith <alan.coopersmith@oracle.com> 101 + Date: Sun Jul 17 17:43:25 2022 -0700 102 + 103 + Build xz tarballs instead of bzip2 104 + 105 + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> 106 + 1 107 commit c05c6d918b0e2011d4bfa370c321482e34630b17 2 108 Author: Keith Packard <keithp@keithp.com> 3 109 Date: Tue Mar 30 21:36:16 2021 -0700 ··· 214 320 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> 215 321 216 322 commit 01fc6f81f0a2935741dd1114aa3fa267d8be9095 217 - Author: Erkki Seppälä <erkki.seppala@vincit.fi> 323 + Author: Erkki Seppälä < <erkki.seppala@vincit.fi> 218 324 Date: Wed Dec 15 13:48:09 2010 +0200 219 325 220 326 Implemented second part of XResource extension v1.2: XResQueryResourceBytes ··· 225 331 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> 226 332 227 333 commit 0f38938a27df1f865dcdda35f4d2ef191092ba42 228 - Author: Erkki Seppälä <erkki.seppala@vincit.fi> 334 + Author: Erkki Seppälä < <erkki.seppala@vincit.fi> 229 335 Date: Mon Nov 29 12:43:51 2010 +0200 230 336 231 337 Implemented first part of XResource extension v1.2: XResQueryClientIds ··· 731 837 Add .cvsignore files Switch _la_CFLAGS for AM_CFLAGS to clean up directory 732 838 733 839 commit c1ed34d39740625d52eca7f2c5bf5c6797f28097 734 - Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> 840 + Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> 735 841 Date: Wed Jun 22 22:46:38 2005 +0000 736 842 737 843 Apply these patches from Theo van Klaveren: ··· 740 846 to make the libraries distcheck. 741 847 742 848 commit 2dbb8e41c6accaf9d86f3fdadfed5aea330da1fd 743 - Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> 849 + Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> 744 850 Date: Tue Jun 14 17:31:59 2005 +0000 745 851 746 852 XRes/src/Makefile.am: Add $(top_srcdir)/include to INCLUDES 747 853 748 854 commit a30727351e6cdeb7ff2ffa0bddad8c3a1be9eda0 749 - Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> 855 + Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> 750 856 Date: Tue Jun 7 18:51:23 2005 +0000 751 857 752 858 - symlink.sh: Move XRes.h from proto/Resource to
+3 -3
lib/libXRes/Makefile.in
··· 186 186 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ 187 187 done; \ 188 188 reldir="$$dir2" 189 - DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 189 + DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.xz 190 190 GZIP_ENV = --best 191 - DIST_TARGETS = dist-bzip2 dist-gzip 191 + DIST_TARGETS = dist-xz dist-gzip 192 192 distuninstallcheck_listfiles = find . -type f -print 193 193 am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ 194 194 | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' ··· 634 634 dist-gzip: distdir 635 635 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 636 636 $(am__post_remove_distdir) 637 + 637 638 dist-bzip2: distdir 638 639 tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 639 640 $(am__post_remove_distdir) ··· 641 642 dist-lzip: distdir 642 643 tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz 643 644 $(am__post_remove_distdir) 644 - 645 645 dist-xz: distdir 646 646 tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz 647 647 $(am__post_remove_distdir)
+1 -1
lib/libXRes/README.md
··· 5 5 6 6 https://lists.x.org/mailman/listinfo/xorg 7 7 8 - The master development code repository can be found at: 8 + The primary development code repository can be found at: 9 9 10 10 https://gitlab.freedesktop.org/xorg/lib/libXRes 11 11
+44 -24
lib/libXRes/aclocal.m4
··· 9905 9905 9906 9906 dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. 9907 9907 dnl 9908 - dnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. 9908 + dnl Copyright (c) 2005, 2023, Oracle and/or its affiliates. 9909 9909 dnl 9910 9910 dnl Permission is hereby granted, free of charge, to any person obtaining a 9911 9911 dnl copy of this software and associated documentation files (the "Software"), ··· 9942 9942 # See the "minimum version" comment for each macro you use to see what 9943 9943 # version you require. 9944 9944 m4_defun([XORG_MACROS_VERSION],[ 9945 - m4_define([vers_have], [1.19.2]) 9945 + m4_define([vers_have], [1.20.0]) 9946 9946 m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 9947 9947 m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) 9948 9948 m4_if(m4_cmp(maj_have, maj_needed), 0,, ··· 9963 9963 # such as man pages and config files 9964 9964 AC_DEFUN([XORG_PROG_RAWCPP],[ 9965 9965 AC_REQUIRE([AC_PROG_CPP]) 9966 - AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 9966 + AC_PATH_TOOL(RAWCPP, [cpp], [${CPP}], 9967 9967 [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 9968 9968 9969 9969 # Check for flag to avoid builtin definitions - assumes unix is predefined, ··· 10273 10273 # Documentation tools are not always available on all platforms and sometimes 10274 10274 # not at the appropriate level. This macro enables a module to test for the 10275 10275 # presence of the tool and obtain it's path in separate variables. Coupled with 10276 - # the --with-xmlto option, it allows maximum flexibilty in making decisions 10276 + # the --with-xmlto option, it allows maximum flexibility in making decisions 10277 10277 # as whether or not to use the xmlto package. When DEFAULT is not specified, 10278 10278 # --with-xmlto assumes 'auto'. 10279 10279 # ··· 10487 10487 # Documentation tools are not always available on all platforms and sometimes 10488 10488 # not at the appropriate level. This macro enables a module to test for the 10489 10489 # presence of the tool and obtain it's path in separate variables. Coupled with 10490 - # the --with-asciidoc option, it allows maximum flexibilty in making decisions 10490 + # the --with-asciidoc option, it allows maximum flexibility in making decisions 10491 10491 # as whether or not to use the asciidoc package. When DEFAULT is not specified, 10492 10492 # --with-asciidoc assumes 'auto'. 10493 10493 # ··· 10557 10557 # Documentation tools are not always available on all platforms and sometimes 10558 10558 # not at the appropriate level. This macro enables a module to test for the 10559 10559 # presence of the tool and obtain it's path in separate variables. Coupled with 10560 - # the --with-doxygen option, it allows maximum flexibilty in making decisions 10560 + # the --with-doxygen option, it allows maximum flexibility in making decisions 10561 10561 # as whether or not to use the doxygen package. When DEFAULT is not specified, 10562 10562 # --with-doxygen assumes 'auto'. 10563 10563 # ··· 10641 10641 # Documentation tools are not always available on all platforms and sometimes 10642 10642 # not at the appropriate level. This macro enables a module to test for the 10643 10643 # presence of the tool and obtain it's path in separate variables. Coupled with 10644 - # the --with-groff option, it allows maximum flexibilty in making decisions 10644 + # the --with-groff option, it allows maximum flexibility in making decisions 10645 10645 # as whether or not to use the groff package. When DEFAULT is not specified, 10646 10646 # --with-groff assumes 'auto'. 10647 10647 # ··· 10749 10749 # Documentation tools are not always available on all platforms and sometimes 10750 10750 # not at the appropriate level. This macro enables a module to test for the 10751 10751 # presence of the tool and obtain it's path in separate variables. Coupled with 10752 - # the --with-fop option, it allows maximum flexibilty in making decisions 10752 + # the --with-fop option, it allows maximum flexibility in making decisions 10753 10753 # as whether or not to use the fop package. When DEFAULT is not specified, 10754 10754 # --with-fop assumes 'auto'. 10755 10755 # ··· 10843 10843 # Documentation tools are not always available on all platforms and sometimes 10844 10844 # not at the appropriate level. This macro enables a module to test for the 10845 10845 # presence of the tool and obtain it's path in separate variables. Coupled with 10846 - # the --with-ps2pdf option, it allows maximum flexibilty in making decisions 10846 + # the --with-ps2pdf option, it allows maximum flexibility in making decisions 10847 10847 # as whether or not to use the ps2pdf package. When DEFAULT is not specified, 10848 10848 # --with-ps2pdf assumes 'auto'. 10849 10849 # ··· 10898 10898 # not at the appropriate level. This macro enables a builder to skip all 10899 10899 # documentation targets except traditional man pages. 10900 10900 # Combined with the specific tool checking macros XORG_WITH_*, it provides 10901 - # maximum flexibilty in controlling documentation building. 10901 + # maximum flexibility in controlling documentation building. 10902 10902 # Refer to: 10903 10903 # XORG_WITH_XMLTO --with-xmlto 10904 10904 # XORG_WITH_ASCIIDOC --with-asciidoc ··· 10931 10931 # 10932 10932 # This macro enables a builder to skip all developer documentation. 10933 10933 # Combined with the specific tool checking macros XORG_WITH_*, it provides 10934 - # maximum flexibilty in controlling documentation building. 10934 + # maximum flexibility in controlling documentation building. 10935 10935 # Refer to: 10936 10936 # XORG_WITH_XMLTO --with-xmlto 10937 10937 # XORG_WITH_ASCIIDOC --with-asciidoc ··· 10964 10964 # 10965 10965 # This macro enables a builder to skip all functional specification targets. 10966 10966 # Combined with the specific tool checking macros XORG_WITH_*, it provides 10967 - # maximum flexibilty in controlling documentation building. 10967 + # maximum flexibility in controlling documentation building. 10968 10968 # Refer to: 10969 10969 # XORG_WITH_XMLTO --with-xmlto 10970 10970 # XORG_WITH_ASCIIDOC --with-asciidoc ··· 11439 11439 AC_DEFUN([XORG_COMPILER_BRAND], [ 11440 11440 AC_LANG_CASE( 11441 11441 [C], [ 11442 - AC_REQUIRE([AC_PROG_CC_C99]) 11442 + dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC 11443 + dnl and complains that AC_PROG_CC_C99 is obsolete 11444 + m4_version_prereq([2.70], 11445 + [AC_REQUIRE([AC_PROG_CC])], 11446 + [AC_REQUIRE([AC_PROG_CC_C99])]) 11443 11447 ], 11444 11448 [C++], [ 11445 11449 AC_REQUIRE([AC_PROG_CXX]) ··· 11455 11459 # Minimum version: 1.16.0 11456 11460 # 11457 11461 # Test if the compiler works when passed the given flag as a command line argument. 11458 - # If it succeeds, the flag is appeneded to the given variable. If not, it tries the 11462 + # If it succeeds, the flag is appended to the given variable. If not, it tries the 11459 11463 # next flag in the list until there are no more options. 11460 11464 # 11461 11465 # Note that this does not guarantee that the compiler supports the flag as some ··· 11471 11475 11472 11476 AC_LANG_CASE( 11473 11477 [C], [ 11474 - AC_REQUIRE([AC_PROG_CC_C99]) 11478 + dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC 11479 + dnl and complains that AC_PROG_CC_C99 is obsolete 11480 + m4_version_prereq([2.70], 11481 + [AC_REQUIRE([AC_PROG_CC])], 11482 + [AC_REQUIRE([AC_PROG_CC_C99])]) 11475 11483 define([PREFIX], [C]) 11476 11484 define([CACHE_PREFIX], [cc]) 11477 11485 define([COMPILER], [$CC]) ··· 11602 11610 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow]) 11603 11611 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn]) 11604 11612 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute]) 11605 - # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) 11613 + XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) 11606 11614 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) 11607 11615 11608 11616 # These are currently disabled because they are noisy. They will be enabled ··· 11612 11620 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) 11613 11621 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) 11614 11622 11615 - # Turn some warnings into errors, so we don't accidently get successful builds 11623 + # Turn some warnings into errors, so we don't accidentally get successful builds 11616 11624 # when there are problems that should be fixed. 11617 11625 11618 11626 if test "x$SELECTIVE_WERROR" = "xyes" ; then ··· 11721 11729 AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS])) 11722 11730 ]) # XORG_STRICT_OPTION 11723 11731 11732 + # XORG_DEFAULT_NOCODE_OPTIONS 11733 + # --------------------------- 11734 + # Minimum version: 1.20.0 11735 + # 11736 + # Defines default options for X.Org modules which don't compile code, 11737 + # such as fonts, bitmaps, cursors, and docs. 11738 + # 11739 + AC_DEFUN([XORG_DEFAULT_NOCODE_OPTIONS], [ 11740 + AC_REQUIRE([AC_PROG_INSTALL]) 11741 + XORG_RELEASE_VERSION 11742 + XORG_CHANGELOG 11743 + XORG_INSTALL 11744 + XORG_MANPAGE_SECTIONS 11745 + m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], 11746 + [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) 11747 + ]) # XORG_DEFAULT_NOCODE_OPTIONS 11748 + 11724 11749 # XORG_DEFAULT_OPTIONS 11725 11750 # -------------------- 11726 11751 # Minimum version: 1.3.0 11727 11752 # 11728 - # Defines default options for X.Org modules. 11753 + # Defines default options for X.Org modules which compile code. 11729 11754 # 11730 11755 AC_DEFUN([XORG_DEFAULT_OPTIONS], [ 11731 11756 AC_REQUIRE([AC_PROG_INSTALL]) 11732 11757 XORG_COMPILER_FLAGS 11733 11758 XORG_CWARNFLAGS 11734 11759 XORG_STRICT_OPTION 11735 - XORG_RELEASE_VERSION 11736 - XORG_CHANGELOG 11737 - XORG_INSTALL 11738 - XORG_MANPAGE_SECTIONS 11739 - m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], 11740 - [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) 11760 + XORG_DEFAULT_NOCODE_OPTIONS 11741 11761 ]) # XORG_DEFAULT_OPTIONS 11742 11762 11743 11763 # XORG_INSTALL()
+1 -1
lib/libXRes/compile
··· 3 3 4 4 scriptversion=2018-03-07.03; # UTC 5 5 6 - # Copyright (C) 1999-2020 Free Software Foundation, Inc. 6 + # Copyright (C) 1999-2021 Free Software Foundation, Inc. 7 7 # Written by Tom Tromey <tromey@cygnus.com>. 8 8 # 9 9 # This program is free software; you can redistribute it and/or modify
+138 -18
lib/libXRes/configure
··· 1 1 #! /bin/sh 2 2 # Guess values for system-dependent variables and create Makefiles. 3 - # Generated by GNU Autoconf 2.69 for libXres 1.2.1. 3 + # Generated by GNU Autoconf 2.69 for libXres 1.2.2. 4 4 # 5 - # Report bugs to <https://gitlab.freedesktop.org/xorg/lib/libXRes/issues>. 5 + # Report bugs to <https://gitlab.freedesktop.org/xorg/lib/libxres/-/issues>. 6 6 # 7 7 # 8 8 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. ··· 275 275 $as_echo "$0: be upgraded to zsh 4.3.4 or later." 276 276 else 277 277 $as_echo "$0: Please tell bug-autoconf@gnu.org and 278 - $0: https://gitlab.freedesktop.org/xorg/lib/libXRes/issues 278 + $0: https://gitlab.freedesktop.org/xorg/lib/libxres/-/issues 279 279 $0: about your system, including any error possibly output 280 280 $0: before this message. Then install a modern shell, or 281 281 $0: manually run the script under such a shell if you do ··· 591 591 # Identity of this package. 592 592 PACKAGE_NAME='libXres' 593 593 PACKAGE_TARNAME='libXres' 594 - PACKAGE_VERSION='1.2.1' 595 - PACKAGE_STRING='libXres 1.2.1' 596 - PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/lib/libXRes/issues' 594 + PACKAGE_VERSION='1.2.2' 595 + PACKAGE_STRING='libXres 1.2.2' 596 + PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/lib/libxres/-/issues' 597 597 PACKAGE_URL='' 598 598 599 599 ac_unique_file="Makefile.am" ··· 1361 1361 # Omit some internal or obsolete options to make the list less imposing. 1362 1362 # This message is too long to be a string in the A/UX 3.1 sh. 1363 1363 cat <<_ACEOF 1364 - \`configure' configures libXres 1.2.1 to adapt to many kinds of systems. 1364 + \`configure' configures libXres 1.2.2 to adapt to many kinds of systems. 1365 1365 1366 1366 Usage: $0 [OPTION]... [VAR=VALUE]... 1367 1367 ··· 1432 1432 1433 1433 if test -n "$ac_init_help"; then 1434 1434 case $ac_init_help in 1435 - short | recursive ) echo "Configuration of libXres 1.2.1:";; 1435 + short | recursive ) echo "Configuration of libXres 1.2.2:";; 1436 1436 esac 1437 1437 cat <<\_ACEOF 1438 1438 ··· 1492 1492 Use these variables to override the choices made by `configure' or to help 1493 1493 it to find libraries and programs with nonstandard names/locations. 1494 1494 1495 - Report bugs to <https://gitlab.freedesktop.org/xorg/lib/libXRes/issues>. 1495 + Report bugs to <https://gitlab.freedesktop.org/xorg/lib/libxres/-/issues>. 1496 1496 _ACEOF 1497 1497 ac_status=$? 1498 1498 fi ··· 1555 1555 test -n "$ac_init_help" && exit $ac_status 1556 1556 if $ac_init_version; then 1557 1557 cat <<\_ACEOF 1558 - libXres configure 1.2.1 1558 + libXres configure 1.2.2 1559 1559 generated by GNU Autoconf 2.69 1560 1560 1561 1561 Copyright (C) 2012 Free Software Foundation, Inc. ··· 1879 1879 This file contains any messages produced by compilers while 1880 1880 running configure, to aid debugging if configure makes a mistake. 1881 1881 1882 - It was created by libXres $as_me 1.2.1, which was 1882 + It was created by libXres $as_me 1.2.2, which was 1883 1883 generated by GNU Autoconf 2.69. Invocation command line was 1884 1884 1885 1885 $ $0 $@ ··· 2708 2708 2709 2709 # Define the identity of the package. 2710 2710 PACKAGE='libXres' 2711 - VERSION='1.2.1' 2711 + VERSION='1.2.2' 2712 2712 2713 2713 2714 2714 cat >>confdefs.h <<_ACEOF ··· 13571 13571 fi 13572 13572 13573 13573 13574 - # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) 13574 + 13575 + 13576 + 13577 + 13578 + 13579 + 13580 + 13581 + 13582 + 13583 + 13584 + 13585 + 13586 + 13587 + xorg_testset_save_CFLAGS="$CFLAGS" 13588 + 13589 + if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then 13590 + CFLAGS="$CFLAGS -Werror=unknown-warning-option" 13591 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 13592 + $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } 13593 + if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : 13594 + $as_echo_n "(cached) " >&6 13595 + else 13596 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext 13597 + /* end confdefs.h. */ 13598 + int i; 13599 + _ACEOF 13600 + if ac_fn_c_try_compile "$LINENO"; then : 13601 + xorg_cv_cc_flag_unknown_warning_option=yes 13602 + else 13603 + xorg_cv_cc_flag_unknown_warning_option=no 13604 + fi 13605 + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 13606 + fi 13607 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 13608 + $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } 13609 + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option 13610 + CFLAGS="$xorg_testset_save_CFLAGS" 13611 + fi 13612 + 13613 + if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then 13614 + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then 13615 + CFLAGS="$CFLAGS -Werror=unknown-warning-option" 13616 + fi 13617 + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" 13618 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 13619 + $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } 13620 + if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : 13621 + $as_echo_n "(cached) " >&6 13622 + else 13623 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext 13624 + /* end confdefs.h. */ 13625 + int i; 13626 + _ACEOF 13627 + if ac_fn_c_try_compile "$LINENO"; then : 13628 + xorg_cv_cc_flag_unused_command_line_argument=yes 13629 + else 13630 + xorg_cv_cc_flag_unused_command_line_argument=no 13631 + fi 13632 + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 13633 + fi 13634 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 13635 + $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } 13636 + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument 13637 + CFLAGS="$xorg_testset_save_CFLAGS" 13638 + fi 13639 + 13640 + found="no" 13641 + 13642 + if test $found = "no" ; then 13643 + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then 13644 + CFLAGS="$CFLAGS -Werror=unknown-warning-option" 13645 + fi 13646 + 13647 + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then 13648 + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" 13649 + fi 13650 + 13651 + CFLAGS="$CFLAGS -Wredundant-decls" 13652 + 13653 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wredundant-decls" >&5 13654 + $as_echo_n "checking if $CC supports -Wredundant-decls... " >&6; } 13655 + cacheid=xorg_cv_cc_flag__Wredundant_decls 13656 + if eval \${$cacheid+:} false; then : 13657 + $as_echo_n "(cached) " >&6 13658 + else 13659 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext 13660 + /* end confdefs.h. */ 13661 + int i; 13662 + int 13663 + main () 13664 + { 13665 + 13666 + ; 13667 + return 0; 13668 + } 13669 + _ACEOF 13670 + if ac_fn_c_try_link "$LINENO"; then : 13671 + eval $cacheid=yes 13672 + else 13673 + eval $cacheid=no 13674 + fi 13675 + rm -f core conftest.err conftest.$ac_objext \ 13676 + conftest$ac_exeext conftest.$ac_ext 13677 + fi 13678 + 13679 + 13680 + CFLAGS="$xorg_testset_save_CFLAGS" 13681 + 13682 + eval supported=\$$cacheid 13683 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 13684 + $as_echo "$supported" >&6; } 13685 + if test "$supported" = "yes" ; then 13686 + BASE_CFLAGS="$BASE_CFLAGS -Wredundant-decls" 13687 + found="yes" 13688 + fi 13689 + fi 13690 + 13691 + 13575 13692 13576 13693 13577 13694 ··· 13698 13815 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) 13699 13816 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) 13700 13817 13701 - # Turn some warnings into errors, so we don't accidently get successful builds 13818 + # Turn some warnings into errors, so we don't accidentally get successful builds 13702 13819 # when there are problems that should be fixed. 13703 13820 13704 13821 if test "x$SELECTIVE_WERROR" = "xyes" ; then ··· 17370 17487 17371 17488 17372 17489 17490 + 17491 + 17373 17492 cat >>confdefs.h <<_ACEOF 17374 17493 #define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1` 17375 17494 _ACEOF ··· 17572 17691 17573 17692 17574 17693 17694 + 17575 17695 # Check whether --enable-malloc0returnsnull was given. 17576 17696 if test "${enable_malloc0returnsnull+set}" = set; then : 17577 17697 enableval=$enable_malloc0returnsnull; MALLOC_ZERO_RETURNS_NULL=$enableval ··· 17643 17763 17644 17764 17645 17765 17646 - # Obtain compiler/linker options for depedencies 17766 + # Obtain compiler/linker options for dependencies 17647 17767 17648 17768 pkg_failed=no 17649 17769 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for x11 >= 1.6 xext xextproto resourceproto >= 1.2.0" >&5 ··· 18272 18392 # report actual input values of CONFIG_FILES etc. instead of their 18273 18393 # values after options handling. 18274 18394 ac_log=" 18275 - This file was extended by libXres $as_me 1.2.1, which was 18395 + This file was extended by libXres $as_me 1.2.2, which was 18276 18396 generated by GNU Autoconf 2.69. Invocation command line was 18277 18397 18278 18398 CONFIG_FILES = $CONFIG_FILES ··· 18332 18452 Configuration commands: 18333 18453 $config_commands 18334 18454 18335 - Report bugs to <https://gitlab.freedesktop.org/xorg/lib/libXRes/issues>." 18455 + Report bugs to <https://gitlab.freedesktop.org/xorg/lib/libxres/-/issues>." 18336 18456 18337 18457 _ACEOF 18338 18458 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 18339 18459 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" 18340 18460 ac_cs_version="\\ 18341 - libXres config.status 1.2.1 18461 + libXres config.status 1.2.2 18342 18462 configured by $0, generated by GNU Autoconf 2.69, 18343 18463 with options \\"\$ac_cs_config\\" 18344 18464
+4 -4
lib/libXRes/configure.ac
··· 29 29 # digit in the version number to track changes which don't affect the 30 30 # protocol, so XRes version l.n.m corresponds to protocol version l.n 31 31 # 32 - AC_INIT([libXres], [1.2.1], 33 - [https://gitlab.freedesktop.org/xorg/lib/libXRes/issues], [libXres]) 32 + AC_INIT([libXres], [1.2.2], 33 + [https://gitlab.freedesktop.org/xorg/lib/libxres/-/issues], [libXres]) 34 34 AC_CONFIG_SRCDIR([Makefile.am]) 35 35 AC_CONFIG_HEADERS([config.h]) 36 36 37 37 # Initialize Automake 38 - AM_INIT_AUTOMAKE([foreign dist-bzip2]) 38 + AM_INIT_AUTOMAKE([foreign dist-xz]) 39 39 40 40 # Initialize libtool 41 41 AC_PROG_LIBTOOL ··· 47 47 XORG_DEFAULT_OPTIONS 48 48 XORG_CHECK_MALLOC_ZERO 49 49 50 - # Obtain compiler/linker options for depedencies 50 + # Obtain compiler/linker options for dependencies 51 51 PKG_CHECK_MODULES(XRES, [x11 >= 1.6] xext xextproto [resourceproto >= 1.2.0]) 52 52 53 53 AC_CONFIG_FILES([Makefile
+66 -66
lib/libXRes/include/X11/extensions/XRes.h
··· 10 10 /* v1.0 */ 11 11 12 12 typedef struct { 13 - XID resource_base; 14 - XID resource_mask; 13 + XID resource_base; 14 + XID resource_mask; 15 15 } XResClient; 16 16 17 17 typedef struct { 18 - Atom resource_type; 19 - unsigned int count; 18 + Atom resource_type; 19 + unsigned int count; 20 20 } XResType; 21 21 22 22 /* v1.2 */ 23 23 24 24 typedef enum { 25 - XRES_CLIENT_ID_XID, 26 - XRES_CLIENT_ID_PID, 27 - XRES_CLIENT_ID_NR 25 + XRES_CLIENT_ID_XID, 26 + XRES_CLIENT_ID_PID, 27 + XRES_CLIENT_ID_NR 28 28 } XResClientIdType; 29 29 30 30 typedef enum { 31 - XRES_CLIENT_ID_XID_MASK = 1 << XRES_CLIENT_ID_XID, 32 - XRES_CLIENT_ID_PID_MASK = 1 << XRES_CLIENT_ID_PID 31 + XRES_CLIENT_ID_XID_MASK = 1 << XRES_CLIENT_ID_XID, 32 + XRES_CLIENT_ID_PID_MASK = 1 << XRES_CLIENT_ID_PID 33 33 } XResClientIdMask; 34 34 35 35 typedef struct { 36 - XID client; 37 - unsigned int mask; 36 + XID client; 37 + unsigned int mask; 38 38 } XResClientIdSpec; 39 39 40 40 typedef struct { 41 - XResClientIdSpec spec; 42 - long length; 43 - void *value; 41 + XResClientIdSpec spec; 42 + long length; 43 + void *value; 44 44 } XResClientIdValue; 45 45 46 46 typedef struct { 47 - XID resource; 48 - Atom type; 47 + XID resource; 48 + Atom type; 49 49 } XResResourceIdSpec; 50 50 51 51 typedef struct { 52 - XResResourceIdSpec spec; 53 - long bytes; 54 - long ref_count; 55 - long use_count; 52 + XResResourceIdSpec spec; 53 + long bytes; 54 + long ref_count; 55 + long use_count; 56 56 } XResResourceSizeSpec; 57 57 58 58 typedef struct { 59 - XResResourceSizeSpec size; 60 - long num_cross_references; 61 - XResResourceSizeSpec *cross_references; 59 + XResResourceSizeSpec size; 60 + long num_cross_references; 61 + XResResourceSizeSpec *cross_references; 62 62 } XResResourceSizeValue; 63 63 64 64 _XFUNCPROTOBEGIN 65 65 66 66 /* v1.0 */ 67 67 68 - Bool XResQueryExtension ( 69 - Display *dpy, 70 - int *event_base_return, 71 - int *error_base_return 68 + Bool XResQueryExtension( 69 + Display *dpy, 70 + int *event_base_return, 71 + int *error_base_return 72 72 ); 73 73 74 - Status XResQueryVersion ( 75 - Display *dpy, 76 - int *major_version_return, 77 - int *minor_version_return 74 + Status XResQueryVersion( 75 + Display *dpy, 76 + int *major_version_return, 77 + int *minor_version_return 78 78 ); 79 79 80 - Status XResQueryClients ( 81 - Display *dpy, 82 - int *num_clients, 83 - XResClient **clients 80 + Status XResQueryClients( 81 + Display *dpy, 82 + int *num_clients, 83 + XResClient **clients 84 84 ); 85 85 86 - Status XResQueryClientResources ( 87 - Display *dpy, 88 - XID xid, 89 - int *num_types, 90 - XResType **types 86 + Status XResQueryClientResources( 87 + Display *dpy, 88 + XID xid, 89 + int *num_types, 90 + XResType **types 91 91 ); 92 92 93 - Status XResQueryClientPixmapBytes ( 94 - Display *dpy, 95 - XID xid, 96 - unsigned long *bytes 93 + Status XResQueryClientPixmapBytes( 94 + Display *dpy, 95 + XID xid, 96 + unsigned long *bytes 97 97 ); 98 98 99 99 /* v1.2 */ 100 100 101 101 /* Returns an array of uint32_t values, not an array of long */ 102 - Status XResQueryClientIds ( 103 - Display *dpy, 104 - long num_specs, 105 - XResClientIdSpec *client_specs, /* in */ 106 - long *num_ids, /* out */ 107 - XResClientIdValue **client_ids /* out */ 102 + Status XResQueryClientIds( 103 + Display *dpy, 104 + long num_specs, 105 + XResClientIdSpec *client_specs, /* in */ 106 + long *num_ids, /* out */ 107 + XResClientIdValue **client_ids /* out */ 108 108 ); 109 109 110 - XResClientIdType XResGetClientIdType(XResClientIdValue* value); 110 + XResClientIdType XResGetClientIdType(XResClientIdValue *value); 111 111 112 112 /* return -1 if no pid associated to the value */ 113 - pid_t XResGetClientPid(XResClientIdValue* value); 113 + pid_t XResGetClientPid(XResClientIdValue *value); 114 114 115 - void XResClientIdsDestroy ( 116 - long num_ids, 117 - XResClientIdValue *client_ids 115 + void XResClientIdsDestroy( 116 + long num_ids, 117 + XResClientIdValue *client_ids 118 118 ); 119 119 120 - Status XResQueryResourceBytes ( 121 - Display *dpy, 122 - XID client, 123 - long num_specs, 124 - XResResourceIdSpec *resource_specs, /* in */ 125 - long *num_sizes, /* out */ 126 - XResResourceSizeValue **sizes /* out */ 120 + Status XResQueryResourceBytes( 121 + Display *dpy, 122 + XID client, 123 + long num_specs, 124 + XResResourceIdSpec *resource_specs, /* in */ 125 + long *num_sizes, /* out */ 126 + XResResourceSizeValue **sizes /* out */ 127 127 ); 128 128 129 - void XResResourceSizeValuesDestroy ( 130 - long num_sizes, 131 - XResResourceSizeValue *sizes 129 + void XResResourceSizeValuesDestroy( 130 + long num_sizes, 131 + XResResourceSizeValue *sizes 132 132 ); 133 133 134 134 _XFUNCPROTOEND 135 135 136 - #endif /* _XRES_H */ 136 + #endif /* _XRES_H */
+179 -201
lib/libXRes/src/XRes.c
··· 22 22 #define XResCheckExtension(dpy,i,val) \ 23 23 XextCheckExtension (dpy, i, xres_extension_name, val) 24 24 25 - static XEXT_GENERATE_CLOSE_DISPLAY (close_display, xres_ext_info) 25 + static XEXT_GENERATE_CLOSE_DISPLAY(close_display, xres_ext_info) 26 26 27 27 static XExtensionHooks xres_extension_hooks = { 28 - NULL, /* create_gc */ 29 - NULL, /* copy_gc */ 30 - NULL, /* flush_gc */ 31 - NULL, /* free_gc */ 32 - NULL, /* create_font */ 33 - NULL, /* free_font */ 34 - close_display, /* close_display */ 35 - NULL, /* wire_to_event */ 36 - NULL, /* event_to_wire */ 37 - NULL, /* error */ 38 - NULL, /* error_string */ 28 + NULL, /* create_gc */ 29 + NULL, /* copy_gc */ 30 + NULL, /* flush_gc */ 31 + NULL, /* free_gc */ 32 + NULL, /* create_font */ 33 + NULL, /* free_font */ 34 + close_display, /* close_display */ 35 + NULL, /* wire_to_event */ 36 + NULL, /* event_to_wire */ 37 + NULL, /* error */ 38 + NULL, /* error_string */ 39 39 }; 40 40 41 - static XEXT_GENERATE_FIND_DISPLAY (find_display, xres_ext_info, 42 - xres_extension_name, 43 - &xres_extension_hooks, 44 - 0, NULL) 41 + static 42 + XEXT_GENERATE_FIND_DISPLAY(find_display, xres_ext_info, xres_extension_name, 43 + &xres_extension_hooks, 0, NULL) 45 44 46 - Bool XResQueryExtension ( 47 - Display *dpy, 48 - int *event_base_return, 49 - int *error_base_return 50 - ) 45 + Bool 46 + XResQueryExtension(Display *dpy, 47 + int *event_base_return, int *error_base_return) 51 48 { 52 - XExtDisplayInfo *info = find_display (dpy); 49 + XExtDisplayInfo *info = find_display(dpy); 53 50 54 51 if (XextHasExtension(info)) { 55 52 *event_base_return = info->codes->first_event; 56 53 *error_base_return = info->codes->first_error; 57 54 return True; 58 - } else { 55 + } 56 + else { 59 57 return False; 60 58 } 61 59 } 62 60 63 - Status XResQueryVersion( 64 - Display *dpy, 65 - int *major_version_return, 66 - int *minor_version_return 67 - ) 61 + Status 62 + XResQueryVersion(Display *dpy, 63 + int *major_version_return, int *minor_version_return) 68 64 { 69 - XExtDisplayInfo *info = find_display (dpy); 65 + XExtDisplayInfo *info = find_display(dpy); 70 66 xXResQueryVersionReply rep; 71 67 xXResQueryVersionReq *req; 72 68 73 - XResCheckExtension (dpy, info, 0); 69 + XResCheckExtension(dpy, info, 0); 74 70 75 - LockDisplay (dpy); 76 - GetReq (XResQueryVersion, req); 77 - req->reqType = info->codes->major_opcode; 71 + LockDisplay(dpy); 72 + GetReq(XResQueryVersion, req); 73 + req->reqType = (CARD8) info->codes->major_opcode; 78 74 req->XResReqType = X_XResQueryVersion; 79 75 req->client_major = XRES_MAJOR_VERSION; 80 76 req->client_minor = XRES_MINOR_VERSION; 81 - if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) { 82 - UnlockDisplay (dpy); 83 - SyncHandle (); 77 + if (!_XReply(dpy, (xReply *) &rep, 0, xTrue)) { 78 + UnlockDisplay(dpy); 79 + SyncHandle(); 84 80 return 0; 85 81 } 86 82 *major_version_return = rep.server_major; 87 83 *minor_version_return = rep.server_minor; 88 - UnlockDisplay (dpy); 89 - SyncHandle (); 84 + UnlockDisplay(dpy); 85 + SyncHandle(); 90 86 return 1; 91 87 } 92 88 93 - 94 - Status XResQueryClients ( 95 - Display *dpy, 96 - int *num_clients, 97 - XResClient **clients 98 - ) 89 + Status 90 + XResQueryClients(Display *dpy, int *num_clients, XResClient **clients) 99 91 { 100 - XExtDisplayInfo *info = find_display (dpy); 92 + XExtDisplayInfo *info = find_display(dpy); 101 93 xXResQueryClientsReq *req; 102 94 xXResQueryClientsReply rep; 103 - XResClient *clnts; 104 95 int result = 0; 105 96 106 97 *num_clients = 0; 107 98 *clients = NULL; 108 99 109 - XResCheckExtension (dpy, info, 0); 100 + XResCheckExtension(dpy, info, 0); 110 101 111 - LockDisplay (dpy); 112 - GetReq (XResQueryClients, req); 113 - req->reqType = info->codes->major_opcode; 102 + LockDisplay(dpy); 103 + GetReq(XResQueryClients, req); 104 + req->reqType = (CARD8) info->codes->major_opcode; 114 105 req->XResReqType = X_XResQueryClients; 115 - if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { 116 - UnlockDisplay (dpy); 117 - SyncHandle (); 106 + if (!_XReply(dpy, (xReply *) &rep, 0, xFalse)) { 107 + UnlockDisplay(dpy); 108 + SyncHandle(); 118 109 return 0; 119 110 } 120 111 121 - if(rep.num_clients) { 112 + if (rep.num_clients) { 113 + XResClient *clnts; 114 + 122 115 if (rep.num_clients < (INT_MAX / sizeof(XResClient))) 123 - clnts = Xmalloc(sizeof(XResClient) * rep.num_clients); 116 + clnts = Xcalloc(rep.num_clients, sizeof(XResClient)); 124 117 else 125 118 clnts = NULL; 126 119 127 120 if (clnts != NULL) { 128 - xXResClient scratch; 129 - int i; 121 + for (CARD32 i = 0; i < rep.num_clients; i++) { 122 + xXResClient scratch; 130 123 131 - for(i = 0; i < rep.num_clients; i++) { 132 - _XRead(dpy, (char*)&scratch, sz_xXResClient); 124 + _XRead(dpy, (char *) &scratch, sz_xXResClient); 133 125 clnts[i].resource_base = scratch.resource_base; 134 126 clnts[i].resource_mask = scratch.resource_mask; 135 127 } 136 128 *clients = clnts; 137 - *num_clients = rep.num_clients; 129 + *num_clients = (int) rep.num_clients; 138 130 result = 1; 139 - } else { 131 + } 132 + else { 140 133 _XEatDataWords(dpy, rep.length); 141 134 } 142 135 } 143 136 144 - UnlockDisplay (dpy); 145 - SyncHandle (); 137 + UnlockDisplay(dpy); 138 + SyncHandle(); 146 139 return result; 147 140 } 148 141 149 - Status XResQueryClientResources ( 150 - Display *dpy, 151 - XID xid, 152 - int *num_types, 153 - XResType **types 154 - ) 142 + Status 143 + XResQueryClientResources(Display *dpy, XID xid, 144 + int *num_types, XResType **types) 155 145 { 156 - XExtDisplayInfo *info = find_display (dpy); 146 + XExtDisplayInfo *info = find_display(dpy); 157 147 xXResQueryClientResourcesReq *req; 158 148 xXResQueryClientResourcesReply rep; 159 - XResType *typs; 160 149 int result = 0; 161 150 162 151 *num_types = 0; 163 152 *types = NULL; 164 153 165 - XResCheckExtension (dpy, info, 0); 154 + XResCheckExtension(dpy, info, 0); 166 155 167 - LockDisplay (dpy); 168 - GetReq (XResQueryClientResources, req); 169 - req->reqType = info->codes->major_opcode; 156 + LockDisplay(dpy); 157 + GetReq(XResQueryClientResources, req); 158 + req->reqType = (CARD8) info->codes->major_opcode; 170 159 req->XResReqType = X_XResQueryClientResources; 171 - req->xid = xid; 172 - if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { 173 - UnlockDisplay (dpy); 174 - SyncHandle (); 160 + req->xid = (CARD32) xid; 161 + if (!_XReply(dpy, (xReply *) &rep, 0, xFalse)) { 162 + UnlockDisplay(dpy); 163 + SyncHandle(); 175 164 return 0; 176 165 } 177 166 178 - if(rep.num_types) { 167 + if (rep.num_types) { 168 + XResType *typs; 169 + 179 170 if (rep.num_types < (INT_MAX / sizeof(XResType))) 180 - typs = Xmalloc(sizeof(XResType) * rep.num_types); 171 + typs = Xcalloc(rep.num_types, sizeof(XResType)); 181 172 else 182 173 typs = NULL; 183 174 184 175 if (typs != NULL) { 185 - xXResType scratch; 186 - int i; 176 + for (CARD32 i = 0; i < rep.num_types; i++) { 177 + xXResType scratch; 187 178 188 - for(i = 0; i < rep.num_types; i++) { 189 - _XRead(dpy, (char*)&scratch, sz_xXResType); 179 + _XRead(dpy, (char *) &scratch, sz_xXResType); 190 180 typs[i].resource_type = scratch.resource_type; 191 181 typs[i].count = scratch.count; 192 182 } 193 183 *types = typs; 194 - *num_types = rep.num_types; 184 + *num_types = (int) rep.num_types; 195 185 result = 1; 196 - } else { 186 + } 187 + else { 197 188 _XEatDataWords(dpy, rep.length); 198 189 } 199 190 } 200 191 201 - UnlockDisplay (dpy); 202 - SyncHandle (); 192 + UnlockDisplay(dpy); 193 + SyncHandle(); 203 194 return result; 204 195 } 205 196 206 - Status XResQueryClientPixmapBytes ( 207 - Display *dpy, 208 - XID xid, 209 - unsigned long *bytes 210 - ) 197 + Status 198 + XResQueryClientPixmapBytes(Display *dpy, XID xid, unsigned long *bytes) 211 199 { 212 - XExtDisplayInfo *info = find_display (dpy); 200 + XExtDisplayInfo *info = find_display(dpy); 213 201 xXResQueryClientPixmapBytesReq *req; 214 202 xXResQueryClientPixmapBytesReply rep; 215 203 216 204 *bytes = 0; 217 205 218 - XResCheckExtension (dpy, info, 0); 206 + XResCheckExtension(dpy, info, 0); 219 207 220 - LockDisplay (dpy); 221 - GetReq (XResQueryClientPixmapBytes, req); 222 - req->reqType = info->codes->major_opcode; 208 + LockDisplay(dpy); 209 + GetReq(XResQueryClientPixmapBytes, req); 210 + req->reqType = (CARD8) info->codes->major_opcode; 223 211 req->XResReqType = X_XResQueryClientPixmapBytes; 224 - req->xid = xid; 225 - if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) { 226 - UnlockDisplay (dpy); 227 - SyncHandle (); 212 + req->xid = (CARD32) xid; 213 + if (!_XReply(dpy, (xReply *) &rep, 0, xTrue)) { 214 + UnlockDisplay(dpy); 215 + SyncHandle(); 228 216 return 0; 229 217 } 230 218 ··· 234 222 *bytes = rep.bytes_overflow ? 0xffffffff : rep.bytes; 235 223 #endif 236 224 237 - UnlockDisplay (dpy); 238 - SyncHandle (); 225 + UnlockDisplay(dpy); 226 + SyncHandle(); 239 227 return 1; 240 228 } 241 229 242 - static Bool ReadClientValues( 243 - Display *dpy, 244 - long num_ids, 245 - XResClientIdValue *client_ids /* out */ 246 - ) 230 + static Bool 231 + ReadClientValues(Display *dpy, long num_ids, 232 + XResClientIdValue *client_ids /* out */) 247 233 { 248 - int c; 249 - for (c = 0; c < num_ids; ++c) { 250 - XResClientIdValue* client = client_ids + c; 234 + for (int c = 0; c < num_ids; ++c) { 235 + XResClientIdValue *client = client_ids + c; 251 236 long int value; 252 - _XRead32 (dpy, &value, 4); 253 - client->spec.client = value; 254 - _XRead32 (dpy, &value, 4); 255 - client->spec.mask = value; 256 - _XRead32 (dpy, &value, 4); 237 + 238 + _XRead32(dpy, &value, 4); 239 + client->spec.client = (XID) value; 240 + _XRead32(dpy, &value, 4); 241 + client->spec.mask = (unsigned int) value; 242 + _XRead32(dpy, &value, 4); 257 243 client->length = value; 258 - client->value = malloc(client->length); 259 - _XRead (dpy, client->value, client->length); 244 + client->value = malloc((unsigned long) client->length); 245 + _XRead(dpy, client->value, client->length); 260 246 } 261 247 return True; 262 248 } 263 249 264 250 /* Returns an array of uint32_t values, not an array of long */ 265 - Status XResQueryClientIds ( 266 - Display *dpy, 267 - long num_specs, 268 - XResClientIdSpec *client_specs, /* in */ 269 - long *num_ids, /* out */ 270 - XResClientIdValue **client_ids /* out */ 251 + Status 252 + XResQueryClientIds( 253 + Display *dpy, 254 + long num_specs, 255 + XResClientIdSpec *client_specs, /* in */ 256 + long *num_ids, /* out */ 257 + XResClientIdValue **client_ids /* out */ 271 258 ) 272 259 { 273 - XExtDisplayInfo *info = find_display (dpy); 260 + XExtDisplayInfo *info = find_display(dpy); 274 261 xXResQueryClientIdsReq *req; 275 262 xXResQueryClientIdsReply rep; 276 - int c; 277 263 278 264 *num_ids = 0; 279 265 280 - XResCheckExtension (dpy, info, 0); 281 - LockDisplay (dpy); 282 - GetReq (XResQueryClientIds, req); 283 - req->reqType = info->codes->major_opcode; 266 + XResCheckExtension(dpy, info, 0); 267 + LockDisplay(dpy); 268 + GetReq(XResQueryClientIds, req); 269 + req->reqType = (CARD8) info->codes->major_opcode; 284 270 req->XResReqType = X_XResQueryClientIds; 285 - req->length += num_specs * 2; /* 2 longs per client id spec */ 286 - req->numSpecs = num_specs; 271 + req->length += num_specs * 2; /* 2 longs per client id spec */ 272 + req->numSpecs = (CARD32) num_specs; 287 273 288 - for (c = 0; c < num_specs; ++c) { 274 + for (int c = 0; c < num_specs; ++c) { 289 275 Data32(dpy, &client_specs[c].client, 4); 290 276 Data32(dpy, &client_specs[c].mask, 4); 291 277 } 292 278 293 - if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { 279 + if (!_XReply(dpy, (xReply *) &rep, 0, xFalse)) { 294 280 goto error; 295 281 } 282 + 296 283 *client_ids = calloc(rep.numIds, sizeof(**client_ids)); 297 284 *num_ids = rep.numIds; 298 285 ··· 300 287 goto error; 301 288 } 302 289 303 - UnlockDisplay (dpy); 304 - SyncHandle (); 290 + UnlockDisplay(dpy); 291 + SyncHandle(); 305 292 return Success; 306 293 307 294 error: 308 - XResClientIdsDestroy (*num_ids, *client_ids); 295 + XResClientIdsDestroy(*num_ids, *client_ids); 309 296 *client_ids = NULL; 310 297 311 - UnlockDisplay (dpy); 312 - SyncHandle (); 298 + UnlockDisplay(dpy); 299 + SyncHandle(); 313 300 return !Success; 314 301 } 315 302 316 - void XResClientIdsDestroy ( 317 - long num_ids, 318 - XResClientIdValue *client_ids 319 - ) 303 + void 304 + XResClientIdsDestroy(long num_ids, XResClientIdValue *client_ids) 320 305 { 321 - int c; 322 - for (c = 0; c < num_ids; ++c) { 306 + for (int c = 0; c < num_ids; ++c) { 323 307 free(client_ids[c].value); 324 308 } 325 309 free(client_ids); 326 310 } 327 311 328 - XResClientIdType XResGetClientIdType( 329 - XResClientIdValue* value 330 - ) 312 + XResClientIdType 313 + XResGetClientIdType(XResClientIdValue *value) 331 314 { 332 - int bit; 333 315 XResClientIdType idType = 0; 334 316 Bool found = False; 335 - for (bit = 0; bit < XRES_CLIENT_ID_NR; ++bit) { 317 + 318 + for (unsigned int bit = 0; bit < XRES_CLIENT_ID_NR; ++bit) { 336 319 if (value->spec.mask & (1 << bit)) { 337 320 assert(!found); 338 321 found = True; ··· 345 328 return idType; 346 329 } 347 330 348 - pid_t XResGetClientPid( 349 - XResClientIdValue* value 350 - ) 331 + pid_t 332 + XResGetClientPid(XResClientIdValue *value) 351 333 { 352 334 if (value->spec.mask & XRES_CLIENT_ID_PID_MASK && value->length >= 4) { 353 - return (pid_t) * (CARD32*) value->value; 354 - } else { 355 - return (pid_t) -1; 335 + return (pid_t) * (CARD32 *) value->value; 336 + } 337 + else { 338 + return (pid_t) - 1; 356 339 } 357 340 } 358 341 359 - static Status ReadResourceSizeSpec( 360 - Display *dpy, 361 - XResResourceSizeSpec *size 362 - ) 342 + static Status 343 + ReadResourceSizeSpec(Display *dpy, XResResourceSizeSpec *size) 363 344 { 364 345 long int value; 346 + 365 347 _XRead32(dpy, &value, 4); 366 - size->spec.resource = value; 348 + size->spec.resource = (XID) value; 367 349 _XRead32(dpy, &value, 4); 368 - size->spec.type = value; 350 + size->spec.type = (Atom) value; 369 351 _XRead32(dpy, &value, 4); 370 352 size->bytes = value; 371 353 _XRead32(dpy, &value, 4); ··· 375 357 return 0; 376 358 } 377 359 378 - static Status ReadResourceSizeValues( 379 - Display *dpy, 380 - long num_sizes, 381 - XResResourceSizeValue *sizes) 360 + static Status 361 + ReadResourceSizeValues(Display *dpy, 362 + long num_sizes, XResResourceSizeValue *sizes) 382 363 { 383 - int c; 384 - int d; 385 - for (c = 0; c < num_sizes; ++c) { 364 + for (int c = 0; c < num_sizes; ++c) { 386 365 long int num; 366 + 387 367 ReadResourceSizeSpec(dpy, &sizes[c].size); 388 368 _XRead32(dpy, &num, 4); 389 369 sizes[c].num_cross_references = num; 390 - sizes[c].cross_references = num ? calloc(num, sizeof(*sizes[c].cross_references)) : NULL; 391 - for (d = 0; d < num; ++d) { 370 + sizes[c].cross_references = 371 + num ? calloc(num, sizeof(*sizes[c].cross_references)) : NULL; 372 + for (int d = 0; d < num; ++d) { 392 373 ReadResourceSizeSpec(dpy, &sizes[c].cross_references[d]); 393 374 } 394 375 } 395 376 return Success; 396 377 } 397 378 398 - Status XResQueryResourceBytes ( 399 - Display *dpy, 400 - XID client, 401 - long num_specs, 402 - XResResourceIdSpec *resource_specs, /* in */ 403 - long *num_sizes, /* out */ 404 - XResResourceSizeValue **sizes /* out */ 379 + Status 380 + XResQueryResourceBytes( 381 + Display *dpy, 382 + XID client, 383 + long num_specs, 384 + XResResourceIdSpec *resource_specs, /* in */ 385 + long *num_sizes, /* out */ 386 + XResResourceSizeValue **sizes /* out */ 405 387 ) 406 388 { 407 - XExtDisplayInfo *info = find_display (dpy); 389 + XExtDisplayInfo *info = find_display(dpy); 408 390 xXResQueryResourceBytesReq *req; 409 391 xXResQueryResourceBytesReply rep; 410 - int c; 411 392 412 393 *num_sizes = 0; 413 394 414 - XResCheckExtension (dpy, info, 0); 395 + XResCheckExtension(dpy, info, 0); 415 396 416 - LockDisplay (dpy); 417 - GetReq (XResQueryResourceBytes, req); 418 - req->reqType = info->codes->major_opcode; 397 + LockDisplay(dpy); 398 + GetReq(XResQueryResourceBytes, req); 399 + req->reqType = (CARD8) info->codes->major_opcode; 419 400 req->XResReqType = X_XResQueryResourceBytes; 420 - req->length += num_specs * 2; /* 2 longs per client id spec */ 421 - req->client = client; 422 - req->numSpecs = num_specs; 401 + req->length += num_specs * 2; /* 2 longs per client id spec */ 402 + req->client = (CARD32) client; 403 + req->numSpecs = (CARD32) num_specs; 423 404 424 - for (c = 0; c < num_specs; ++c) { 405 + for (int c = 0; c < num_specs; ++c) { 425 406 Data32(dpy, &resource_specs[c].resource, 4); 426 407 Data32(dpy, &resource_specs[c].type, 4); 427 408 } ··· 429 410 *num_sizes = 0; 430 411 *sizes = NULL; 431 412 432 - if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { 413 + if (!_XReply(dpy, (xReply *) &rep, 0, xFalse)) { 433 414 goto error; 434 415 } 435 416 ··· 440 421 goto error; 441 422 } 442 423 443 - UnlockDisplay (dpy); 444 - SyncHandle (); 424 + UnlockDisplay(dpy); 425 + SyncHandle(); 445 426 return Success; 446 427 447 428 error: 448 429 XResResourceSizeValuesDestroy(*num_sizes, *sizes); 449 430 450 - UnlockDisplay (dpy); 451 - SyncHandle (); 431 + UnlockDisplay(dpy); 432 + SyncHandle(); 452 433 return !Success; 453 434 } 454 435 455 - void XResResourceSizeValuesDestroy ( 456 - long num_sizes, 457 - XResResourceSizeValue *sizes 458 - ) 436 + void 437 + XResResourceSizeValuesDestroy(long num_sizes, XResResourceSizeValue *sizes) 459 438 { 460 - int c; 461 - for (c = 0; c < num_sizes; ++c) { 439 + for (int c = 0; c < num_sizes; ++c) { 462 440 free(sizes[c].cross_references); 463 441 } 464 442 free(sizes);