aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/inet_net_pton.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2017-08-17 12:39:20 -0400
committerPeter Eisentraut <peter_e@gmx.net>2017-09-05 14:52:55 -0400
commit17273d059cd3a5cba818505b0d47a444c36a3513 (patch)
tree812c47b95d279e50e5d797852edd6664f217a0c8 /src/backend/utils/adt/inet_net_pton.c
parentba26f5cf768a31e0cbdf5eb8675ee187ad35fd0b (diff)
downloadpostgresql-17273d059cd3a5cba818505b0d47a444c36a3513.tar.gz
postgresql-17273d059cd3a5cba818505b0d47a444c36a3513.zip
Remove unnecessary parentheses in return statements
The parenthesized style has only been used in a few modules. Change that to use the style that is predominant across the whole tree. Reviewed-by: Michael Paquier <michael.paquier@gmail.com> Reviewed-by: Ryan Murphy <ryanfmurphy@gmail.com>
Diffstat (limited to 'src/backend/utils/adt/inet_net_pton.c')
-rw-r--r--src/backend/utils/adt/inet_net_pton.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/backend/utils/adt/inet_net_pton.c b/src/backend/utils/adt/inet_net_pton.c
index be788d37cd0..6f3ece1209c 100644
--- a/src/backend/utils/adt/inet_net_pton.c
+++ b/src/backend/utils/adt/inet_net_pton.c
@@ -73,7 +73,7 @@ inet_net_pton(int af, const char *src, void *dst, size_t size)
inet_cidr_pton_ipv6(src, dst, size);
default:
errno = EAFNOSUPPORT;
- return (-1);
+ return -1;
}
}
@@ -228,15 +228,15 @@ inet_cidr_pton_ipv4(const char *src, u_char *dst, size_t size)
goto emsgsize;
*dst++ = '\0';
}
- return (bits);
+ return bits;
enoent:
errno = ENOENT;
- return (-1);
+ return -1;
emsgsize:
errno = EMSGSIZE;
- return (-1);
+ return -1;
}
/*
@@ -338,11 +338,11 @@ inet_net_pton_ipv4(const char *src, u_char *dst)
enoent:
errno = ENOENT;
- return (-1);
+ return -1;
emsgsize:
errno = EMSGSIZE;
- return (-1);
+ return -1;
}
static int
@@ -363,19 +363,19 @@ getbits(const char *src, int *bitsp)
if (pch != NULL)
{
if (n++ != 0 && val == 0) /* no leading zeros */
- return (0);
+ return 0;
val *= 10;
val += (pch - digits);
if (val > 128) /* range */
- return (0);
+ return 0;
continue;
}
- return (0);
+ return 0;
}
if (n == 0)
- return (0);
+ return 0;
*bitsp = val;
- return (1);
+ return 1;
}
static int
@@ -397,32 +397,32 @@ getv4(const char *src, u_char *dst, int *bitsp)
if (pch != NULL)
{
if (n++ != 0 && val == 0) /* no leading zeros */
- return (0);
+ return 0;
val *= 10;
val += (pch - digits);
if (val > 255) /* range */
- return (0);
+ return 0;
continue;
}
if (ch == '.' || ch == '/')
{
if (dst - odst > 3) /* too many octets? */
- return (0);
+ return 0;
*dst++ = val;
if (ch == '/')
- return (getbits(src, bitsp));
+ return getbits(src, bitsp);
val = 0;
n = 0;
continue;
}
- return (0);
+ return 0;
}
if (n == 0)
- return (0);
+ return 0;
if (dst - odst > 3) /* too many octets? */
- return (0);
+ return 0;
*dst++ = val;
- return (1);
+ return 1;
}
static int
@@ -552,13 +552,13 @@ inet_cidr_pton_ipv6(const char *src, u_char *dst, size_t size)
*/
memcpy(dst, tmp, NS_IN6ADDRSZ);
- return (bits);
+ return bits;
enoent:
errno = ENOENT;
- return (-1);
+ return -1;
emsgsize:
errno = EMSGSIZE;
- return (-1);
+ return -1;
}