=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Move wined3d_bit_scan() to public header.

Alexandre Julliard julliard at winehq.org
Fri Jan 25 16:29:07 CST 2019


Module: wine
Branch: master
Commit: b51bc84338455dca41c6704e3fee4cbda6b440e7
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=b51bc84338455dca41c6704e3fee4cbda6b440e7

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Fri Jan 25 09:46:52 2019 +0100

wined3d: Move wined3d_bit_scan() to public header.

wine/port.h is required for ffs().

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d8/buffer.c             |  1 +
 dlls/d3d8/d3d8_main.c          |  1 +
 dlls/d3d8/directx.c            |  1 +
 dlls/d3d8/shader.c             |  1 +
 dlls/d3d8/surface.c            |  1 +
 dlls/d3d8/swapchain.c          |  1 +
 dlls/d3d8/texture.c            |  1 +
 dlls/d3d8/vertexdeclaration.c  |  6 +-----
 dlls/d3d8/volume.c             |  1 +
 dlls/d3d9/buffer.c             |  1 +
 dlls/d3d9/d3d9_main.c          |  1 +
 dlls/d3d9/directx.c            |  1 +
 dlls/d3d9/query.c              |  1 +
 dlls/d3d9/shader.c             |  1 +
 dlls/d3d9/stateblock.c         |  1 +
 dlls/d3d9/surface.c            |  1 +
 dlls/d3d9/swapchain.c          |  1 +
 dlls/d3d9/texture.c            |  1 +
 dlls/d3d9/vertexdeclaration.c  |  1 +
 dlls/d3d9/volume.c             |  1 +
 dlls/wined3d/wined3d_private.h |  7 -------
 include/wine/wined3d.h         | 11 +++++++++--
 22 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/dlls/d3d8/buffer.c b/dlls/d3d8/buffer.c
index 3b98000..0a6767b 100644
--- a/dlls/d3d8/buffer.c
+++ b/dlls/d3d8/buffer.c
@@ -17,6 +17,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 #include "d3d8_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3d8);
diff --git a/dlls/d3d8/d3d8_main.c b/dlls/d3d8/d3d8_main.c
index 92c5032..a6c6700 100644
--- a/dlls/d3d8/d3d8_main.c
+++ b/dlls/d3d8/d3d8_main.c
@@ -20,6 +20,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 #include "initguid.h"
 #include "d3d8_private.h"
 #include "wine/debug.h"
diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c
index d978827..09188cc 100644
--- a/dlls/d3d8/directx.c
+++ b/dlls/d3d8/directx.c
@@ -21,6 +21,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 
 #include <stdarg.h>
 
diff --git a/dlls/d3d8/shader.c b/dlls/d3d8/shader.c
index 2a4fbde..6c16633 100644
--- a/dlls/d3d8/shader.c
+++ b/dlls/d3d8/shader.c
@@ -18,6 +18,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 #include "d3d8_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3d8);
diff --git a/dlls/d3d8/surface.c b/dlls/d3d8/surface.c
index 7f90389..0d87937 100644
--- a/dlls/d3d8/surface.c
+++ b/dlls/d3d8/surface.c
@@ -19,6 +19,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 #include "d3d8_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3d8);
diff --git a/dlls/d3d8/swapchain.c b/dlls/d3d8/swapchain.c
index c9abfff..186e3cd 100644
--- a/dlls/d3d8/swapchain.c
+++ b/dlls/d3d8/swapchain.c
@@ -19,6 +19,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 #include "d3d8_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3d8);
diff --git a/dlls/d3d8/texture.c b/dlls/d3d8/texture.c
index ccbf60e..6f17e9d 100644
--- a/dlls/d3d8/texture.c
+++ b/dlls/d3d8/texture.c
@@ -17,6 +17,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 #include "d3d8_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3d8);
diff --git a/dlls/d3d8/vertexdeclaration.c b/dlls/d3d8/vertexdeclaration.c
index 0cae3cd..709e04b 100644
--- a/dlls/d3d8/vertexdeclaration.c
+++ b/dlls/d3d8/vertexdeclaration.c
@@ -1,6 +1,4 @@
 /*
- * IDirect3DVertexDeclaration8 implementation
- *
  * Copyright 2007 Henri Verbeet
  *
  * This library is free software; you can redistribute it and/or
@@ -18,10 +16,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-/* IDirect3DVertexDeclaration8 is internal to our implementation.
- * It's not visible in the API. */
-
 #include "config.h"
+#include "wine/port.h"
 #include "d3d8_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3d8);
