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
f61dde46
Unverified
Commit
f61dde46
authored
Oct 27, 2020
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vcc: Pass literal VCL_STRANDS arguments
avoiding local variables and VPI_BundleStrands() Fixes #3392
parent
b6325269
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
33 deletions
+5
-33
cache_vrt.c
bin/varnishd/cache/cache_vrt.c
+0
-21
vcc_interface.h
include/vcc_interface.h
+0
-3
vcc_expr.c
lib/libvcc/vcc_expr.c
+5
-9
No files found.
bin/varnishd/cache/cache_vrt.c
View file @
f61dde46
...
...
@@ -222,27 +222,6 @@ VRT_AllocStrandsWS(struct ws *ws, int n)
return
(
s
);
}
/*--------------------------------------------------------------------
* Build STRANDS from what is essentially a STRING_LIST
*/
VCL_STRANDS
VPI_BundleStrands
(
int
n
,
struct
strands
*
s
,
char
const
**
d
,
const
char
*
f
,
...)
{
va_list
ap
;
assert
(
n
>
0
);
s
->
n
=
n
;
s
->
p
=
d
;
*
d
++
=
f
;
va_start
(
ap
,
f
);
while
(
--
n
)
*
d
++
=
va_arg
(
ap
,
const
char
*
);
assert
(
va_arg
(
ap
,
const
char
*
)
==
vrt_magic_string_end
);
va_end
(
ap
);
return
(
s
);
}
/*--------------------------------------------------------------------
* Compare two STRANDS
*/
...
...
include/vcc_interface.h
View file @
f61dde46
...
...
@@ -71,6 +71,3 @@ struct vpi_ii {
const
void
*
p
;
const
char
*
const
name
;
};
VCL_STRANDS
VPI_BundleStrands
(
int
,
struct
strands
*
,
char
const
**
,
const
char
*
f
,
...);
lib/libvcc/vcc_expr.c
View file @
f61dde46
...
...
@@ -153,6 +153,8 @@ vcc_expr_edit(struct vcc *tl, vcc_type_t fmt, const char *p, struct expr *e1,
struct
expr
*
e
,
*
e3
;
int
nl
=
1
;
(
void
)
tl
;
AN
(
e1
);
e
=
vcc_new_expr
(
fmt
);
while
(
*
p
!=
'\0'
)
{
...
...
@@ -184,16 +186,10 @@ vcc_expr_edit(struct vcc *tl, vcc_type_t fmt, const char *p, struct expr *e1,
case
't'
:
e3
=
(
*
p
==
'T'
?
e1
:
e2
);
AN
(
e3
);
VSB_printf
(
tl
->
curproc
->
prologue
,
" struct strands strs_%u_a;
\n
"
" const char * strs_%u_s[%d];
\n
"
,
tl
->
unique
,
tl
->
unique
,
e3
->
nstr
);
VSB_printf
(
e
->
vsb
,
"VPI_BundleStrands(%d, &strs_%u_a, strs_%u_s,"
"
\v
+
\n
%s,
\n
vrt_magic_string_end
\v
-
\n
)"
,
e3
->
nstr
,
tl
->
unique
,
tl
->
unique
,
VSB_data
(
e3
->
vsb
));
tl
->
unique
++
;
"&(struct strands){.n = %d, .p = "
"(const char *[%d]){
\n
%s
\n
}}"
,
e3
->
nstr
,
e3
->
nstr
,
VSB_data
(
e3
->
vsb
));
break
;
case
'1'
:
VSB_cat
(
e
->
vsb
,
VSB_data
(
e1
->
vsb
));
...
...
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