Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define the iterator in the for scope #190

Merged
merged 3 commits into from
May 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions GPL/Events/EbpfEventProto.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,11 @@ enum ebpf_varlen_field_type {

// Convenience macro to iterate all the variable length fields in an event
#define FOR_EACH_VARLEN_FIELD(vl_fields_start, cursor) \
uint32_t __i = 0; \
cursor = (struct ebpf_varlen_field *)vl_fields_start.data; \
for (; __i < vl_fields_start.nfields; \
cursor = (struct ebpf_varlen_field *)((char *)cursor + cursor->size + \
sizeof(struct ebpf_varlen_field)), \
__i++)
cursor = (struct ebpf_varlen_field *)vl_fields_start.data; \
for (uint32_t __i = 0; __i < vl_fields_start.nfields; \
cursor = (struct ebpf_varlen_field *)((char *)cursor + cursor->size + \
sizeof(struct ebpf_varlen_field)), \
__i++)

struct ebpf_varlen_fields_start {
uint32_t nfields;
Expand Down
Loading