aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-05-03 23:50:45 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-11-02 11:30:36 +0100
commitc61ac23f244899e68e77bf0381eb477a77a28740 (patch)
tree7690c037d45219fe2f7869f1140b3eff15d3ea05 /nx-X11
parent24c42813d8c2d9ced7233bf97a0026f72067d917 (diff)
downloadnx-libs-c61ac23f244899e68e77bf0381eb477a77a28740.tar.gz
nx-libs-c61ac23f244899e68e77bf0381eb477a77a28740.tar.bz2
nx-libs-c61ac23f244899e68e77bf0381eb477a77a28740.zip
NXdispatch.c: simplify InitClientPrivates()
by calling the upstream function from dix/dispatch.c
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/programs/Xserver/dix/dispatch.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c42
2 files changed, 13 insertions, 35 deletions
diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c
index ef3d7b021..3ab9b2472 100644
--- a/nx-X11/programs/Xserver/dix/dispatch.c
+++ b/nx-X11/programs/Xserver/dix/dispatch.c
@@ -3648,9 +3648,12 @@ void InitClient(ClientPtr client, int i, void * ospriv)
client->clientIds = NULL;
}
-#ifndef NXAGENT_SERVER
int
+#ifdef NXAGENT_SERVER
+xorg_InitClientPrivates(ClientPtr client)
+#else
InitClientPrivates(ClientPtr client)
+#endif
{
register char *ptr;
DevUnion *ppriv;
@@ -3694,7 +3697,6 @@ InitClientPrivates(ClientPtr client)
}
return 1;
}
-#endif /* NXAGENT_SERVER */
/************************
* int NextAvailableClient(ospriv)
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
index c427c05f2..ace2941b1 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
@@ -1115,41 +1115,17 @@ CloseDownClient(register ClientPtr client)
int
InitClientPrivates(ClientPtr client)
{
- register char *ptr;
- DevUnion *ppriv;
- register unsigned *sizes;
- register unsigned size;
- register int i;
-
- if (totalClientSize == sizeof(ClientRec))
- ppriv = (DevUnion *)NULL;
- else if (client->index)
- ppriv = (DevUnion *)(client + 1);
- else
- {
- ppriv = (DevUnion *)malloc(totalClientSize - sizeof(ClientRec));
- if (!ppriv)
- return 0;
- }
- client->devPrivates = ppriv;
- sizes = clientPrivateSizes;
- ptr = (char *)(ppriv + clientPrivateLen);
- for (i = clientPrivateLen; --i >= 0; ppriv++, sizes++)
+ int ret = xorg_InitClientPrivates(client);
+
+ if (ret == 1)
{
- if ( (size = *sizes) )
- {
- ppriv->ptr = (void *)ptr;
- ptr += size;
- }
- else
- ppriv->ptr = (void *)NULL;
- }
- /*
- * Initialize the private members.
- */
+ /*
+ * Initialize the private members.
+ */
- nxagentInitClientPrivates(client);
+ nxagentInitClientPrivates(client);
+ }
- return 1;
+ return ret;
}