]> sigrok.org Git - libsigrok.git/commit - src/strutil.c
strutil: introduce power-of-two calculation routine
authorGerhard Sittig <redacted>
Tue, 17 Oct 2023 19:20:56 +0000 (21:20 +0200)
committerGerhard Sittig <redacted>
Wed, 18 Oct 2023 19:35:13 +0000 (21:35 +0200)
commita2f3645bcf73a421192591fc7d2d030f9997fda7
tree3733b86151a42b4416bccb6e16faa4ddaf0ee66b
parent4856d33ba4d0cdc28d7d28c1e577494e48d7b38b
strutil: introduce power-of-two calculation routine

Introduce the sr_next_power_of_two() routine which determines how many
bits are required to store a value. Decorate it as SR_API because some
applications may want it, but more importantly to make it available to
the test suite.
include/libsigrok/proto.h
src/strutil.c