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
7d8e4a4f
Unverified
Commit
7d8e4a4f
authored
Feb 17, 2021
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor SYMTAB_*
suggested by phk
parent
3c68fa77
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
9 deletions
+28
-9
vcc_compile.h
lib/libvcc/vcc_compile.h
+5
-1
vcc_symb.c
lib/libvcc/vcc_symb.c
+23
-8
No files found.
lib/libvcc/vcc_compile.h
View file @
7d8e4a4f
...
...
@@ -382,7 +382,11 @@ extern const struct symxref XREF_NONE[1];
extern
const
struct
symxref
XREF_DEF
[
1
];
extern
const
struct
symxref
XREF_REF
[
1
];
struct
symmode
{
const
char
*
name
;
};
struct
symmode
{
const
char
*
name
;
unsigned
noerr
;
unsigned
partial
;
};
extern
const
struct
symmode
SYMTAB_NOERR
[
1
];
extern
const
struct
symmode
SYMTAB_CREATE
[
1
];
extern
const
struct
symmode
SYMTAB_EXISTING
[
1
];
...
...
lib/libvcc/vcc_symb.c
View file @
7d8e4a4f
...
...
@@ -250,11 +250,26 @@ vcc_sym_in_tab(struct vcc *tl, struct symtab *st,
const
struct
symxref
XREF_NONE
[
1
]
=
{{
"xref_none"
}};
const
struct
symxref
XREF_DEF
[
1
]
=
{{
"xref_def"
}};
const
struct
symxref
XREF_REF
[
1
]
=
{{
"xref_ref"
}};
const
struct
symmode
SYMTAB_NOERR
[
1
]
=
{{
"sym_noerror"
}};
const
struct
symmode
SYMTAB_CREATE
[
1
]
=
{{
"sym_create"
}};
const
struct
symmode
SYMTAB_EXISTING
[
1
]
=
{{
"Symbol not found"
}};
const
struct
symmode
SYMTAB_PARTIAL
[
1
]
=
{{
"Symbol not found"
}};
const
struct
symmode
SYMTAB_PARTIAL_NOERR
[
1
]
=
{{
"Symbol not found"
}};
const
struct
symmode
SYMTAB_NOERR
[
1
]
=
{{
.
name
=
"sym_noerror"
,
.
noerr
=
1
}};
const
struct
symmode
SYMTAB_CREATE
[
1
]
=
{{
.
name
=
"sym_create"
}};
const
struct
symmode
SYMTAB_EXISTING
[
1
]
=
{{
.
name
=
"Symbol not found"
}};
const
struct
symmode
SYMTAB_PARTIAL
[
1
]
=
{{
.
name
=
"Symbol not found"
,
.
partial
=
1
}};
const
struct
symmode
SYMTAB_PARTIAL_NOERR
[
1
]
=
{{
.
name
=
"Symbol not found"
,
.
partial
=
1
,
.
noerr
=
1
}};
struct
symbol
*
VCC_SymbolGet
(
struct
vcc
*
tl
,
vcc_ns_t
ns
,
vcc_kind_t
kind
,
...
...
@@ -300,15 +315,15 @@ VCC_SymbolGet(struct vcc *tl, vcc_ns_t ns, vcc_kind_t kind,
break
;
tn
=
tn1
;
}
if
(
sym
!=
NULL
&&
sym
->
kind
==
SYM_VMOD
&&
e
==
SYMTAB_PARTIAL
)
if
(
sym
!=
NULL
&&
sym
->
kind
==
SYM_VMOD
&&
e
->
partial
)
e
=
SYMTAB_EXISTING
;
if
(
sym
!=
NULL
&&
(
e
==
SYMTAB_PARTIAL
||
e
==
SYMTAB_PARTIAL_NOERR
)
)
{
if
(
sym
!=
NULL
&&
e
->
partial
)
{
st
=
st2
;
tn
=
tn2
;
}
else
if
(
st
!=
st2
)
{
sym
=
NULL
;
}
if
(
sym
==
NULL
&&
(
e
==
SYMTAB_NOERR
||
e
==
SYMTAB_PARTIAL_NOERR
)
)
if
(
sym
==
NULL
&&
e
->
noerr
)
return
(
sym
);
AN
(
st
);
AN
(
tn
);
...
...
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