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
8bc28ccd
Unverified
Commit
8bc28ccd
authored
Feb 13, 2025
by
Dridi Boukelmoune
Committed by
Nils Goroll
Feb 13, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
miniobj: Extract SIZEOF_FLEX_OBJ() macro
committer edit: Updated Flexelint silencing Picked from #4271
parent
4fe462a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
flint.lnt
flint.lnt
+2
-2
miniobj.h
include/miniobj.h
+4
-2
No files found.
flint.lnt
View file @
8bc28ccd
...
...
@@ -283,8 +283,8 @@
-emacro(774, REPLACE)
// Flexelint does not understand offsetof(typeof(*ptr))
-emacro(10,
ALLOC
_FLEX_OBJ)
-emacro(40,
ALLOC
_FLEX_OBJ)
-emacro(10,
SIZEOF
_FLEX_OBJ)
-emacro(40,
SIZEOF
_FLEX_OBJ)
// It is ok to default after handling a few select SLT_* tags
...
...
include/miniobj.h
View file @
8bc28ccd
...
...
@@ -37,10 +37,12 @@
(to)->magic = (type_magic); \
} while (0)
#define SIZEOF_FLEX_OBJ(to, fld, len) \
(offsetof(typeof(*to), fld) + sizeof *(to)->fld * len)
#define ALLOC_FLEX_OBJ(to, fld, len, type_magic) \
do { \
(to) = calloc(1, offsetof(typeof(*to), fld) + \
sizeof *(to)->fld * len); \
(to) = calloc(1, SIZEOF_FLEX_OBJ(to, fld, len)); \
if ((to) != NULL) \
(to)->magic = (type_magic); \
} while (0)
...
...
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