Re: hay guys why isn't XOpenDisplay()'s argument const char?

2016-10-05 Thread Adam Jackson
On Wed, 2016-10-05 at 11:48 +0900, Ashe Goulding wrote:
> Is it safe to regard it as const char?

Yes. libX11 predates the wide availability of C89, so it tends not to
include things like 'const' in function signatures.

- ajax
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

Re: hay guys why isn't XOpenDisplay()'s argument const char?

2016-10-05 Thread Alan Coopersmith

On 10/ 4/16 07:48 PM, Ashe Goulding wrote:

Is it safe to regard it as const char?


Since it's declared as const char, yes:

#ifndef _Xconst
#define _Xconst const
#endif /* _Xconst */

extern Display *XOpenDisplay(
_Xconst char*   /* display_name */
);

(The ifdef used to be much more complicated, since libX11 was written before
 all compilers had support for const, but since we no longer support pre-C89
 compilers, it got simplified to this years back.)

--
-Alan Coopersmith-  alan.coopersm...@oracle.com
 Oracle Solaris Engineering - http://blogs.oracle.com/alanc
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

hay guys why isn't XOpenDisplay()'s argument const char?

2016-10-05 Thread Ashe Goulding
Is it safe to regard it as const char?
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s