[Spice-devel] [spice-common 6/7] build: Remove bitops.h
Frediano Ziglio
fziglio at redhat.com
Tue Jun 5 08:36:56 UTC 2018
>
> Nothing uses it since the GL backend was removed in 384698a
> ---
> common/Makefile.am | 1 -
> common/bitops.h | 87 ----------------------------------------------
> common/meson.build | 1 -
> common/quic.c | 1 -
> configure.ac | 2 +-
> 5 files changed, 1 insertion(+), 91 deletions(-)
> delete mode 100644 common/bitops.h
>
> diff --git a/common/Makefile.am b/common/Makefile.am
> index defcb35..dd37b80 100644
> --- a/common/Makefile.am
> +++ b/common/Makefile.am
> @@ -21,7 +21,6 @@ noinst_LTLIBRARIES = libspice-common.la
> libspice-common-server.la libspice-commo
> libspice_common_la_SOURCES = \
> backtrace.c \
> backtrace.h \
> - bitops.h \
> canvas_utils.c \
> canvas_utils.h \
> client_demarshallers.h \
> diff --git a/common/bitops.h b/common/bitops.h
> deleted file mode 100644
> index eb294fe..0000000
> --- a/common/bitops.h
> +++ /dev/null
> @@ -1,87 +0,0 @@
> -/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
> -/*
> - Copyright (C) 2009 Red Hat, Inc.
> -
> - This library is free software; you can redistribute it and/or
> - modify it under the terms of the GNU Lesser General Public
> - License as published by the Free Software Foundation; either
> - version 2.1 of the License, or (at your option) any later version.
> -
> - This library is distributed in the hope that it will be useful,
> - but WITHOUT ANY WARRANTY; without even the implied warranty of
> - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> - Lesser General Public License for more details.
> -
> - You should have received a copy of the GNU Lesser General Public
> - License along with this library; if not, write to the Free Software
> -
> - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
> USA
> -*/
> -
> -#ifndef BITOPS_H
> -#define BITOPS_H
> -
> -#include <spice/macros.h>
> -
> -SPICE_BEGIN_DECLS
> -
> -#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
> -static inline int spice_bit_find_msb(unsigned int val)
> -{
> - int ret;
> -
> - asm ("bsrl %1,%0\n\t"
> - "jnz 1f\n\t"
> - "movl $-1,%0\n"
> - "1:"
> - : "=r"(ret) : "r"(val));
> - return ret + 1;
> -}
> -
> -#elif defined(WIN32) && !defined(_WIN64)
> -static inline int spice_bit_find_msb(uint32_t val)
> -{
> - uint32_t r;
> - __asm {
> - bsr eax, val
> - jnz found
> - mov eax, -1
> -
> -found:
> - mov r, eax
> - }
> - return r + 1;
> -}
> -
> -#else
> -static inline int spice_bit_find_msb(unsigned int val)
> -{
> - signed char index = 31;
> -
> - if(val == 0) {
> - return 0;
> - }
> -
> - do {
> - if(val & 0x80000000) {
> - break;
> - }
> - val <<= 1;
> - } while(--index >= 0);
> -
> - return index+1;
> -}
> -
> -#endif
> -
> -static inline int spice_bit_next_pow2(unsigned int val)
> -{
> - if ((val & (val - 1)) == 0) {
> - return val;
> - }
> - return 1 << spice_bit_find_msb(val);
> -}
> -
> -SPICE_END_DECLS
> -
> -#endif
> diff --git a/common/meson.build b/common/meson.build
> index 9d46899..22dcbb8 100644
> --- a/common/meson.build
> +++ b/common/meson.build
> @@ -4,7 +4,6 @@
> spice_common_sources = [
> 'backtrace.c',
> 'backtrace.h',
> - 'bitops.h',
> 'canvas_utils.c',
> 'canvas_utils.h',
> 'draw.h',
> diff --git a/common/quic.c b/common/quic.c
> index 1ec6baa..3843ba2 100644
> --- a/common/quic.c
> +++ b/common/quic.c
> @@ -27,7 +27,6 @@
>
> #include "quic.h"
> #include "spice_common.h"
> -#include "bitops.h"
>
> /* ASCII "QUIC" */
> #define QUIC_MAGIC 0x43495551
> diff --git a/configure.ac b/configure.ac
> index 4653694..6e1f5a8 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -4,7 +4,7 @@ AC_INIT([spice-common],
> [noversion],
> [spice-devel at lists.freedesktop.org])
>
> -AC_CONFIG_SRCDIR([common/bitops.h])
> +AC_CONFIG_SRCDIR([common/log.h])
> AC_CONFIG_MACRO_DIR([m4])
> AM_CONFIG_HEADER([config.h])
> AC_CONFIG_AUX_DIR([build-aux])
Acked-by: Frediano Ziglio <fziglio at redhat.com>
Frediano
More information about the Spice-devel
mailing list