/*
- * $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
*
{
assert(a);
if (a->count >= a->capacity)
- arrayGrow(a, a->count+1);
+ arrayGrow(a, a->count + 1);
a->items[a->count++] = obj;
}
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 *));
}
/*
- * $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
*
}
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;
}
+
+
/* borrowed from libc/misc/drand48.c in Linux libc-5.4.46 this quick
- hack by Martin Hamilton <martinh@gnu.org> to make Squid build on
- Win32 with GNU-Win32 - sorry, folks! */
+ * hack by Martin Hamilton <martinh@gnu.org> to make Squid build on
+ * Win32 with GNU-Win32 - sorry, folks! */
#ifndef HAVE_DRAND48
#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 */
/*
- * $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
{
assert(hid);
if (hid->buckets)
- xfree(hid->buckets);
+ xfree(hid->buckets);
xfree(hid);
}
/*
- * $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 */
for (i = 0; i < len; i++)
output[i] = (char) value;
}
+
#endif
+
/*
- * $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
/*
- * $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
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;
}
}
+
/*
- * $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"
/*
- * $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"
}
void
-splay_destroy(splayNode * top, SPLAYFREE *free_func)
+splay_destroy(splayNode * top, SPLAYFREE * free_func)
{
if (top->left)
splay_destroy(top->left, 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);
/*
- * $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 <config.h>
-int
+int
statMemoryAccounted(void)
{
return -1;
/*
- * $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
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
}
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;
}