Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
8b67e5bb
Unverified
Commit
8b67e5bb
authored
Jul 11, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coccinelle: patch v{min,max}_t -> v{min,max}
parent
b76e25bd
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
6 deletions
+22
-6
cache_shmlog.c
bin/varnishd/cache/cache_shmlog.c
+1
-1
cache_http2_send.c
bin/varnishd/http2/cache_http2_send.c
+1
-1
stevedore_utils.c
bin/varnishd/storage/stevedore_utils.c
+1
-1
vcc_acl.c
lib/libvcc/vcc_acl.c
+1
-1
vminmax.cocci
tools/coccinelle/vminmax.cocci
+16
-0
vmod_directors_shard_cfg.c
vmod/vmod_directors_shard_cfg.c
+2
-2
No files found.
bin/varnishd/cache/cache_shmlog.c
View file @
8b67e5bb
...
@@ -304,7 +304,7 @@ VSLv(enum VSL_tag_e tag, vxid_t vxid, const char *fmt, va_list ap)
...
@@ -304,7 +304,7 @@ VSLv(enum VSL_tag_e tag, vxid_t vxid, const char *fmt, va_list ap)
vslr
(
tag
,
vxid
,
fmt
,
strlen
(
fmt
)
+
1
);
vslr
(
tag
,
vxid
,
fmt
,
strlen
(
fmt
)
+
1
);
}
else
{
}
else
{
n
=
vsnprintf
(
buf
,
mlen
,
fmt
,
ap
);
n
=
vsnprintf
(
buf
,
mlen
,
fmt
,
ap
);
n
=
vmin
_t
(
unsigned
,
n
,
mlen
-
1
);
n
=
vmin
(
n
,
mlen
-
1
);
buf
[
n
++
]
=
'\0'
;
/* NUL-terminated */
buf
[
n
++
]
=
'\0'
;
/* NUL-terminated */
vslr
(
tag
,
vxid
,
buf
,
n
);
vslr
(
tag
,
vxid
,
buf
,
n
);
}
}
...
...
bin/varnishd/http2/cache_http2_send.c
View file @
8b67e5bb
...
@@ -272,7 +272,7 @@ h2_do_window(struct worker *wrk, struct h2_req *r2,
...
@@ -272,7 +272,7 @@ h2_do_window(struct worker *wrk, struct h2_req *r2,
(
void
)
h2_cond_wait
(
h2
->
winupd_cond
,
h2
,
r2
);
(
void
)
h2_cond_wait
(
h2
->
winupd_cond
,
h2
,
r2
);
if
(
h2_errcheck
(
r2
,
h2
)
==
0
)
{
if
(
h2_errcheck
(
r2
,
h2
)
==
0
)
{
w
=
vmin
_t
(
int64_t
,
h2_win_limit
(
r2
,
h2
),
wanted
);
w
=
vmin
(
h2_win_limit
(
r2
,
h2
),
wanted
);
h2_win_charge
(
r2
,
h2
,
w
);
h2_win_charge
(
r2
,
h2
,
w
);
assert
(
w
>
0
);
assert
(
w
>
0
);
}
}
...
...
bin/varnishd/storage/stevedore_utils.c
View file @
8b67e5bb
...
@@ -157,7 +157,7 @@ STV_FileSize(int fd, const char *size, unsigned *granularity, const char *ctx)
...
@@ -157,7 +157,7 @@ STV_FileSize(int fd, const char *size, unsigned *granularity, const char *ctx)
AZ
(
VFIL_fsinfo
(
fd
,
&
bs
,
&
fssize
,
NULL
));
AZ
(
VFIL_fsinfo
(
fd
,
&
bs
,
&
fssize
,
NULL
));
/* Increase granularity if it is lower than the filesystem block size */
/* Increase granularity if it is lower than the filesystem block size */
*
granularity
=
vmax
_t
(
unsigned
,
*
granularity
,
bs
);
*
granularity
=
vmax
(
*
granularity
,
bs
);
if
((
size
==
NULL
||
*
size
==
'\0'
)
&&
st
.
st_size
!=
0
)
{
if
((
size
==
NULL
||
*
size
==
'\0'
)
&&
st
.
st_size
!=
0
)
{
/*
/*
...
...
lib/libvcc/vcc_acl.c
View file @
8b67e5bb
...
@@ -105,7 +105,7 @@ vcl_acl_cmp(const struct acl_e *ae1, const struct acl_e *ae2)
...
@@ -105,7 +105,7 @@ vcl_acl_cmp(const struct acl_e *ae1, const struct acl_e *ae2)
p1
=
ae1
->
data
;
p1
=
ae1
->
data
;
p2
=
ae2
->
data
;
p2
=
ae2
->
data
;
m
=
vmin
_t
(
unsigned
,
ae1
->
mask
,
ae2
->
mask
);
m
=
vmin
(
ae1
->
mask
,
ae2
->
mask
);
for
(;
m
>=
8
;
m
-=
8
)
{
for
(;
m
>=
8
;
m
-=
8
)
{
CMP
(
*
p1
,
*
p2
);
CMP
(
*
p1
,
*
p2
);
p1
++
;
p1
++
;
...
...
tools/coccinelle/vminmax.cocci
0 → 100644
View file @
8b67e5bb
/*
* This patch refactors v{min,max}_t to v{min,max} where types agree
*
* Note: Has false positives on pointer types, tolerated for clarity
*/
using "varnish.iso"
@@ type T; T e1, e2; @@
- vmin_t(T, e1, e2)
+ vmin(e1, e2)
@@ type T; T e1, e2; @@
- vmax_t(T, e1, e2)
+ vmax(e1, e2)
vmod/vmod_directors_shard_cfg.c
View file @
8b67e5bb
...
@@ -275,7 +275,7 @@ shardcfg_hashcircle(struct sharddir *shardd)
...
@@ -275,7 +275,7 @@ shardcfg_hashcircle(struct sharddir *shardd)
rmax
=
(
UINT32_MAX
-
1
)
/
shardd
->
n_backend
;
rmax
=
(
UINT32_MAX
-
1
)
/
shardd
->
n_backend
;
for
(
b
=
backends
;
b
<
backends
+
shardd
->
n_backend
;
b
++
)
{
for
(
b
=
backends
;
b
<
backends
+
shardd
->
n_backend
;
b
++
)
{
CHECK_OBJ_NOTNULL
(
b
->
backend
,
DIRECTOR_MAGIC
);
CHECK_OBJ_NOTNULL
(
b
->
backend
,
DIRECTOR_MAGIC
);
n_points
+=
vmin
_t
(
uint32_t
,
b
->
replicas
,
rmax
);
n_points
+=
vmin
(
b
->
replicas
,
rmax
);
}
}
assert
(
n_points
<
UINT32_MAX
);
assert
(
n_points
<
UINT32_MAX
);
...
@@ -291,7 +291,7 @@ shardcfg_hashcircle(struct sharddir *shardd)
...
@@ -291,7 +291,7 @@ shardcfg_hashcircle(struct sharddir *shardd)
AN
(
ident
);
AN
(
ident
);
assert
(
ident
[
0
]
!=
'\0'
);
assert
(
ident
[
0
]
!=
'\0'
);
r
=
vmin
_t
(
uint32_t
,
b
->
replicas
,
rmax
);
r
=
vmin
(
b
->
replicas
,
rmax
);
for
(
j
=
0
;
j
<
r
;
j
++
)
{
for
(
j
=
0
;
j
<
r
;
j
++
)
{
assert
(
snprintf
(
s
,
len
,
"%d"
,
j
)
<
len
);
assert
(
snprintf
(
s
,
len
,
"%d"
,
j
)
<
len
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment