Skip to content

Commit 34af3c4

Browse files
committed
pvv_is_int(): Be even more flexible
This patch further improves commit 6191f27, where the macro will now also work with code such as: (excerpt from pv_set_count()): ... pv_val.flags = PV_TYPE_INT; pv_val.ri = pv_name->pvp.pvi.u.ival-1; ... Notice how the flags are poorly set, since the PV_VAL_INT bit should have been used instead.
1 parent 96f12ac commit 34af3c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pvar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161

6262
/* @v: a (pv_value_t *) */
6363
#define pvv_is_int(v) \
64-
((v)->flags & PV_VAL_INT && \
64+
((v)->flags & (PV_VAL_INT|PV_TYPE_INT) && \
6565
((v)->flags & PV_TYPE_INT || !((v)->flags & PV_VAL_STR)))
6666
#define pvv_is_str(v) \
6767
((v)->flags & PV_VAL_STR && !((v)->flags & PV_TYPE_INT))

0 commit comments

Comments
 (0)