[PATCH: libXdmcp 1/4] Constify function prototypes
Matt Turner
mattst88 at gmail.com
Wed May 5 13:04:37 PDT 2010
On Wed, May 5, 2010 at 3:47 PM, Alan Coopersmith
<alan.coopersmith at oracle.com> wrote:
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> ---
> A8Eq.c | 2 +-
> CA8.c | 2 +-
> CmpKey.c | 2 +-
> RR.c | 2 +-
> WA16.c | 2 +-
> WA32.c | 2 +-
> WA8.c | 2 +-
> Whead.c | 2 +-
> include/X11/Xdmcp.h | 18 +++++++++---------
> 9 files changed, 17 insertions(+), 17 deletions(-)
>
> diff --git a/A8Eq.c b/A8Eq.c
> index d274f78..241d953 100644
> --- a/A8Eq.c
> +++ b/A8Eq.c
> @@ -36,7 +36,7 @@ in this Software without prior written authorization from The Open Group.
> #include <X11/Xdmcp.h>
>
> int
> -XdmcpARRAY8Equal (ARRAY8Ptr array1, ARRAY8Ptr array2)
> +XdmcpARRAY8Equal (const ARRAY8Ptr array1, const ARRAY8Ptr array2)
> {
> int i;
>
> diff --git a/CA8.c b/CA8.c
> index dc68c40..79ca6b3 100644
> --- a/CA8.c
> +++ b/CA8.c
> @@ -37,7 +37,7 @@ in this Software without prior written authorization from The Open Group.
> #include <X11/Xfuncs.h>
>
> int
> -XdmcpCopyARRAY8 (ARRAY8Ptr src, ARRAY8Ptr dst)
> +XdmcpCopyARRAY8 (const ARRAY8Ptr src, ARRAY8Ptr dst)
> {
> dst->length = src->length;
> dst->data = (CARD8 *) Xalloc (dst->length * sizeof (CARD8));
> diff --git a/CmpKey.c b/CmpKey.c
> index 112bc20..47c4d73 100644
> --- a/CmpKey.c
> +++ b/CmpKey.c
> @@ -38,7 +38,7 @@ in this Software without prior written authorization from The Open Group.
> #include <X11/Xdmcp.h>
>
> int
> -XdmcpCompareKeys (XdmAuthKeyPtr a, XdmAuthKeyPtr b)
> +XdmcpCompareKeys (const XdmAuthKeyPtr a, const XdmAuthKeyPtr b)
> {
> int i;
>
> diff --git a/RR.c b/RR.c
> index 3f0c26a..956dd5b 100644
> --- a/RR.c
> +++ b/RR.c
> @@ -36,7 +36,7 @@ in this Software without prior written authorization from The Open Group.
> #include <X11/Xdmcp.h>
>
> int
> -XdmcpReadRemaining (XdmcpBufferPtr buffer)
> +XdmcpReadRemaining (const XdmcpBufferPtr buffer)
> {
> return buffer->count - buffer->pointer;
> }
> diff --git a/WA16.c b/WA16.c
> index 8ad307b..c7a1a21 100644
> --- a/WA16.c
> +++ b/WA16.c
> @@ -36,7 +36,7 @@ in this Software without prior written authorization from The Open Group.
> #include <X11/Xdmcp.h>
>
> int
> -XdmcpWriteARRAY16 (XdmcpBufferPtr buffer, ARRAY16Ptr array)
> +XdmcpWriteARRAY16 (XdmcpBufferPtr buffer, const ARRAY16Ptr array)
> {
> int i;
>
> diff --git a/WA32.c b/WA32.c
> index b58ad25..98a466d 100644
> --- a/WA32.c
> +++ b/WA32.c
> @@ -36,7 +36,7 @@ in this Software without prior written authorization from The Open Group.
> #include <X11/Xdmcp.h>
>
> int
> -XdmcpWriteARRAY32 (XdmcpBufferPtr buffer, ARRAY32Ptr array)
> +XdmcpWriteARRAY32 (XdmcpBufferPtr buffer, const ARRAY32Ptr array)
> {
> int i;
>
> diff --git a/WA8.c b/WA8.c
> index 336d747..73e23b4 100644
> --- a/WA8.c
> +++ b/WA8.c
> @@ -36,7 +36,7 @@ in this Software without prior written authorization from The Open Group.
> #include <X11/Xdmcp.h>
>
> int
> -XdmcpWriteARRAY8 (XdmcpBufferPtr buffer, ARRAY8Ptr array)
> +XdmcpWriteARRAY8 (XdmcpBufferPtr buffer, const ARRAY8Ptr array)
> {
> int i;
>
> diff --git a/Whead.c b/Whead.c
> index 82c55c9..eb76ef8 100644
> --- a/Whead.c
> +++ b/Whead.c
> @@ -40,7 +40,7 @@ in this Software without prior written authorization from The Open Group.
> int
> XdmcpWriteHeader (
> XdmcpBufferPtr buffer,
> - XdmcpHeaderPtr header)
> + const XdmcpHeaderPtr header)
> {
> BYTE *newData;
>
> diff --git a/include/X11/Xdmcp.h b/include/X11/Xdmcp.h
> index 2548485..94d0cf7 100644
> --- a/include/X11/Xdmcp.h
> +++ b/include/X11/Xdmcp.h
> @@ -121,14 +121,14 @@ typedef struct _XdmAuthKey {
>
> typedef char *XdmcpNetaddr;
>
> -extern int XdmcpWriteARRAY16(XdmcpBufferPtr buffer, ARRAY16Ptr array);
> -extern int XdmcpWriteARRAY32(XdmcpBufferPtr buffer, ARRAY32Ptr array);
> -extern int XdmcpWriteARRAY8(XdmcpBufferPtr buffer, ARRAY8Ptr array);
> -extern int XdmcpWriteARRAYofARRAY8(XdmcpBufferPtr buffer, ARRAYofARRAY8Ptr array);
> +extern int XdmcpWriteARRAY16(XdmcpBufferPtr buffer, const ARRAY16Ptr array);
> +extern int XdmcpWriteARRAY32(XdmcpBufferPtr buffer, const ARRAY32Ptr array);
> +extern int XdmcpWriteARRAY8(XdmcpBufferPtr buffer, const ARRAY8Ptr array);
> +extern int XdmcpWriteARRAYofARRAY8(XdmcpBufferPtr buffer, const ARRAYofARRAY8Ptr array);
> extern int XdmcpWriteCARD16(XdmcpBufferPtr buffer, unsigned value);
> extern int XdmcpWriteCARD32(XdmcpBufferPtr buffer, unsigned value);
> extern int XdmcpWriteCARD8(XdmcpBufferPtr buffer, unsigned value);
> -extern int XdmcpWriteHeader(XdmcpBufferPtr buffer, XdmcpHeaderPtr header);
> +extern int XdmcpWriteHeader(XdmcpBufferPtr buffer, const XdmcpHeaderPtr header);
>
> extern int XdmcpFlush(int fd, XdmcpBufferPtr buffer, XdmcpNetaddr to, int tolen);
>
> @@ -143,16 +143,16 @@ extern int XdmcpReadHeader(XdmcpBufferPtr buffer, XdmcpHeaderPtr header);
>
> extern int XdmcpFill(int fd, XdmcpBufferPtr buffer, XdmcpNetaddr from, int *fromlen);
>
> -extern int XdmcpReadRemaining(XdmcpBufferPtr buffer);
> +extern int XdmcpReadRemaining(const XdmcpBufferPtr buffer);
>
> extern void XdmcpDisposeARRAY8(ARRAY8Ptr array);
> extern void XdmcpDisposeARRAY16(ARRAY16Ptr array);
> extern void XdmcpDisposeARRAY32(ARRAY32Ptr array);
> extern void XdmcpDisposeARRAYofARRAY8(ARRAYofARRAY8Ptr array);
>
> -extern int XdmcpCopyARRAY8(ARRAY8Ptr src, ARRAY8Ptr dst);
> +extern int XdmcpCopyARRAY8(const ARRAY8Ptr src, ARRAY8Ptr dst);
>
> -extern int XdmcpARRAY8Equal(ARRAY8Ptr array1, ARRAY8Ptr array2);
> +extern int XdmcpARRAY8Equal(const ARRAY8Ptr array1, const ARRAY8Ptr array2);
>
> extern void XdmcpGenerateKey (XdmAuthKeyPtr key);
> extern void XdmcpIncrementKey (XdmAuthKeyPtr key);
> @@ -173,7 +173,7 @@ extern void *Xrealloc (void *old, unsigned long amount);
> extern void Xfree(void *old);
> #endif
>
> -extern int XdmcpCompareKeys (XdmAuthKeyPtr a, XdmAuthKeyPtr b);
> +extern int XdmcpCompareKeys (const XdmAuthKeyPtr a, const XdmAuthKeyPtr b);
>
> extern int XdmcpAllocARRAY16 (ARRAY16Ptr array, int length);
> extern int XdmcpAllocARRAY32 (ARRAY32Ptr array, int length);
> --
> 1.5.6.5
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>
Reviewed-by: Matt Turner <mattst88 at gmail.com>
More information about the xorg-devel
mailing list