Commit a22e7cc8 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Whitespace cleanup



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4920 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 1c68336e
......@@ -225,7 +225,7 @@ struct worker {
struct VCL_conf *vcl;
uint32_t *wlb, *wlp, *wle;
uint32_t *wlb, *wlp, *wle;
unsigned wlr;
struct SHA256Context *sha256ctx;
......
......@@ -129,7 +129,7 @@ VSLR(enum shmlogtag tag, int id, const char *b, unsigned len)
mlen = params->shm_reclen;
/* Truncate */
if (len > mlen)
if (len > mlen)
len = mlen;
p = vsl_get(len, 1, 0);
......
......@@ -428,7 +428,7 @@ hcb_lookup(const struct sess *sp, struct objhead *noh)
unsigned with_lock;
(void)sp;
with_lock = 0;
while (1) {
if (with_lock) {
......@@ -453,7 +453,7 @@ hcb_lookup(const struct sess *sp, struct objhead *noh)
VSL_stats->hcb_insert++;
assert(oh->refcnt > 0);
return (oh);
}
}
if (oh == NULL) {
assert(!with_lock);
......
......@@ -104,7 +104,7 @@ mgt_SHM_Alloc(unsigned size, const char *class, const char *type, const char *id
bprintf(sha->ident, "%s", ident);
VWMB();
if (seq != 0)
if (seq != 0)
do
loghead->alloc_seq = seq++;
while (loghead->alloc_seq == 0);
......@@ -207,7 +207,7 @@ mgt_SHM_Init(const char *fn, const char *l_arg)
av = ParseArgv(l_arg, ARGV_COMMA);
AN(av);
if (av[0] != NULL)
if (av[0] != NULL)
ARGV_ERR("\t-l ...: %s", av[0]);
ap = av + 1;
......@@ -249,7 +249,7 @@ mgt_SHM_Init(const char *fn, const char *l_arg)
fill = 1;
}
if (*ap != NULL)
if (*ap != NULL)
ARGV_ERR("\t-l ...: Too many sub-args\n");
FreeArgv(av);
......@@ -263,7 +263,7 @@ mgt_SHM_Init(const char *fn, const char *l_arg)
if (i >= 0) {
vsl_n_check(i);
(void)close(i);
}
}
(void)close(i);
vsl_buildnew(fn, size, fill);
......
......@@ -337,7 +337,7 @@ mgt_vcc_default(const char *b_arg, const char *f_arg, char *vcl, int C_flag)
(void)f_arg;
if (L_arg && b_arg == NULL) {
bprintf(buf,
bprintf(buf,
"backend default {\n"
" .host = \"127.0.0.1\";\n"
" .port = %s;\n"
......
......@@ -105,7 +105,7 @@ do_once_cb(void *priv, const struct vsl_statpt * const pt)
assert(!strcmp(pt->fmt, "uint64_t"));
val = *(const volatile uint64_t*)pt->ptr;
i = 0;
if (strcmp(pt->class, ""))
if (strcmp(pt->class, ""))
i += printf("%s.", pt->class);
if (strcmp(pt->ident, ""))
i += printf("%s.", pt->ident);
......@@ -113,7 +113,7 @@ do_once_cb(void *priv, const struct vsl_statpt * const pt)
if (i > op->pad)
op->pad = i + 1;
printf("%*.*s", op->pad - i, op->pad - i, "");
if (pt->flag == 'a')
if (pt->flag == 'a')
printf("%12ju %12.2f %s\n", val, val / op->up, pt->desc);
else
printf("%12ju %12s %s\n", val, ". ", pt->desc);
......@@ -141,7 +141,7 @@ do_list_cb(void *priv, const struct vsl_statpt * const pt)
(void)priv;
i = 0;
if (strcmp(pt->class, ""))
if (strcmp(pt->class, ""))
i += fprintf(stderr, "%s.", pt->class);
if (strcmp(pt->ident, ""))
i += fprintf(stderr, "%s.", pt->ident);
......
......@@ -209,7 +209,7 @@ do_curses(struct VSL_data *vd, const struct varnish_stats *VSL_stats,
AC(mvprintw(line, 0,
"%12ju %12.2f %12.2f %s\n",
ju, (ju - (intmax_t)pt->ref)/lt,
ju / up, pt->name));
ju / up, pt->name));
pt->ref = ju;
} else {
AC(mvprintw(line, 0,
......
......@@ -187,7 +187,7 @@ vtc_dump(struct vtclog *vl, unsigned lvl, const char *pfx, const char *str)
l = 0;
for(; *str != '\0'; str++) {
if (++l > 512) {
vsb_printf(vl->vsb, "...");
vsb_printf(vl->vsb, "...");
break;
}
if (nl) {
......
......@@ -81,7 +81,7 @@ struct varnish {
int vcl_nbr;
char *workdir;
struct VSL_data *vd;
struct VSL_data *vd;
};
static VTAILQ_HEAD(, varnish) varnishes =
......@@ -645,7 +645,7 @@ varnish_expect(const struct varnish *v, char * const *av) {
char *p;
int i;
struct stat_priv sp;
good = -1;
sp.target = av[0];
......
......@@ -91,8 +91,8 @@ struct shmloghead {
* whenever writing the log starts from the front.
*
* Each logrecord consist of:
* [n] = ((type & 0xff) << 24) | (length & 0xffff)
* [n + 1] = identifier
* [n] = ((type & 0xff) << 24) | (length & 0xffff)
* [n + 1] = identifier
* [n + 2] ... [m] = content
*/
......
......@@ -56,9 +56,9 @@ void vmb_pthread(void);
#elif defined(__arm__)
#define VMB()
#define VWMB()
#define VRMB()
#define VMB()
#define VWMB()
#define VRMB()
#elif defined(__i386__) && defined(__GNUC__)
......
......@@ -104,7 +104,7 @@ VSL_Delete(struct VSL_data *vd)
free(vd->fname);
while(!VTAILQ_EMPTY(&vd->sf_list)) {
sf = VTAILQ_FIRST(&vd->sf_list);
sf = VTAILQ_FIRST(&vd->sf_list);
VTAILQ_REMOVE(&vd->sf_list, sf, next);
free(sf->class);
free(sf->ident);
......@@ -175,7 +175,7 @@ vsl_open(struct VSL_data *vd, int rep)
int
VSL_Open(struct VSL_data *vd)
{
return (vsl_open(vd, 1));
}
......@@ -261,7 +261,7 @@ vsl_find_alloc(const struct VSL_data *vd, const char *class, const char *type, c
assert (vd->vsl_lh != NULL);
VSL_FOREACH(sha, vd) {
CHECK_OBJ_NOTNULL(sha, SHMALLOC_MAGIC);
if (strcmp(sha->class, class))
if (strcmp(sha->class, class))
continue;
if (type != NULL && strcmp(sha->type, type))
continue;
......
......@@ -55,7 +55,7 @@ struct VSL_data {
struct stat fstat;
int vsl_fd;
struct shmloghead *vsl_lh;
struct shmloghead *vsl_lh;
void *vsl_end;
unsigned alloc_seq;
......
......@@ -127,7 +127,6 @@ vsl_nextlog(struct VSL_data *vd, uint32_t **pp)
continue;
}
/* XXX: check log_start[0] */
if (vd->flags & F_NON_BLOCKING)
return (-1);
......
......@@ -65,7 +65,7 @@ VSL_OpenStats(struct VSL_data *vd)
* -1 -> unknown stats encountered.
*/
static inline int
static inline int
iter_test(const char *s1, const char *s2, int wc)
{
......
......@@ -381,10 +381,10 @@ vcltypes = {
'HDR_OBJ': "const char *",
'HDR_REQ': "const char *",
'HDR_BEREQ': "const char *",
'HOSTNAME': "const char *",
'PORTNAME': "const char *",
'HASH': "const char *",
'SET': "struct vrt_backend_entry *",
'HOSTNAME': "const char *",
'PORTNAME': "const char *",
'HASH': "const char *",
'SET': "struct vrt_backend_entry *",
}
#######################################################################
......@@ -443,9 +443,11 @@ vcl_fixed_token(const char *p, const char **q)
l = len(j)
while (k < l):
fo.write("p[%d] == '%s'" % (k, j[k]))
fo.write(" && ")
fo.write(" &&")
if (k % 3) == 0:
fo.write("\n\t\t ")
else:
fo.write(" ")
k += 1
fo.write("!isvar(p[%d])) {\n" % l)
fo.write("\t\t\t*q = p + %d;\n" % l)
......
......@@ -68,25 +68,25 @@ vcl_fixed_token(const char *p, const char **q)
M2('>', T_SHR);
M1();
case 'e':
if (p[1] == 'l' && p[2] == 's' && p[3] == 'e' &&
if (p[1] == 'l' && p[2] == 's' && p[3] == 'e' &&
p[4] == 'i' && p[5] == 'f' && !isvar(p[6])) {
*q = p + 6;
return (T_ELSEIF);
}
if (p[1] == 'l' && p[2] == 's' && p[3] == 'i' &&
if (p[1] == 'l' && p[2] == 's' && p[3] == 'i' &&
p[4] == 'f' && !isvar(p[5])) {
*q = p + 5;
return (T_ELSIF);
}
if (p[1] == 'l' && p[2] == 's' && p[3] == 'e' &&
if (p[1] == 'l' && p[2] == 's' && p[3] == 'e' &&
!isvar(p[4])) {
*q = p + 4;
return (T_ELSE);
}
return (0);
case 'i':
if (p[1] == 'n' && p[2] == 'c' && p[3] == 'l' &&
p[4] == 'u' && p[5] == 'd' && p[6] == 'e' &&
if (p[1] == 'n' && p[2] == 'c' && p[3] == 'l' &&
p[4] == 'u' && p[5] == 'd' && p[6] == 'e' &&
!isvar(p[7])) {
*q = p + 7;
return (T_INCLUDE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment