[Spice-devel] [PATCH 05/10] server: move bit set/clear utilities out of red_worker.h

Yonit Halperin yhalperi at redhat.com
Mon Aug 12 06:08:36 PDT 2013


Hi,

You forgot to add spice_server_utils.h :)

Yonit.
On 08/12/2013 08:49 AM, Alon Levy wrote:
> ---
>   server/Makefile.am      |  1 +
>   server/red_dispatcher.c |  4 +++-
>   server/red_worker.c     |  1 +
>   server/red_worker.h     | 18 ------------------
>   4 files changed, 5 insertions(+), 19 deletions(-)
>
> diff --git a/server/Makefile.am b/server/Makefile.am
> index e5392ba..feee2f1 100644
> --- a/server/Makefile.am
> +++ b/server/Makefile.am
> @@ -99,6 +99,7 @@ libspice_server_la_SOURCES =			\
>   	zlib_encoder.h				\
>   	spice_bitmap_utils.h		\
>   	spice_bitmap_utils.c		\
> +	spice_server_utils.h		\
>   	$(NULL)
>
>   if SUPPORT_TUNNEL
> diff --git a/server/red_dispatcher.c b/server/red_dispatcher.c
> index ef47c28..03a4c4a 100644
> --- a/server/red_dispatcher.c
> +++ b/server/red_dispatcher.c
> @@ -39,8 +39,10 @@
>   #endif // USE_OPENGL
>   #include "reds.h"
>   #include "dispatcher.h"
> -#include "red_dispatcher.h"
>   #include "red_parse_qxl.h"
> +#include "spice_server_utils.h"
> +
> +#include "red_dispatcher.h"
>
>   static int num_active_workers = 0;
>
> diff --git a/server/red_worker.c b/server/red_worker.c
> index 0704279..3b9c5b0 100644
> --- a/server/red_worker.c
> +++ b/server/red_worker.c
> @@ -82,6 +82,7 @@
>   #include "migration_protocol.h"
>   #include "spice_timer_queue.h"
>   #include "main_dispatcher.h"
> +#include "spice_server_utils.h"
>
>   //#define COMPRESS_STAT
>   //#define DUMP_BITMAP
> diff --git a/server/red_worker.h b/server/red_worker.h
> index 796b090..272661f 100644
> --- a/server/red_worker.h
> +++ b/server/red_worker.h
> @@ -22,24 +22,6 @@
>   #include <errno.h>
>   #include "red_common.h"
>
> -
> -static inline void set_bit(int index, uint32_t *addr)
> -{
> -    uint32_t mask = 1 << index;
> -    __sync_or_and_fetch(addr, mask);
> -}
> -
> -static inline void clear_bit(int index, uint32_t *addr)
> -{
> -    uint32_t mask = ~(1 << index);
> -    __sync_and_and_fetch(addr, mask);
> -}
> -
> -static inline int test_bit(int index, uint32_t val)
> -{
> -    return val & (1u << index);
> -}
> -
>   enum {
>       RED_WORKER_PENDING_WAKEUP,
>       RED_WORKER_PENDING_OOM,
>



More information about the Spice-devel mailing list