Commit fae611c9 authored by Ulrich Sibiller's avatar Ulrich Sibiller

Client.c: save some lines

parent bbb23e58
......@@ -54,8 +54,7 @@
#include "Utils.h"
/*
* Need to include this after the stub
* definition of GC in Agent.h.
* Need to include this after the stub definition of GC in Agent.h.
*/
#include "compext/Compext.h"
......@@ -70,22 +69,20 @@
#undef DEBUG
/*
* Returns the last signal delivered
* to the process.
* Returns the last signal delivered to the process.
*/
extern int _X11TransSocketCheckSignal(void);
/*
* Time in milliseconds of first iteration
* through the dispatcher.
* Time in milliseconds of first iteration through the dispatcher.
*/
unsigned long nxagentStartTime = -1;
/*
* If defined, add a function checking if we
* need a null timeout after a client wakeup.
* If defined, add a function checking if we need a null timeout after
* a client wakeup.
*/
#undef CHECK_RESTARTED_CLIENTS
......@@ -103,8 +100,8 @@ void nxagentCheckRestartedClients(struct timeval **timeout);
int nxagentClientPrivateIndex;
/*
* The master nxagent holds in nxagentShadowCounter
* the number of shadow nxagents connected to itself.
* The master nxagent holds in nxagentShadowCounter the number of
* shadow nxagents connected to itself.
*/
int nxagentShadowCounter = 0;
......@@ -120,8 +117,8 @@ void nxagentInitClientPrivates(ClientPtr client)
}
/*
* Guess the running application based on the
* properties attached to its main window.
* Guess the running application based on the properties attached to
* its main window.
*/
void nxagentGuessClientHint(ClientPtr client, Atom property, char *data)
......@@ -199,8 +196,8 @@ void nxagentGuessShadowHint(ClientPtr client, Atom property)
#endif
/*
* From this moment on we ignore the visibility
* checks to keep the windows updated.
* From this moment on we ignore the visibility checks to keep
* the windows updated.
*/
nxagentChangeOption(IgnoreVisibility, 1);
......@@ -210,7 +207,6 @@ void nxagentGuessShadowHint(ClientPtr client, Atom property)
void nxagentCheckIfShadowAgent(ClientPtr client)
{
if (nxagentClientPriv(client) -> clientHint == NXAGENT_SHADOW)
{
#ifdef TEST
......@@ -234,14 +230,11 @@ void nxagentCheckIfShadowAgent(ClientPtr client)
nxagentShadowCounter);
#endif
if (nxagentShadowCounter == 0)
{
/*
* The last shadow nxagent has been detached
* from master nxagent.
* The master nxagent could do some action
* here.
* The last shadow nxagent has been detached from master
* nxagent. The master nxagent could do some action here.
*/
#ifdef TEST
......@@ -255,13 +248,11 @@ void nxagentCheckIfShadowAgent(ClientPtr client)
void nxagentWakeupByReconnect(void)
{
int i;
#ifdef TEST
fprintf(stderr, "++++++nxagentWakeupByReconnect: Going to wakeup all clients.\n");
#endif
for (i = 1; i < currentMaxClients; i++)
for (int i = 1; i < currentMaxClients; i++)
{
if (clients[i] != NULL)
{
......@@ -343,8 +334,7 @@ void nxagentWaitWakeupBySplit(ClientPtr client)
#endif
/*
* Be sure we intercept an I/O error
* as well as an interrupt.
* Be sure we intercept an I/O error as well as an interrupt.
*/
#ifdef USE_FINISH_SPLIT
......@@ -358,11 +348,9 @@ void nxagentWaitWakeupBySplit(ClientPtr client)
for (;;)
{
/*
* Can we handle all the possible events here
* or we need to select only the split events?
* Handling all the possible events would pre-
* empt the queue and make a better use of the
* link.
* Can we handle all the possible events here or we need to select
* only the split events? Handling all the possible events would
* preempt the queue and make a better use of the link.
*/
#ifdef WAIT_ALL_EVENTS
......@@ -407,9 +395,9 @@ void nxagentWaitWakeupBySplit(ClientPtr client)
int nxagentSuspendBySplit(ClientPtr client)
{
/*
FIXME: Should record a serial number for the client, so that
the client is not restarted because of an end of split
of a previous client with the same index.
FIXME: Should record a serial number for the client, so that the
client is not restarted because of an end of split of a
previous client with the same index.
*/
if (client -> index < MAX_CONNECTIONS)
{
......@@ -453,9 +441,9 @@ FIXME: Should record a serial number for the client, so that
int nxagentWakeupBySplit(ClientPtr client)
{
/*
FIXME: Should record a serial number for the client, so that
the client is not restarted because of the end of the
split for a previous client with the same index.
FIXME: Should record a serial number for the client, so that the
client is not restarted because of the end of the split for a
previous client with the same index.
*/
if (client -> index < MAX_CONNECTIONS)
{
......@@ -498,16 +486,13 @@ void nxagentCheckRestartedClients(struct timeval **timeout)
{
static struct timeval zero;
int i;
/*
* If any of the restarted clients had requests
* in input we'll need to enter the select with
* a null timeout, or we will block until any
* other client becomes available.
* If any of the restarted clients had requests in input we'll need
* to enter the select with a null timeout, or we will block until
* any other client becomes available.
*/
for (i = 1; i < currentMaxClients; i++)
for (int i = 1; i < currentMaxClients; i++)
{
if (clients[i] != NULL && clients[i] -> osPrivate != NULL &&
nxagentNeedWakeup(clients[i]) == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment