From: wessels <> Date: Wed, 5 May 1999 03:20:36 +0000 (+0000) Subject: gindent and 2.2 branch merge X-Git-Tag: SQUID_3_0_PRE1~2214 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=461eef686747aff9636afa553903d31901110484;p=thirdparty%2Fsquid.git gindent and 2.2 branch merge --- diff --git a/lib/Array.cc b/lib/Array.cc index b63901db5b..ef79515667 100644 --- a/lib/Array.cc +++ b/lib/Array.cc @@ -1,5 +1,5 @@ /* - * $Id: Array.cc,v 1.3 1998/07/22 20:36:32 wessels Exp $ + * $Id: Array.cc,v 1.4 1999/05/04 21:20:36 wessels Exp $ * * AUTHOR: Alex Rousskov * @@ -89,7 +89,7 @@ arrayAppend(Array * a, void *obj) { assert(a); if (a->count >= a->capacity) - arrayGrow(a, a->count+1); + arrayGrow(a, a->count + 1); a->items[a->count++] = obj; } @@ -111,15 +111,15 @@ arrayGrow(Array * a, int min_capacity) assert(a->capacity < min_capacity); delta = min_capacity; /* make delta a multiple of min_delta */ - delta += min_delta-1; + delta += min_delta - 1; delta /= min_delta; delta *= min_delta; /* actual grow */ assert(delta > 0); a->capacity += delta; a->items = a->items ? - xrealloc(a->items, a->capacity * sizeof(void*)) : - xmalloc(a->capacity * sizeof(void*)); + xrealloc(a->items, a->capacity * sizeof(void *)) : + xmalloc(a->capacity * sizeof(void *)); /* reset, just in case */ - memset(a->items+a->count, 0, (a->capacity-a->count) * sizeof(void*)); + memset(a->items + a->count, 0, (a->capacity - a->count) * sizeof(void *)); } diff --git a/lib/Stack.c b/lib/Stack.c index beb414b23a..538f5d48aa 100644 --- a/lib/Stack.c +++ b/lib/Stack.c @@ -1,5 +1,5 @@ /* - * $Id: Stack.c,v 1.8 1998/07/22 20:36:34 wessels Exp $ + * $Id: Stack.c,v 1.9 1999/05/04 21:20:37 wessels Exp $ * * AUTHOR: Alex Rousskov * @@ -55,8 +55,8 @@ stackPop(Stack * s) } void * -stackTop(Stack *s) +stackTop(Stack * s) { assert(s); - return s->count ? s->items[s->count-1] : NULL; + return s->count ? s->items[s->count - 1] : NULL; } diff --git a/lib/drand48.c b/lib/drand48.c index 996017f1ed..0c40f09b15 100644 --- a/lib/drand48.c +++ b/lib/drand48.c @@ -1,6 +1,8 @@ + + /* borrowed from libc/misc/drand48.c in Linux libc-5.4.46 this quick - hack by Martin Hamilton to make Squid build on - Win32 with GNU-Win32 - sorry, folks! */ + * hack by Martin Hamilton to make Squid build on + * Win32 with GNU-Win32 - sorry, folks! */ #ifndef HAVE_DRAND48 @@ -20,34 +22,36 @@ #define A2 0x5 #define C 0xB -static void next( void ); -static unsigned x[3] = { X0, X1, X2 }, a[3] = { A0, A1, A2 }, c = C; +static void next(void); +static unsigned x[3] = +{X0, X1, X2}, a[3] = +{A0, A1, A2}, c = C; -double drand48( void ); +double drand48(void); double -drand48( void ) +drand48(void) { - static double two16m = 1.0 / (1L << N); - next(); - return (two16m * (two16m * (two16m * x[0] + x[1]) + x[2])); + static double two16m = 1.0 / (1L << N); + next(); + return (two16m * (two16m * (two16m * x[0] + x[1]) + x[2])); } static void -next( void ) +next(void) { - unsigned p[2], q[2], r[2], carry0, carry1; - - MUL(a[0], x[0], p); - ADDEQU(p[0], c, carry0); - ADDEQU(p[1], carry0, carry1); - MUL(a[0], x[1], q); - ADDEQU(p[1], q[0], carry0); - MUL(a[1], x[0], r); - x[2] = LOW(carry0 + carry1 + CARRY(p[1], r[0]) + q[1] + r[1] + - a[0] * x[2] + a[1] * x[1] + a[2] * x[0]); - x[1] = LOW(p[1] + r[0]); - x[0] = LOW(p[0]); + unsigned p[2], q[2], r[2], carry0, carry1; + + MUL(a[0], x[0], p); + ADDEQU(p[0], c, carry0); + ADDEQU(p[1], carry0, carry1); + MUL(a[0], x[1], q); + ADDEQU(p[1], q[0], carry0); + MUL(a[1], x[0], r); + x[2] = LOW(carry0 + carry1 + CARRY(p[1], r[0]) + q[1] + r[1] + + a[0] * x[2] + a[1] * x[1] + a[2] * x[0]); + x[1] = LOW(p[1] + r[0]); + x[0] = LOW(p[0]); } #endif /* HAVE_DRAND48 */ diff --git a/lib/hash.c b/lib/hash.c index 8eecb1748a..44d3a2d066 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -1,6 +1,6 @@ /* - * $Id: hash.c,v 1.7 1999/01/24 04:07:01 wessels Exp $ + * $Id: hash.c,v 1.8 1999/05/04 21:20:38 wessels Exp $ * * DEBUG: section 0 Hash Tables * AUTHOR: Harvest Derived @@ -309,7 +309,7 @@ hashFreeMemory(hash_table * hid) { assert(hid); if (hid->buckets) - xfree(hid->buckets); + xfree(hid->buckets); xfree(hid); } diff --git a/lib/md5.c b/lib/md5.c index b92efabe1d..ef95a437fc 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -1,5 +1,5 @@ /* - * $Id: md5.c,v 1.8 1998/09/23 17:14:21 wessels Exp $ + * $Id: md5.c,v 1.9 1999/05/04 21:20:39 wessels Exp $ */ /* taken from RFC-1321/Appendix A.3 */ @@ -358,4 +358,5 @@ MD5_memset(char *output, int value, unsigned int len) for (i = 0; i < len; i++) output[i] = (char) value; } + #endif diff --git a/lib/rfc1035.c b/lib/rfc1035.c index 83009d11f3..fb333f9baa 100644 --- a/lib/rfc1035.c +++ b/lib/rfc1035.c @@ -1,5 +1,6 @@ + /* - * $Id: rfc1035.c,v 1.8 1999/04/18 06:02:55 wessels Exp $ + * $Id: rfc1035.c,v 1.9 1999/05/04 21:20:40 wessels Exp $ * * Low level DNS protocol routines * AUTHOR: Duane Wessels diff --git a/lib/rfc1738.c b/lib/rfc1738.c index 3b7e5481ba..becc651a5c 100644 --- a/lib/rfc1738.c +++ b/lib/rfc1738.c @@ -1,5 +1,5 @@ /* - * $Id: rfc1738.c,v 1.18 1998/08/12 16:08:05 wessels Exp $ + * $Id: rfc1738.c,v 1.19 1999/05/04 21:20:40 wessels Exp $ * * DEBUG: * AUTHOR: Harvest Derived @@ -138,16 +138,16 @@ rfc1738_unescape(char *s) s[i] = s[j]; if (s[i] != '%') continue; - if (s[j+1] == '%') { /* %% case */ + if (s[j + 1] == '%') { /* %% case */ j++; continue; } - if (s[j+1] && s[j+2]) { - hexnum[0] = s[j+1]; - hexnum[1] = s[j+2]; + if (s[j + 1] && s[j + 2]) { + hexnum[0] = s[j + 1]; + hexnum[1] = s[j + 2]; hexnum[2] = '\0'; if (1 == sscanf(hexnum, "%x", &x)) { - s[i] = (char) (0x0ff & x); + s[i] = (char) (0x0ff & x); j += 2; } } diff --git a/lib/safe_inet_addr.c b/lib/safe_inet_addr.c index 5d77be7405..1d0756a8cd 100644 --- a/lib/safe_inet_addr.c +++ b/lib/safe_inet_addr.c @@ -1,5 +1,6 @@ + /* - * $Id: safe_inet_addr.c,v 1.10 1999/04/26 21:52:17 wessels Exp $ + * $Id: safe_inet_addr.c,v 1.11 1999/05/04 21:20:41 wessels Exp $ */ #include "config.h" diff --git a/lib/splay.c b/lib/splay.c index 26ee01be2d..78a207b2f8 100644 --- a/lib/splay.c +++ b/lib/splay.c @@ -1,5 +1,5 @@ /* - * $Id: splay.c,v 1.10 1998/09/23 17:14:23 wessels Exp $ + * $Id: splay.c,v 1.11 1999/05/04 21:20:42 wessels Exp $ */ #include "config.h" @@ -100,7 +100,7 @@ splay_splay(const void *data, splayNode * top, SPLAYCMP * compare) } void -splay_destroy(splayNode * top, SPLAYFREE *free_func) +splay_destroy(splayNode * top, SPLAYFREE * free_func) { if (top->left) splay_destroy(top->left, free_func); @@ -111,7 +111,7 @@ splay_destroy(splayNode * top, SPLAYFREE *free_func) } void -splay_walk(splayNode *top, SPLAYWALKEE *walkee, void *state) +splay_walk(splayNode * top, SPLAYWALKEE * walkee, void *state) { if (top->left) splay_walk(top->left, walkee, state); diff --git a/lib/stub_memaccount.c b/lib/stub_memaccount.c index 5924b08eac..d576dbce2c 100644 --- a/lib/stub_memaccount.c +++ b/lib/stub_memaccount.c @@ -1,10 +1,10 @@ /* - * $Id: stub_memaccount.c,v 1.3 1998/09/23 17:16:13 wessels Exp $ + * $Id: stub_memaccount.c,v 1.4 1999/05/04 21:20:42 wessels Exp $ */ /* Stub function for programs not implementing statMemoryAccounted */ #include -int +int statMemoryAccounted(void) { return -1; diff --git a/lib/util.c b/lib/util.c index 1b378c8e6c..6c4b07d3b2 100644 --- a/lib/util.c +++ b/lib/util.c @@ -1,6 +1,6 @@ /* - * $Id: util.c,v 1.66 1999/04/15 06:15:39 wessels Exp $ + * $Id: util.c,v 1.67 1999/05/04 21:20:43 wessels Exp $ * * DEBUG: * AUTHOR: Harvest Derived @@ -700,7 +700,7 @@ xpercentInt(double part, double whole) return (int) rint(xpercent(part, whole)); #else /* SCO 3.2v4.2 doesn't have rint() -- mauri@mbp.ee */ - return (int) floor(xpercent(part, whole)+0.5); + return (int) floor(xpercent(part, whole) + 0.5); #endif } @@ -715,7 +715,7 @@ xdiv(double nom, double denom) const char * xitoa(int num) { - static char buf[24]; /* 2^64 = 18446744073709551616 */ + static char buf[24]; /* 2^64 = 18446744073709551616 */ snprintf(buf, sizeof(buf), "%d", num); return buf; }