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:
authorCampbell Barton <ideasman42@gmail.com>2014-10-13 17:35:41 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-10-13 17:36:13 +0400
commita4258d40a1c7148034d3ed704fda7609b2cbb55b (patch)
treee95fde48ede5c1d8728ba725ba1837c267e78d45 /source/blender/blenlib
parentcc03689962612afa808dc0b8ede338b9d6b70b2d (diff)
BLI_utildefines: add SQUARE macro
also minor cleanup
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_utildefines.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h
index a829cc60106..736578361b3 100644
--- a/source/blender/blenlib/BLI_utildefines.h
+++ b/source/blender/blenlib/BLI_utildefines.h
@@ -309,10 +309,14 @@
#define ABS(a) ({ \
typeof(a) a_ = (a); \
((a_) < 0 ? (-(a_)) : (a_)); })
+#define SQUARE(a) ({ \
+ typeof(a) a_ = (a); \
+ ((a_) * (a_)); })
#else
#define ABS(a) ((a) < 0 ? (-(a)) : (a))
+#define SQUARE(a) ((a) * (a))
#endif