summaryrefslogtreecommitdiff
path: root/xdpyinfo.c
AgeCommit message (Collapse)Author
2022-04-03fix -Wunused-[...] compiler warningsThomas Kuehne
xdpyinfo.c:148:1: warning: ‘silent_errors’ defined but not used [-Wunused-function] 148 | silent_errors(_X_UNUSED Display *dpy, _X_UNUSED XErrorEvent *ev) xdpyinfo.c:155:14: warning: ‘old_handler’ defined but not used [-Wunused-variable] 155 | static int (*old_handler)(Display *, XErrorEvent *) = NULL; Signed-off-by: Thomas Kuehne <thomas@kuehne.cn>
2022-01-09Fix spelling/wording issuesAlan Coopersmith
Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-03-24Add explicit casts to clear implicit conversion warningsAlan Coopersmith
xdpyinfo.c:173:17: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] qsort(extlist, n, sizeof(char *), StrCmp); ~~~~~ ^ xdpyinfo.c:183:26: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion] qe_cookies = calloc(n, sizeof(xcb_query_extension_cookie_t)); ~~~~~~ ^ xdpyinfo.c:195:12: warning: implicit conversion loses integer precision: 'unsigned long' to 'uint16_t' (aka 'unsigned short') [-Wconversion] strlen(extlist[i]), ^~~~~~~~~~~~~~~~~~ xdpyinfo.c:1382:51: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] int extlen = strlen(known_extensions[i].extname) + 1; ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-03-03Only check for XFree86 if vendor string doesn't match X.OrgAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-02-17Delete unused NULLSTR macroAlan Coopersmith
Spotted by clang: xdpyinfo.c:145:9: warning: macro is not used [-Wunused-macros] ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-02-17Mark required arguments to Xlib error handler as unusedAlan Coopersmith
Quiets clang warnings: xdpyinfo.c:151:24: warning: unused parameter 'dpy' [-Wunused-parameter] silent_errors(Display *dpy, XErrorEvent *ev) ^ xdpyinfo.c:151:42: warning: unused parameter 'ev' [-Wunused-parameter] silent_errors(Display *dpy, XErrorEvent *ev) ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-11-26Sprinkle consts in StrCmp to quiet cast warningsAlan Coopersmith
Makes gcc stop saying: xdpyinfo.c: In function ‘StrCmp’: xdpyinfo.c:162:20: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] xdpyinfo.c:162:39: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-11-26Print which option was in error along with usage messageAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-02-10Mark num_known_extensions as a const, since the size is fixed at compile timeAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-02-10Convert sprintf calls to snprintfAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-02-10Rename i & count in inner loop to avoid shadowing same named vars in outer loopAlan Coopersmith
xdpyinfo.c: In function `print_dmx_info': xdpyinfo.c:1282: warning: declaration of 'count' shadows a previous local xdpyinfo.c:1231: warning: shadowed declaration is here xdpyinfo.c:1282: warning: declaration of 'i' shadows a previous local xdpyinfo.c:1232: warning: shadowed declaration is here Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-21Add -version option to print version numberAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-21Combine usage messages into a single stringAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-21Declare 'len' as size_t to avoid unneccessary back-and-forth conversionsAlan Coopersmith
Fixes clang warnings: xdpyinfo.c:1463:12: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] int len = strlen(arg); ~~~ ^~~~~~~~~~~ xdpyinfo.c:1465:32: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] if (!strncmp("-display", arg, len)) { ~~~~~~~ ^~~ xdpyinfo.c:1468:47: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] } else if (!strncmp("-queryExtensions", arg, len)) { ~~~~~~~ ^~~ xdpyinfo.c:1470:35: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] } else if (!strncmp("-ext", arg, len)) { ~~~~~~~ ^~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-21Mark usage() as _X_NORETURNAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-11-05Include Xwindows.h on WIN32 to avoid type clashesJon TURNEY
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2011-09-28Silence gcc complaint about being unable to check printf format stringAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-28Remove unused function hasExtensionAlan Coopersmith
Leftover from the Xprint code removed in commit 889264a52a6cf988 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-28Add const attributes to fix gcc -Wwrite-strings warningsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-28Strip trailing whitespaceAlan Coopersmith
Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}' git diff -w & git diff -b show no diffs from this change Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-10-06Purge cvs tags.Jesse Adkins
Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
2010-10-04Use xcb for -queryExt instead of a round-trip per extensionAlan Coopersmith
On a system with 30 extensions listed by xdpyinfo, truss -c reports this saves quite a few system calls by batching the QueryExtension requests instead of a round-trip for each one: Xlib xcb writev 40 11 poll 80 22 recv 117 29 total (*) 464 296 (*) total includes all system calls, including many not shown since their count did not change significantly. There was one additional set of open/mmap/close etc. for loading the added libX11-xcb library. Over a tcp connection, this reduced both the number of packets, and due to tcp packet header overhead, the overall amount of data: Xlib xcb TCP packets 93 35 TCP bytes 11554 7726 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-03-27xprint: remove isPrintScreen codeGaetan Nadon
The if (isPrintScreen) always evaluate to false Reviewed-by: Jeremy Huddleston <jeremyhu@freedesktop.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-03-26xprint: remove conditional code regarding xprint featureGaetan Nadon
xprint has been removed from X Window System Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2009-10-12Use Xxf86dga.h & xf86dgaproto.h if present, to avoid warnings from old headersAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-09-21Use xf86vmproto.h instead of xf86vmstr.h if it is installedAlan Coopersmith
Clears warnings when built with xf86vidmodeproto 2.2.99.1 & later Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-01Improved XF86-VidModeExtension printingAlan Coopersmith
- Combine common modeline printing code into single function - Don't return 0 unless extension isn't supported, since that makes xdpyinfo report the extension isn't supported. - Don't exit immediately if some information is not available, since other info may be present. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-09-01Bug 3438: xdpyinfo reporting wrong information on xf86vidmode extensionAlan Coopersmith
https://bugs.freedesktop.org/show_bug.cgi?id=3438 Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-02-04Print Composite extension version for "-ext Composite"Alan Coopersmith
The only other information I could see to query in the Composite 0.4 protocol spec is the Composite Overlay Window XID, but the request to get that ID has the side effect of mapping the overlay window, and xdpyinfo shouldn't have side effects like that. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-01-13Ansification and compile warning fixes.Paulo Cesar Pereira de Andrade
This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, and corrects make distcheck.
2008-06-13Don't print '(null)' when XF86VidModeGetMonitor() returns NULL fields.Matthieu Herrb
2008-05-21Ignore errors from xf86misc rather than crashing out.Adam Jackson
2008-04-30Handle XExtension{Keyboard,Pointer}, added in inputproto 1.4Julien Cristau
2007-03-20Clear a couple more memory leaks found by Sun Studio dbx check -leaksAlan Coopersmith
2007-03-20Coverity #748: IsPrintScreen: Returned without freeing storage "pscreens"Alan Coopersmith
2007-03-20Coverity #749: print_XF86VidMode_info: Returned without freeing storage ↵Alan Coopersmith
"modelines"
2007-03-20Coverity #750: print_xinput_info() returned without freeing storage "ext"Alan Coopersmith
2007-03-20Coverity #752: XListDepths return leaked in print_xrender_info()Alan Coopersmith
2007-03-20Fix line wrapping of extensions list in usage messageAlan Coopersmith
2007-03-19Clear sparse warning: Using plain integer as NULL pointerAlan Coopersmith
2007-03-19Fix typos in commentsAlan Coopersmith
2005-07-08Add support for modular extension autodetection (ignored in monolithicXORG-6_8_99_903XORG-6_8_99_902XORG-6_8_99_901XORG-6_8_99_900XORG-6_8_99_16XORG-6_8_99_15Keith Packard
build)
2005-04-26//bugs.freedesktop.org/show_bug.cgi?id=2705) attachment #2555sco_port_update-baseXORG-6_8_99_9XORG-6_8_99_8XORG-6_8_99_7XORG-6_8_99_6XORG-6_8_99_5XORG-6_8_99_14XORG-6_8_99_13XORG-6_8_99_12XORG-6_8_99_11XORG-6_8_99_10Roland Mainz
(https://bugs.freedesktop.org/attachment.cgi?id=2555) bug 2705 part II: Fix build to work with |#define BuildXprint NO| Patch by Kevin E. Martin <kem@freedesktop.org>.
2005-03-11xc/programs/twm/ImakefileXORG-6_8_99_4XORG-6_8_99_3XORG-6_8_99_2XORG-6_8_99_1Roland Mainz
xc/programs/twm/twm.c //bugs.freedesktop.org/show_bug.cgi?id=2705) attachment #2087 (https://bugs.freedesktop.org/attachment.cgi?id=2087) Make twm ignore print screens to avoid that users accidentally warp on a non-video screen (which are not visible on any monitor) when the Xserver has both video and print screens. (This includes also a small cleanup of xdpyinfo where parts of the print screen test code comes from) Patch by Julien Lafon <julien.lafon@gmail.com> (MIT/X.org license).
2004-09-02Clean up defines for Xprint support and fix BuildServersOnly build forrel-0-6-1lg3d-rel-0-7-0lg3d-rel-0-6-2lg3d-baseXORG-6_8_2XORG-6_8_1_904XORG-6_8_1_903XORG-6_8_1_902XORG-6_8_1_901XORG-6_8_1XORG-6_8_0XORG-6_7_99_904Kevin E Martin
libXaw.
2004-08-16As discussed and agreed on on the release-wranglers meeting of August 16,XORG-6_7_99_903XORG-6_7_99_902XORG-6_7_99_901Kristian Høgsberg
I'm committing the patch from bug #1060 to back out unconditional Xprint functionality. Back out Xprint changes. Revert xman to CVS of June 5, revert xlogo to CVS of May 8, revert xedit to CVS of April 25, to back out unconditional Xprint support. Fix up Xprint config logic to be like the rest of the extensions: BuildXprint is a one-stop option for disabling everything Xprint related. XprtServer controls building Xprt, BuildXprintLib controls building Xprint libs and BuildXprintClients controls building clients related to Xprint. BuiltXprint defaults to YES and the other options respects relevant settings, i.e. BuildServer and BuildServersOnly. Build Xaw regardless of BuildXprintLib setting. Only build xphelloworld, xplsprinters and xprehashprinterlist when BuildXprintClients it YES. Disable building xmore, it has always supported XawPrintShell. Make Xprint support depend on BuildXprintLib.
2004-06-30Add Distributed Multihead X (DMX) supportXORG-6_7_99_2XORG-6_7_99_1Kevin E Martin
2004-05-25Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=672 - RFE: xdpyinfoRoland Mainz
should print information about print screens
2004-05-16Fix for http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=623 -Roland Mainz
RFE: "xdpyinfo" should have support for XpExtension.
2004-04-23Merging XORG-CURRENT into trunkXACE-SELINUX-MERGEEgbert Eich