Matteo Bruni : d3dcompiler: Move read_u32() to a new utils.h private header.

Alexandre Julliard julliard at winehq.org
Wed Feb 9 16:03:50 CST 2022


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

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Wed Feb  9 16:30:08 2022 +0100

d3dcompiler: Move read_u32() to a new utils.h private header.

To be able to use it from d3d10 via PARENTSRC.

Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3dcompiler_43/d3dcompiler_private.h | 10 +---------
 dlls/d3dcompiler_43/utils.h               | 33 +++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 9 deletions(-)

diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h
index 791c8d1cad2..08cdb515470 100644
--- a/dlls/d3dcompiler_43/d3dcompiler_private.h
+++ b/dlls/d3dcompiler_43/d3dcompiler_private.h
@@ -33,6 +33,7 @@
 #include "objbase.h"
 
 #include "d3dcompiler.h"
+#include "utils.h"
 
 #include <assert.h>
 #include <stdint.h>
@@ -568,15 +569,6 @@ HRESULT dxbc_parse(const char *data, SIZE_T data_size, struct dxbc *dxbc) DECLSP
 HRESULT dxbc_add_section(struct dxbc *dxbc, DWORD tag, const char *data, size_t data_size) DECLSPEC_HIDDEN;
 HRESULT dxbc_init(struct dxbc *dxbc, unsigned int size) DECLSPEC_HIDDEN;
 
-static inline uint32_t read_u32(const char **ptr)
-{
-    uint32_t r;
-
-    memcpy(&r, *ptr, sizeof(r));
-    *ptr += sizeof(r);
-    return r;
-}
-
 static inline void write_u32(char **ptr, uint32_t u32)
 {
     memcpy(*ptr, &u32, sizeof(u32));
diff --git a/dlls/d3dcompiler_43/utils.h b/dlls/d3dcompiler_43/utils.h
new file mode 100644
index 00000000000..fdb7f8e8db4
--- /dev/null
+++ b/dlls/d3dcompiler_43/utils.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2022 Matteo Bruni for CodeWeavers
+ *
+ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __WINE_UTILS_H
+#define __WINE_UTILS_H
+
+#include <stdint.h>
+
+static inline uint32_t read_u32(const char **ptr)
+{
+    uint32_t r;
+
+    memcpy(&r, *ptr, sizeof(r));
+    *ptr += sizeof(r);
+    return r;
+}
+
+#endif /* __WINE_UTILS_H */




More information about the wine-cvs mailing list