diff --git a/dlls/d3d8/volume.c b/dlls/d3d8/volume.c
index 29eab6a..00dd78a 100644
--- a/dlls/d3d8/volume.c
+++ b/dlls/d3d8/volume.c
@@ -19,6 +19,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 #include "d3d8_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3d8);
diff --git a/dlls/d3d9/buffer.c b/dlls/d3d9/buffer.c
index 840d7e9..b6cd646 100644
--- a/dlls/d3d9/buffer.c
+++ b/dlls/d3d9/buffer.c
@@ -19,6 +19,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 #include "d3d9_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
diff --git a/dlls/d3d9/d3d9_main.c b/dlls/d3d9/d3d9_main.c
index c23fa54..bd0524b 100644
--- a/dlls/d3d9/d3d9_main.c
+++ b/dlls/d3d9/d3d9_main.c
@@ -22,6 +22,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 #include "initguid.h"
 #include "d3d9_private.h"
 
diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c
index 3f9c188..eab114d 100644
--- a/dlls/d3d9/directx.c
+++ b/dlls/d3d9/directx.c
@@ -20,6 +20,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 #include "d3d9_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
diff --git a/dlls/d3d9/query.c b/dlls/d3d9/query.c
index 12ff95b..49a8a12 100644
--- a/dlls/d3d9/query.c
+++ b/dlls/d3d9/query.c
@@ -21,6 +21,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 #include "d3d9_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
diff --git a/dlls/d3d9/shader.c b/dlls/d3d9/shader.c
index bc34738..5493508 100644
--- a/dlls/d3d9/shader.c
+++ b/dlls/d3d9/shader.c
@@ -18,6 +18,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 #include "d3d9_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
diff --git a/dlls/d3d9/stateblock.c b/dlls/d3d9/stateblock.c
index 6f39488..8431ef7 100644
--- a/dlls/d3d9/stateblock.c
+++ b/dlls/d3d9/stateblock.c
@@ -21,6 +21,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 #include "d3d9_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
diff --git a/dlls/d3d9/surface.c b/dlls/d3d9/surface.c
index 7d4d93b5e8..ded7dc4 100644
--- a/dlls/d3d9/surface.c
+++ b/dlls/d3d9/surface.c
@@ -20,6 +20,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 #include "d3d9_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
diff --git a/dlls/d3d9/swapchain.c b/dlls/d3d9/swapchain.c
index 00ead0f..46da32e 100644
--- a/dlls/d3d9/swapchain.c
+++ b/dlls/d3d9/swapchain.c
@@ -21,6 +21,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 #include "d3d9_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c
index c73cbc0..8dc1cee 100644
--- a/dlls/d3d9/texture.c
+++ b/dlls/d3d9/texture.c
@@ -19,6 +19,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 #include "d3d9_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
diff --git a/dlls/d3d9/vertexdeclaration.c b/dlls/d3d9/vertexdeclaration.c
index 5075309..b644525 100644
--- a/dlls/d3d9/vertexdeclaration.c
+++ b/dlls/d3d9/vertexdeclaration.c
@@ -20,6 +20,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 #include "d3d9_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
diff --git a/dlls/d3d9/volume.c b/dlls/d3d9/volume.c
index cb0485c..7bf1257 100644
--- a/dlls/d3d9/volume.c
+++ b/dlls/d3d9/volume.c
@@ -20,6 +20,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 #include "d3d9_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 0df3f2a..7b265f3 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -4582,13 +4582,6 @@ static inline BOOL is_rasterization_disabled(const struct wined3d_shader *geomet
             && geometry_shader->u.gs.so_desc.rasterizer_stream_idx == WINED3D_NO_RASTERIZER_STREAM;
 }
 
-static inline int wined3d_bit_scan(unsigned int *x)
-{
-    int bit_offset = ffs(*x) - 1;
-    *x ^= 1u << bit_offset;
-    return bit_offset;
-}
-
 static inline DWORD wined3d_extract_bits(const DWORD *bitstream,
         unsigned int offset, unsigned int count)
 {
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index b0b1abc..06f4f76 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -26,8 +26,8 @@
 #ifndef __WINE_WINED3D_H
 #define __WINE_WINED3D_H
 
-#ifndef __WINE_CONFIG_H
-# error You must include config.h to use this header
+#ifndef __WINE_WINE_PORT_H
+# error You must include wine/port.h to use this header
 #endif
 
 #include "wine/list.h"
@@ -2782,6 +2782,13 @@ static inline unsigned int wined3d_log2i(unsigned int x)
 #endif
 }
 
+static inline int wined3d_bit_scan(unsigned int *x)
+{
+    int bit_offset = ffs(*x) - 1;
+    *x ^= 1u << bit_offset;
+    return bit_offset;
+}
+
 static inline void wined3d_box_set(struct wined3d_box *box, unsigned int left, unsigned int top,
         unsigned int right, unsigned int bottom, unsigned int front, unsigned int back)
 {




More information about the wine-cvs mailing list