aboutsummaryrefslogtreecommitdiff
path: root/lib/strtoofft.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-11-05 09:45:09 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-11-05 09:45:09 +0000
commitad6e28073c985a42e8b15d2234baa7ef67ffcb35 (patch)
tree3290673b6a41d68080993ad388310d1b049e2793 /lib/strtoofft.c
parentaf29dcbafb8103472f92fb61fd95d4179730fcd8 (diff)
downloadgnurl-ad6e28073c985a42e8b15d2234baa7ef67ffcb35.tar.gz
gnurl-ad6e28073c985a42e8b15d2234baa7ef67ffcb35.tar.bz2
gnurl-ad6e28073c985a42e8b15d2234baa7ef67ffcb35.zip
removed space after if and while before the parenthesis for better source code
consistency
Diffstat (limited to 'lib/strtoofft.c')
-rw-r--r--lib/strtoofft.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/lib/strtoofft.c b/lib/strtoofft.c
index 043ff4d9b..6cd9a3e26 100644
--- a/lib/strtoofft.c
+++ b/lib/strtoofft.c
@@ -40,7 +40,7 @@
/* Range tests can be used for alphanum decoding if characters are consecutive,
like in ASCII. Else an array is scanned. Determine this condition now. */
-#if ('9' - '0') != 9 || ('Z' - 'A') != 25 || ('z' - 'a') != 25
+#if('9' - '0') != 9 || ('Z' - 'A') != 25 || ('z' - 'a') != 25
#include <string.h>
#define NO_RANGE_TEST
@@ -67,35 +67,35 @@ curlx_strtoll(const char *nptr, char **endptr, int base)
/* Skip leading whitespace. */
end = (char *)nptr;
- while (ISSPACE(end[0])) {
+ while(ISSPACE(end[0])) {
end++;
}
/* Handle the sign, if any. */
- if (end[0] == '-') {
+ if(end[0] == '-') {
is_negative = 1;
end++;
}
- else if (end[0] == '+') {
+ else if(end[0] == '+') {
end++;
}
- else if (end[0] == '\0') {
+ else if(end[0] == '\0') {
/* We had nothing but perhaps some whitespace -- there was no number. */
- if (endptr) {
+ if(endptr) {
*endptr = end;
}
return 0;
}
/* Handle special beginnings, if present and allowed. */
- if (end[0] == '0' && end[1] == 'x') {
- if (base == 16 || base == 0) {
+ if(end[0] == '0' && end[1] == 'x') {
+ if(base == 16 || base == 0) {
end += 2;
base = 16;
}
}
- else if (end[0] == '0') {
- if (base == 8 || base == 0) {
+ else if(end[0] == '0') {
+ if(base == 8 || base == 0) {
end++;
base = 8;
}
@@ -104,7 +104,7 @@ curlx_strtoll(const char *nptr, char **endptr, int base)
/* Matching strtol, if the base is 0 and it doesn't look like
* the number is octal or hex, we assume it's base 10.
*/
- if (base == 0) {
+ if(base == 0) {
base = 10;
}
@@ -115,7 +115,7 @@ curlx_strtoll(const char *nptr, char **endptr, int base)
i != -1;
end++, i = get_char(end[0], base)) {
newval = base * value + i;
- if (newval < value) {
+ if(newval < value) {
/* We've overflowed. */
overflow = 1;
break;
@@ -124,14 +124,14 @@ curlx_strtoll(const char *nptr, char **endptr, int base)
value = newval;
}
- if (!overflow) {
- if (is_negative) {
+ if(!overflow) {
+ if(is_negative) {
/* Fix the sign. */
value *= -1;
}
}
else {
- if (is_negative)
+ if(is_negative)
value = CURL_LLONG_MIN;
else
value = CURL_LLONG_MAX;
@@ -139,7 +139,7 @@ curlx_strtoll(const char *nptr, char **endptr, int base)
SET_ERRNO(ERANGE);
}
- if (endptr)
+ if(endptr)
*endptr = end;
return value;
@@ -159,13 +159,13 @@ static int get_char(char c, int base)
{
#ifndef NO_RANGE_TEST
int value = -1;
- if (c <= '9' && c >= '0') {
+ if(c <= '9' && c >= '0') {
value = c - '0';
}
- else if (c <= 'Z' && c >= 'A') {
+ else if(c <= 'Z' && c >= 'A') {
value = c - 'A' + 10;
}
- else if (c <= 'z' && c >= 'a') {
+ else if(c <= 'z' && c >= 'a') {
value = c - 'a' + 10;
}
#else
@@ -174,16 +174,16 @@ static int get_char(char c, int base)
cp = memchr(valchars, c, 10 + 26 + 26);
- if (!cp)
+ if(!cp)
return -1;
value = cp - valchars;
- if (value >= 10 + 26)
+ if(value >= 10 + 26)
value -= 26; /* Lowercase. */
#endif
- if (value >= base) {
+ if(value >= base) {
value = -1;
}