Displaying 4 results from an estimated 4 matches for "nbdkit_ispowerof2_h".
2018 Aug 01
2
Re: [PATCH v2 nbdkit 4/6] common: Add a directory for common code shared by plugins and filters.
...HOWEVER CAUSED AND
> + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
> + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
> + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> + * SUCH DAMAGE.
> + */
> +
> +#ifndef NBDKIT_ISPOWEROF2_H
> +#define NBDKIT_ISPOWEROF2_H
> +
> +#include <stdbool.h>
> +
> +/* Returns true if v is a power of 2.
> + *
> + * Uses the algorithm described at
> + *
> http://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2
> + */
> +static inline bool
>...
2018 Aug 01
0
[PATCH v2 nbdkit 4/6] common: Add a directory for common code shared by plugins and filters.
...PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef NBDKIT_ISPOWEROF2_H
+#define NBDKIT_ISPOWEROF2_H
+
+#include <stdbool.h>
+
+/* Returns true if v is a power of 2.
+ *
+ * Uses the algorithm described at
+ * http://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2
+ */
+static inline bool
+is_power_of_2 (unsigned long v)
+{
+ return v &&...
2018 Aug 01
0
Re: [PATCH v2 nbdkit 4/6] common: Add a directory for common code shared by plugins and filters.
...ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
> > + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
> > + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> > + * SUCH DAMAGE.
> > + */
> > +
> > +#ifndef NBDKIT_ISPOWEROF2_H
> > +#define NBDKIT_ISPOWEROF2_H
> > +
> > +#include <stdbool.h>
> > +
> > +/* Returns true if v is a power of 2.
> > + *
> > + * Uses the algorithm described at
> > + *
> > http://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPo...
2018 Aug 01
12
[PATCH v2 nbdkit 0/6] Add truncate filter and other fixes.
I have dropped the map filter from this series for now while I try to
get it working.
However I think the truncate filter is in a good shape. This
incorporates all feedback from Eric's review.
Also there are three small fixes to the filter code, all revealed when
I was testing using multiple filters which we'd not done much of
before.
Rich.