Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

Commit

Permalink
Whitespace cleanup
Browse files Browse the repository at this point in the history
git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4920 d4fa192b-c00b-0410-8231-f00ffab90ce4
  • Loading branch information
bsdphk committed Jun 7, 2010
1 parent 1c68336 commit a22e7cc
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 37 deletions.
2 changes: 1 addition & 1 deletion bin/varnishd/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion bin/varnishd/cache_shmlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions bin/varnishd/hash_critbit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions bin/varnishd/mgt_shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion bin/varnishd/mgt_vcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions bin/varnishstat/varnishstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ 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);
i += printf("%s", pt->name);
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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion bin/varnishstat/varnishstat_curses.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion bin/varnishtest/vtc_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions bin/varnishtest/vtc_varnish.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ struct varnish {
int vcl_nbr;
char *workdir;

struct VSL_data *vd;
struct VSL_data *vd;
};

static VTAILQ_HEAD(, varnish) varnishes =
Expand Down Expand Up @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions include/shmlog.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

Expand Down
6 changes: 3 additions & 3 deletions include/vmb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down
6 changes: 3 additions & 3 deletions lib/libvarnishapi/vsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -175,7 +175,7 @@ vsl_open(struct VSL_data *vd, int rep)
int
VSL_Open(struct VSL_data *vd)
{

return (vsl_open(vd, 1));
}

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/libvarnishapi/vsl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion lib/libvarnishapi/vsl_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/libvarnishapi/vsl_stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{

Expand Down
12 changes: 7 additions & 5 deletions lib/libvcl/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,10 @@
'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 *",
}

#######################################################################
Expand Down Expand Up @@ -443,9 +443,11 @@ def emit_vcl_fixed_token(fo, tokens):
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)
Expand Down
10 changes: 5 additions & 5 deletions lib/libvcl/vcc_fixed_token.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a22e7cc

Please sign in to comment.