[Bf-blender-cvs] [71363dd79c4] master: Cleanup: Alembic, replace `ABC_INLINE` with `BLI_INLINE`

Sybren A. Stüvel noreply at git.blender.org
Fri Jun 19 17:11:23 CEST 2020


Commit: 71363dd79c49e0ebd656d5eb61ae5ccb62ece499
Author: Sybren A. Stüvel
Date:   Fri Jun 19 17:05:11 2020 +0200
Branches: master
https://developer.blender.org/rB71363dd79c49e0ebd656d5eb61ae5ccb62ece499

Cleanup: Alembic, replace `ABC_INLINE` with `BLI_INLINE`

The `ABC_INLINE` macro has been in the Alembic code since it was introduced
to Blender in rB61050f75b13e. It basically does the same a `BLI_INLINE`,
though, so there is no need to keep it around.

===================================================================

M	source/blender/io/alembic/intern/abc_axis_conversion.h
M	source/blender/io/alembic/intern/abc_reader_mesh.cc
M	source/blender/io/alembic/intern/abc_util.h
M	source/blender/io/alembic/intern/alembic_capi.cc

===================================================================

diff --git a/source/blender/io/alembic/intern/abc_axis_conversion.h b/source/blender/io/alembic/intern/abc_axis_conversion.h
index 734c5ca01c9..9a19e9116be 100644
--- a/source/blender/io/alembic/intern/abc_axis_conversion.h
+++ b/source/blender/io/alembic/intern/abc_axis_conversion.h
@@ -22,13 +22,9 @@
  * \ingroup Alembic
  */
 
-struct Object;
+#include "BLI_compiler_compat.h"
 
-#ifdef _MSC_VER
-#  define ABC_INLINE static __forceinline
-#else
-#  define ABC_INLINE static inline
-#endif
+struct Object;
 
 namespace blender {
 namespace io {
@@ -41,7 +37,7 @@ namespace alembic {
 
 /* Copy from Y-up to Z-up. */
 
-ABC_INLINE void copy_zup_from_yup(float zup[3], const float yup[3])
+BLI_INLINE void copy_zup_from_yup(float zup[3], const float yup[3])
 {
   const float old_yup1 = yup[1]; /* in case zup == yup */
   zup[0] = yup[0];
@@ -49,7 +45,7 @@ ABC_INLINE void copy_zup_from_yup(float zup[3], const float yup[3])
   zup[2] = old_yup1;
 }
 
-ABC_INLINE void copy_zup_from_yup(short zup[3], const short yup[3])
+BLI_INLINE void copy_zup_from_yup(short zup[3], const short yup[3])
 {
   const short old_yup1 = yup[1]; /* in case zup == yup */
   zup[0] = yup[0];
@@ -59,7 +55,7 @@ ABC_INLINE void copy_zup_from_yup(short zup[3], const short yup[3])
 
 /* Copy from Z-up to Y-up. */
 
-ABC_INLINE void copy_yup_from_zup(float yup[3], const float zup[3])
+BLI_INLINE void copy_yup_from_zup(float yup[3], const float zup[3])
 {
   const float old_zup1 = zup[1]; /* in case yup == zup */
   yup[0] = zup[0];
@@ -67,7 +63,7 @@ ABC_INLINE void copy_yup_from_zup(float yup[3], const float zup[3])
   yup[2] = -old_zup1;
 }
 
-ABC_INLINE void copy_yup_from_zup(short yup[3], const short zup[3])
+BLI_INLINE void copy_yup_from_zup(short yup[3], const short zup[3])
 {
   const short old_zup1 = zup[1]; /* in case yup == zup */
   yup[0] = zup[0];
diff --git a/source/blender/io/alembic/intern/abc_reader_mesh.cc b/source/blender/io/alembic/intern/abc_reader_mesh.cc
index a37ac84bdfb..756dde3783c 100644
--- a/source/blender/io/alembic/intern/abc_reader_mesh.cc
+++ b/source/blender/io/alembic/intern/abc_reader_mesh.cc
@@ -32,6 +32,7 @@
 #include "DNA_meshdata_types.h"
 #include "DNA_object_types.h"
 
+#include "BLI_compiler_compat.h"
 #include "BLI_math_geom.h"
 
 #include "BKE_main.h"
@@ -343,7 +344,7 @@ static void process_normals(CDStreamConfig &config,
   }
 }
 
-ABC_INLINE void read_uvs_params(CDStreamConfig &config,
+BLI_INLINE void read_uvs_params(CDStreamConfig &config,
                                 AbcMeshData &abc_data,
                                 const IV2fGeomParam &uv,
                                 const ISampleSelector &selector)
@@ -718,7 +719,7 @@ void AbcMeshReader::readFaceSetsSample(Main *bmain, Mesh *mesh, const ISampleSel
 
 /* ************************************************************************** */
 
-ABC_INLINE MEdge *find_edge(MEdge *edges, int totedge, int v1, int v2)
+BLI_INLINE MEdge *find_edge(MEdge *edges, int totedge, int v1, int v2)
 {
   for (int i = 0, e = totedge; i < e; i++) {
     MEdge &edge = edges[i];
diff --git a/source/blender/io/alembic/intern/abc_util.h b/source/blender/io/alembic/intern/abc_util.h
index 5353d7a422b..4689173ab5f 100644
--- a/source/blender/io/alembic/intern/abc_util.h
+++ b/source/blender/io/alembic/intern/abc_util.h
@@ -22,12 +22,6 @@
 #include <Alembic/Abc/All.h>
 #include <Alembic/AbcGeom/All.h>
 
-#ifdef _MSC_VER
-#  define ABC_INLINE static __forceinline
-#else
-#  define ABC_INLINE static inline
-#endif
-
 /**
  * \brief The CacheReader struct is only used for anonymous pointers,
  * to interface between C and C++ code. This library only creates
diff --git a/source/blender/io/alembic/intern/alembic_capi.cc b/source/blender/io/alembic/intern/alembic_capi.cc
index 40dd690301e..0b4b184359b 100644
--- a/source/blender/io/alembic/intern/alembic_capi.cc
+++ b/source/blender/io/alembic/intern/alembic_capi.cc
@@ -57,6 +57,7 @@
 #include "BKE_screen.h"
 #undef new
 
+#include "BLI_compiler_compat.h"
 #include "BLI_fileops.h"
 #include "BLI_ghash.h"
 #include "BLI_listbase.h"
@@ -105,12 +106,12 @@ struct AbcArchiveHandle {
   int unused;
 };
 
-ABC_INLINE ArchiveReader *archive_from_handle(AbcArchiveHandle *handle)
+BLI_INLINE ArchiveReader *archive_from_handle(AbcArchiveHandle *handle)
 {
   return reinterpret_cast<ArchiveReader *>(handle);
 }
 
-ABC_INLINE AbcArchiveHandle *handle_from_archive(ArchiveReader *archive)
+BLI_INLINE AbcArchiveHandle *handle_from_archive(ArchiveReader *archive)
 {
   return reinterpret_cast<AbcArchiveHandle *>(archive);
 }



More information about the Bf-blender-cvs mailing list