aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-05-01 11:07:21 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-11-02 11:17:59 +0100
commite755e660009f57f58ecf001c65b69e1bc0a29430 (patch)
treeaffa07438d6b6e333e2e7890ac34c5a9bff012a5 /nx-X11/programs/Xserver
parent7afe95535b10739d806e5d7c15a8a1e86093bf84 (diff)
downloadnx-libs-e755e660009f57f58ecf001c65b69e1bc0a29430.tar.gz
nx-libs-e755e660009f57f58ecf001c65b69e1bc0a29430.tar.bz2
nx-libs-e755e660009f57f58ecf001c65b69e1bc0a29430.zip
NXshm.c: rework code to be identical for ProcShmDispatch and SProcShmDispatch
Diffstat (limited to 'nx-X11/programs/Xserver')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXshm.c120
1 files changed, 60 insertions, 60 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
index e1b55f561..2e96c5006 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
@@ -492,20 +492,6 @@ nxagent_ProcShmDispatch (client)
register ClientPtr client;
{
REQUEST(xReq);
-
-#ifdef NXAGENT_SERVER
- #ifdef TEST
- fprintf(stderr, "ProcShmDispatch: Going to execute operation [%d] for client [%d].\n",
- stuff -> data, client -> index);
-
- if (stuff->data <= X_ShmCreatePixmap)
- {
- fprintf(stderr, "ProcShmDispatch: Request [%s] OPCODE#%d.\n",
- nxagentShmRequestLiteral[stuff->data], stuff->data);
- }
- #endif
-#endif
-
switch (stuff->data)
{
case X_ShmQueryVersion:
@@ -516,13 +502,6 @@ nxagent_ProcShmDispatch (client)
return ProcShmDetach(client);
case X_ShmPutImage:
{
-#ifdef NXAGENT_SERVER
- #ifdef TEST
- fprintf(stderr, "ProcShmDispatch: Going to execute ProcShmPutImage() for client [%d].\n",
- client -> index);
- #endif
-#endif
-
#ifdef PANORAMIX
if ( !noPanoramiXExtension )
return ProcPanoramiXShmPutImage(client);
@@ -546,6 +525,31 @@ nxagent_ProcShmDispatch (client)
}
}
+static int
+nxagent_SProcShmDispatch (client)
+ register ClientPtr client;
+{
+ REQUEST(xReq);
+
+ switch (stuff->data)
+ {
+ case X_ShmQueryVersion:
+ return SProcShmQueryVersion(client);
+ case X_ShmAttach:
+ return SProcShmAttach(client);
+ case X_ShmDetach:
+ return SProcShmDetach(client);
+ case X_ShmPutImage:
+ return SProcShmPutImage(client);
+ case X_ShmGetImage:
+ return SProcShmGetImage(client);
+ case X_ShmCreatePixmap:
+ return SProcShmCreatePixmap(client);
+ default:
+ return BadRequest;
+ }
+}
+
/* A wrapper that handles the trap. This construct is used
to keep the derived code closer to the original
*/
@@ -554,6 +558,24 @@ ProcShmDispatch (register ClientPtr client)
{
int result;
+ #ifdef TEST
+ REQUEST(xReq);
+ fprintf(stderr, "ProcShmDispatch: Going to execute operation [%d] for client [%d].\n",
+ stuff -> data, client -> index);
+
+ if (stuff->data <= X_ShmCreatePixmap)
+ {
+ fprintf(stderr, "ProcShmDispatch: Request [%s] OPCODE#%d.\n",
+ nxagentShmRequestLiteral[stuff->data], stuff->data);
+ }
+
+ if (stuff->data == X_ShmPutImage)
+ {
+ fprintf(stderr, "ProcShmDispatch: Going to execute ProcShmPutImage() for client [%d].\n",
+ client -> index);
+ }
+ #endif
+
nxagentShmTrap = 1;
result = nxagent_ProcShmDispatch(client);
@@ -564,55 +586,33 @@ ProcShmDispatch (register ClientPtr client)
}
static int
-SProcShmDispatch (client)
- register ClientPtr client;
+SProcShmDispatch (register ClientPtr client)
{
- REQUEST(xReq);
+ int result;
#ifdef TEST
+ REQUEST(xReq);
fprintf(stderr, "SProcShmDispatch: Going to execute operation [%d] for client [%d].\n",
stuff -> data, client -> index);
- #endif
- switch (stuff->data)
+ if (stuff->data <= X_ShmCreatePixmap)
{
- case X_ShmQueryVersion:
- return SProcShmQueryVersion(client);
- case X_ShmAttach:
- return SProcShmAttach(client);
- case X_ShmDetach:
- return SProcShmDetach(client);
- case X_ShmPutImage:
- {
- int result;
-
- #ifdef TEST
- fprintf(stderr, "SProcShmDispatch: Going to execute SProcShmPutImage() for client [%d].\n",
- client -> index);
- #endif
+ fprintf(stderr, "ProcShmDispatch: Request [%s] OPCODE#%d.\n",
+ nxagentShmRequestLiteral[stuff->data], stuff->data);
+ }
-#ifdef NXAGENT_SERVER
- nxagentShmTrap = 1;
-#endif
+ if (stuff->data == X_ProxShmPutImage)
+ {
+ fprintf(stderr, "SProcShmDispatch: Going to execute SProcShmPutImage() for client [%d].\n",
+ client -> index);
+ }
+ #endif
- result = SProcShmPutImage(client);
+ nxagentShmTrap = 1;
-#ifdef NXAGENT_SERVER
- nxagentShmTrap = 0;
-#endif
+ result = nxagent_SProcShmDispatch(client);
- #ifdef TEST
- fprintf(stderr, "SProcShmDispatch: Returning from SProcShmPutImage() for client [%d].\n",
- client -> index);
- #endif
+ nxagentShmTrap = 0;
- return result;
- }
- case X_ShmGetImage:
- return SProcShmGetImage(client);
- case X_ShmCreatePixmap:
- return SProcShmCreatePixmap(client);
- default:
- return BadRequest;
- }
+ return result;
}