Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2012-02-29 12:35:23 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2012-02-29 12:35:23 +0400
commit33baddfc4798dffab27247ba2c3a81d19a96e199 (patch)
treee3a7839773d4562af7da44de4b9708ac8121666e /source/blender/blenkernel/intern/CCGSubSurf.c
parenta6f420b82888ca6ef2f919e6dfed2343fa349117 (diff)
Code cleanup: replace a few macros in CCGSubSurf with inline functions.
Diffstat (limited to 'source/blender/blenkernel/intern/CCGSubSurf.c')
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c
index 62da7c2c51b..f843d21a975 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf.c
@@ -310,7 +310,11 @@ struct CCGVert {
// byte *levelData;
// byte *userData;
};
-#define VERT_getLevelData(v) ((byte *) &(v)[1])
+
+static CCG_INLINE byte *VERT_getLevelData(CCGVert *v)
+{
+ return (byte*)(&(v)[1]);
+}
struct CCGEdge {
CCGEdge *next; /* EHData.next */
@@ -325,7 +329,11 @@ struct CCGEdge {
// byte *levelData;
// byte *userData;
};
-#define EDGE_getLevelData(e) ((byte *) &(e)[1])
+
+static CCG_INLINE byte *EDGE_getLevelData(CCGEdge *e)
+{
+ return (byte*)(&(e)[1]);
+}
struct CCGFace {
CCGFace *next; /* EHData.next */
@@ -339,9 +347,21 @@ struct CCGFace {
// byte **gridData;
// byte *userData;
};
-#define FACE_getVerts(f) ((CCGVert**) &(f)[1])
-#define FACE_getEdges(f) ((CCGEdge**) &(FACE_getVerts(f)[(f)->numVerts]))
-#define FACE_getCenterData(f) ((byte *) &(FACE_getEdges(f)[(f)->numVerts]))
+
+static CCG_INLINE CCGVert **FACE_getVerts(CCGFace *f)
+{
+ return (CCGVert**)(&f[1]);
+}
+
+static CCG_INLINE CCGEdge **FACE_getEdges(CCGFace *f)
+{
+ return (CCGEdge**)(&(FACE_getVerts(f)[f->numVerts]));
+}
+
+static CCG_INLINE byte *FACE_getCenterData(CCGFace *f)
+{
+ return (byte*)(&(FACE_getEdges(f)[(f)->numVerts]));
+}
typedef enum {
eSyncState_None = 0,