summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorMikhail Gusarov <dottedmag@dottedmag.net>2010-06-06 21:18:40 +0700
committerKeith Packard <keithp@keithp.com>2010-06-10 06:42:42 -0700
commit7287ef9e6cf953066e4a092cca9d0e4a279172bf (patch)
treeb67414bd69d1a1afc881e224d2f04cd495eb81d2 /os
parentb3a7b229e1e1f212bdd185af5443311091824005 (diff)
Remove unnecessary parentheses around return values in functions
This patch was generated by the following Perl code: perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;' Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'os')
-rw-r--r--os/access.c28
-rw-r--r--os/connection.c2
-rw-r--r--os/io.c12
-rw-r--r--os/strcasecmp.c2
-rw-r--r--os/strcasestr.c2
-rw-r--r--os/strlcpy.c2
-rw-r--r--os/utils.c14
-rw-r--r--os/xdmcp.c22
8 files changed, 42 insertions, 42 deletions
diff --git a/os/access.c b/os/access.c
index 36e1b81a6..5f485c92f 100644
--- a/os/access.c
+++ b/os/access.c
@@ -329,7 +329,7 @@ ifioctl (int fd, int cmd, char *arg)
#ifdef SVR4
((struct ifconf *) arg)->ifc_len = ioc.ic_len;
#endif
- return(ret);
+ return ret;
}
#else /* Case sun, SCO325 and others */
#define ifioctl ioctl
@@ -1343,13 +1343,13 @@ AddHost (ClientPtr client,
if ((len = CheckAddr (family, pAddr, length)) < 0)
{
client->errorValue = length;
- return (BadValue);
+ return BadValue;
}
break;
case FamilyLocal:
default:
client->errorValue = family;
- return (BadValue);
+ return BadValue;
}
if (NewHost (family, pAddr, len, FALSE))
return Success;
@@ -1441,13 +1441,13 @@ RemoveHost (
if ((len = CheckAddr (family, pAddr, length)) < 0)
{
client->errorValue = length;
- return(BadValue);
+ return BadValue;
}
break;
case FamilyLocal:
default:
client->errorValue = family;
- return(BadValue);
+ return BadValue;
}
for (prev = &validhosts;
(host = *prev) && (!addrEqual (family, pAddr, len, host));
@@ -1458,7 +1458,7 @@ RemoveHost (
*prev = host->next;
FreeHost (host);
}
- return (Success);
+ return Success;
}
/* Get all hosts in the access control list */
@@ -1486,7 +1486,7 @@ GetHosts (
*data = ptr = malloc(n);
if (!ptr)
{
- return(BadAlloc);
+ return BadAlloc;
}
for (host = validhosts; host; host = host->next)
{
@@ -1502,7 +1502,7 @@ GetHosts (
}
*pnHosts = nHosts;
*pLen = n;
- return(Success);
+ return Success;
}
/* Check for valid address family and length, and return address length. */
@@ -1555,7 +1555,7 @@ CheckAddr (
default:
len = -1;
}
- return (len);
+ return len;
}
/* Check if a host is not in the access control list.
@@ -1572,7 +1572,7 @@ InvalidHost (
register HOST *selfhost, *host;
if (!AccessEnabled) /* just let them in */
- return(0);
+ return 0;
family = ConvertAddr (saddr, &len, (pointer *)&addr);
if (family == -1)
return 1;
@@ -1600,15 +1600,15 @@ InvalidHost (
{
if ((host->family == FamilyServerInterpreted)) {
if (siAddrMatch (family, addr, len, host, client)) {
- return (0);
+ return 0;
}
} else {
if (addrEqual (family, addr, len, host))
- return (0);
+ return 0;
}
}
- return (1);
+ return 1;
}
static int
@@ -1618,7 +1618,7 @@ ConvertAddr (
pointer *addr)
{
if (*len == 0)
- return (FamilyLocal);
+ return FamilyLocal;
switch (saddr->sa_family)
{
case AF_UNSPEC:
diff --git a/os/connection.c b/os/connection.c
index 293f31a21..cd0ca5efc 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -267,7 +267,7 @@ lookup_trans_conn (int fd)
return ListenTransConns[i];
}
- return (NULL);
+ return NULL;
}
/* Set MaxClients and lastfdesc, and allocate ConnectionTranslation */
diff --git a/os/io.c b/os/io.c
index 02e1ca317..b5f98b7fa 100644
--- a/os/io.c
+++ b/os/io.c
@@ -508,7 +508,7 @@ InsertFakeRequest(ClientPtr client, char *data, int count)
ibuf = (char *)realloc(oci->buffer, gotnow + count);
if (!ibuf)
- return(FALSE);
+ return FALSE;
oci->size = gotnow + count;
oci->buffer = ibuf;
oci->bufptr = ibuf + oci->bufcnt - gotnow;
@@ -529,7 +529,7 @@ InsertFakeRequest(ClientPtr client, char *data, int count)
FD_SET(fd, &ClientsWithInput);
else
YieldControlNoInput(fd);
- return(TRUE);
+ return TRUE;
}
/*****************************************************************
@@ -706,7 +706,7 @@ WriteToClient (ClientPtr who, int count, const void *__buf)
Bool multicount = FALSE;
#endif
if (!count || !who || who == serverClient || who->clientGone)
- return(0);
+ return 0;
oc = who->osPrivate;
oco = oc->output;
#ifdef DEBUG_COMMUNICATION
@@ -826,7 +826,7 @@ WriteToClient (ClientPtr who, int count, const void *__buf)
FD_SET(oc->fd, &OutputPending);
memmove((char *)oco->buf + oco->count, buf, count);
oco->count += count + padBytes;
- return(count);
+ return count;
}
/********************
@@ -948,7 +948,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
oc->trans_conn = NULL;
MarkClientException(who);
oco->count = 0;
- return(-1);
+ return -1;
}
oco->size = notWritten + BUFSIZE;
oco->buf = obuf;
@@ -981,7 +981,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
}
MarkClientException(who);
oco->count = 0;
- return(-1);
+ return -1;
}
}
diff --git a/os/strcasecmp.c b/os/strcasecmp.c
index ca1051dc1..ad6da6a10 100644
--- a/os/strcasecmp.c
+++ b/os/strcasecmp.c
@@ -42,7 +42,7 @@ xstrcasecmp(const char *str1, const char *str2)
while (tolower(*us1) == tolower(*us2)) {
if (*us1++ == '\0')
- return (0);
+ return 0;
us2++;
}
diff --git a/os/strcasestr.c b/os/strcasestr.c
index b3d45495c..f89b2f2dc 100644
--- a/os/strcasestr.c
+++ b/os/strcasestr.c
@@ -54,7 +54,7 @@ xstrcasestr(const char *s, const char *find)
do {
do {
if ((sc = *s++) == 0)
- return (NULL);
+ return NULL;
} while ((char)tolower((unsigned char)sc) != c);
} while (strncasecmp(s, find, len) != 0);
s--;
diff --git a/os/strlcpy.c b/os/strlcpy.c
index aa9d042e0..e8e1b0217 100644
--- a/os/strlcpy.c
+++ b/os/strlcpy.c
@@ -50,5 +50,5 @@ strlcpy(char *dst, const char *src, size_t siz)
;
}
- return(s - src - 1); /* count does not include NUL */
+ return s - src - 1; /* count does not include NUL */
}
diff --git a/os/utils.c b/os/utils.c
index b4a954f76..92bfad331 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -548,12 +548,12 @@ void UseMsg(void)
static int
VerifyDisplayName(const char *d)
{
- if ( d == (char *)0 ) return( 0 ); /* null */
- if ( *d == '\0' ) return( 0 ); /* empty */
- if ( *d == '-' ) return( 0 ); /* could be confused for an option */
- if ( *d == '.' ) return( 0 ); /* must not equal "." or ".." */
- if ( strchr(d, '/') != (char *)0 ) return( 0 ); /* very important!!! */
- return( 1 );
+ if ( d == (char *)0 ) return 0; /* null */
+ if ( *d == '\0' ) return 0; /* empty */
+ if ( *d == '-' ) return 0; /* could be confused for an option */
+ if ( *d == '.' ) return 0; /* must not equal "." or ".." */
+ if ( strchr(d, '/') != (char *)0 ) return 0; /* very important!!! */
+ return 1;
}
/*
@@ -1284,7 +1284,7 @@ System(char *command)
int status;
if (!command)
- return(1);
+ return 1;
#ifdef SIGCHLD
csig = signal(SIGCHLD, SIG_DFL);
diff --git a/os/xdmcp.c b/os/xdmcp.c
index e03f17e40..8fd903fe5 100644
--- a/os/xdmcp.c
+++ b/os/xdmcp.c
@@ -251,48 +251,48 @@ XdmcpOptions(int argc, char **argv, int i)
get_manager_by_name(argc, argv, i++);
XDM_INIT_STATE = XDM_QUERY;
AccessUsingXdmcp ();
- return (i + 1);
+ return i + 1;
}
if (strcmp(argv[i], "-broadcast") == 0) {
XDM_INIT_STATE = XDM_BROADCAST;
AccessUsingXdmcp ();
- return (i + 1);
+ return i + 1;
}
#if defined(IPv6) && defined(AF_INET6)
if (strcmp(argv[i], "-multicast") == 0) {
i = get_mcast_options(argc, argv, ++i);
XDM_INIT_STATE = XDM_MULTICAST;
AccessUsingXdmcp ();
- return (i + 1);
+ return i + 1;
}
#endif
if (strcmp(argv[i], "-indirect") == 0) {
get_manager_by_name(argc, argv, i++);
XDM_INIT_STATE = XDM_INDIRECT;
AccessUsingXdmcp ();
- return (i + 1);
+ return i + 1;
}
if (strcmp(argv[i], "-port") == 0) {
if (++i == argc) {
FatalError("Xserver: missing port number in command line\n");
}
xdm_udp_port = (unsigned short) atoi(argv[i]);
- return (i + 1);
+ return i + 1;
}
if (strcmp(argv[i], "-from") == 0) {
get_fromaddr_by_name(argc, argv, ++i);
- return (i + 1);
+ return i + 1;
}
if (strcmp(argv[i], "-once") == 0) {
OneSession = TRUE;
- return (i + 1);
+ return i + 1;
}
if (strcmp(argv[i], "-class") == 0) {
if (++i == argc) {
FatalError("Xserver: missing class name in command line\n");
}
defaultDisplayClass = argv[i];
- return (i + 1);
+ return i + 1;
}
#ifdef HASXDMAUTH
if (strcmp(argv[i], "-cookie") == 0) {
@@ -300,7 +300,7 @@ XdmcpOptions(int argc, char **argv, int i)
FatalError("Xserver: missing cookie data in command line\n");
}
xdmAuthCookie = argv[i];
- return (i + 1);
+ return i + 1;
}
#endif
if (strcmp(argv[i], "-displayID") == 0) {
@@ -308,9 +308,9 @@ XdmcpOptions(int argc, char **argv, int i)
FatalError("Xserver: missing displayID in command line\n");
}
XdmcpRegisterManufacturerDisplayID (argv[i], strlen (argv[i]));
- return (i + 1);
+ return i + 1;
}
- return (i);
+ return i;
}
/*