]> sigrok.org Git - libsigrok.git/commit - src/libsigrok-internal.h
binary helpers: add "invalid" enum item, improve readability
authorGerhard Sittig <redacted>
Wed, 22 Dec 2021 12:45:22 +0000 (13:45 +0100)
committerGerhard Sittig <redacted>
Wed, 22 Dec 2021 19:04:28 +0000 (20:04 +0100)
commitd65f51bf5c549e5dbacb5c6fb6636e482ff02da8
treee470c2588f13c46619aa8828df24f60c1b4d71c2
parentc5dd6c4f0a5af1fc3bf0bf2f8b473af3f2f3c33f
binary helpers: add "invalid" enum item, improve readability

The "binary value" helpers would not follow the sigrok project's style
of only using non-zero values for valid enum items (a zero value is
assumed to always represent something "inactive" or "invalid").

Introduce the "invalid" item in the enum declaration to fixup the style
issue. Rephrase the bv_get_value() routine's length specs to improve
readability, match numbers in length specs to the numbers in conversion
routine references.
src/binary_helpers.c
src/libsigrok-internal.h