/*
- * $Id: MemPool.c,v 1.12 2002/08/09 10:57:42 robertc Exp $
+ * $Id: MemPool.c,v 1.13 2002/10/18 22:42:00 hno Exp $
*
* DEBUG: section 63 Low Level Memory Pool Management
* AUTHOR: Alex Rousskov, Andres Kroonmaa
{
if (obj < chunk->objCache)
return -1;
- if (obj < (void *)((char *)chunk->objCache + lastPool->chunk_size))
+ if (obj < (void *) ((char *) chunk->objCache + lastPool->chunk_size))
return 0;
return 1;
}
Free = chunk->freeList = chunk->objCache;
for (i = 1; i < pool->chunk_capacity; i++) {
- *Free = (void *) ((char *)Free + pool->obj_size);
+ *Free = (void *) ((char *) Free + pool->obj_size);
Free = *Free;
}
chunk->nextFreeChunk = pool->nextFreeChunk;
* not really need to be cleared.. There was a condition based on
* the object size here, but such condition is not safe.
*/
- memset(obj, 0, pool->obj_size);
+ memset(obj, 0, pool->obj_size);
Free = obj;
*Free = pool->freeCache;
pool->freeCache = obj;
/*
- * $Id: radix.c,v 1.17 2002/04/19 22:23:01 hno Exp $
+ * $Id: radix.c,v 1.18 2002/10/18 22:42:00 hno Exp $
*
* DEBUG: section 53 Radix tree data structure implementation
* AUTHOR: NetBSD Derived
#define rn_l rn_u.rn_node.rn_L
#define rn_r rn_u.rn_node.rn_R
#define rm_mask rm_rmu.rmu_mask
-#define rm_leaf rm_rmu.rmu_leaf /* extra field would make 32 bytes */
+#define rm_leaf rm_rmu.rmu_leaf /* extra field would make 32 bytes */
/* Helper macros */
}
static int
-rn_satsifies_leaf (char *trial, register struct squid_radix_node *leaf, int skip)
+rn_satsifies_leaf(char *trial, register struct squid_radix_node *leaf, int skip)
{
register char *cp = trial, *cp2 = leaf->rn_key, *cp3 = leaf->rn_mask;
char *cplim;
}
int
-squid_rn_walktree(struct squid_radix_node_head *h, int (*f)(struct squid_radix_node *, void *), void *w)
+squid_rn_walktree(struct squid_radix_node_head *h, int (*f) (struct squid_radix_node *, void *), void *w)
{
int error;
struct squid_radix_node *base, *next;
/*
- * $Id: rfc1035.c,v 1.27 2002/09/15 06:40:54 robertc Exp $
+ * $Id: rfc1035.c,v 1.28 2002/10/18 22:42:00 hno Exp $
*
* Low level DNS protocol routines
* AUTHOR: Duane Wessels
/* blasted compression */
unsigned short s;
off_t ptr;
- if (rdepth > 64) /* infinite pointer loop */
+ if (rdepth > 64) /* infinite pointer loop */
return 1;
memcpy(&s, buf + (*off), sizeof(s));
s = ntohs(s);
/*
- * $Id: rfc2617.c,v 1.5 2001/10/17 13:30:50 hno Exp $
+ * $Id: rfc2617.c,v 1.6 2002/10/18 22:42:00 hno Exp $
*
* DEBUG:
* AUTHOR: RFC 2617 & Robert Collins
MD5Update(&Md5Ctx, pszRealm, strlen(pszRealm));
MD5Update(&Md5Ctx, ":", 1);
MD5Update(&Md5Ctx, pszPassword, strlen(pszPassword));
- MD5Final((unsigned char *)HA1, &Md5Ctx);
+ MD5Final((unsigned char *) HA1, &Md5Ctx);
}
if (strcasecmp(pszAlg, "md5-sess") == 0) {
MD5Init(&Md5Ctx);
MD5Update(&Md5Ctx, pszNonce, strlen(pszNonce));
MD5Update(&Md5Ctx, ":", 1);
MD5Update(&Md5Ctx, pszCNonce, strlen(pszCNonce));
- MD5Final((unsigned char *)HA1, &Md5Ctx);
+ MD5Final((unsigned char *) HA1, &Md5Ctx);
}
CvtHex(HA1, SessionKey);
}
MD5Update(&Md5Ctx, ":", 1);
MD5Update(&Md5Ctx, HEntity, HASHHEXLEN);
}
- MD5Final((unsigned char *)HA2, &Md5Ctx);
+ MD5Final((unsigned char *) HA2, &Md5Ctx);
CvtHex(HA2, HA2Hex);
/* calculate response
MD5Update(&Md5Ctx, ":", 1);
}
MD5Update(&Md5Ctx, HA2Hex, HASHHEXLEN);
- MD5Final((unsigned char *)RespHash, &Md5Ctx);
+ MD5Final((unsigned char *) RespHash, &Md5Ctx);
CvtHex(RespHash, Response);
}
/*
- * $Id: splay.c,v 1.13 2002/04/06 08:49:26 adrian Exp $
+ * $Id: splay.c,v 1.14 2002/10/18 22:42:00 hno Exp $
*
* based on ftp://ftp.cs.cmu.edu/user/sleator/splaying/top-down-splay.c
* http://bobo.link.cs.cmu.edu/cgi-bin/splay/splay-cgi.pl
{
splayNode *x;
if (top == NULL)
- return NULL;
+ return NULL;
top = splay_splay(data, top, compare);
- if (splayLastResult == 0) { /* found it */
+ if (splayLastResult == 0) { /* found it */
if (top->left == NULL) {
x = top->right;
} else {
xfree(top);
return x;
}
- return top; /* It wasn't there */
+ return top; /* It wasn't there */
}
void
/*
- * $Id: util.c,v 1.87 2002/10/02 11:06:30 robertc Exp $
+ * $Id: util.c,v 1.88 2002/10/18 22:42:00 hno Exp $
*
* DEBUG:
* AUTHOR: Harvest Derived
void
xxfree(const void *s_const)
{
- void *s = (void *)s_const;
+ void *s = (void *) s_const;
PROF_start(xxfree);
#if XMALLOC_TRACE
xmalloc_show_trace(s, -1);
static char strerror_buf[BUFSIZ];
snprintf(strerror_buf, BUFSIZ, "%s", strerror(errno));
-
- if (strerror_buf)
+
+ if (strerror_buf)
snprintf(xstrerror_buf, BUFSIZ, "(%d) %s", errno, strerror_buf);
else
- snprintf(xstrerror_buf, BUFSIZ, "(%d) Unknown", errno);
+ snprintf(xstrerror_buf, BUFSIZ, "(%d) Unknown", errno);
return xstrerror_buf;
}
{
/* select format */
if (value < 1e9)
- snprintf(buf, buf_size, "%.2f MB", value / 1e6);
+ snprintf(buf, buf_size, "%.2f MB", value / 1e6);
else if (value < 1e12)
- snprintf(buf, buf_size, "%.3f GB", value / 1e9);
+ snprintf(buf, buf_size, "%.3f GB", value / 1e9);
else
- snprintf(buf, buf_size, "%.4f TB", value / 1e12);
+ snprintf(buf, buf_size, "%.4f TB", value / 1e12);
return buf;
}