Skip to content

Commit

Permalink
tree-wide: apply v_counted_by_(field)
Browse files Browse the repository at this point in the history
Signed-off-by: Asad Sajjad Ahmed <[email protected]>
  • Loading branch information
asadsa92 committed Jan 15, 2024
1 parent 5d34373 commit 159dc96
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bin/varnishd/hpack/vhp_gen_hufdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct tbl {
unsigned idx;
unsigned lvl;
unsigned p_idx;
struct cod e[];
struct cod e[] v_counted_by_(n);
};

static struct tbl *
Expand Down
3 changes: 2 additions & 1 deletion bin/varnishd/http2/cache_http2.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ struct h2_rxbuf {
uint64_t tail;
uint64_t head;
struct stv_buffer *stvbuf;
uint8_t data[];
uint8_t data[]
v_counted_by_(size - PRNDUP(sizeof(struct stv_buffer)));
};

struct h2_req {
Expand Down
2 changes: 1 addition & 1 deletion bin/varnishd/proxy/cache_proxy_proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct vpx_tlv {
unsigned magic;
#define VPX_TLV_MAGIC 0xdeb9a4a5
unsigned len;
char tlv[];
char tlv[] v_counted_by_(len);
};

static inline int
Expand Down
2 changes: 1 addition & 1 deletion include/vsl_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ struct VSL_head {
ssize_t segsize;
unsigned segment_n;
ssize_t offset[VSL_SEGMENTS];
uint32_t log[];
uint32_t log[] v_counted_by_(segment_n);
};
3 changes: 2 additions & 1 deletion lib/libvarnish/vte.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ struct vte {
int f_sz; /* input field size */
int f_cnt; /* actual number of fields */
int f_maxcnt; /* maximum number of fields */
int f_maxsz[]; /* maximum size per field */
int f_maxsz[]
v_counted_by_(f_cnt); /* maximum size per field */
};

struct vte *
Expand Down

0 comments on commit 159dc96

Please sign in to comment.