diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-10-13 17:35:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-10-13 17:36:13 +0400 |
commit | a4258d40a1c7148034d3ed704fda7609b2cbb55b (patch) | |
tree | e95fde48ede5c1d8728ba725ba1837c267e78d45 /source/blender/blenlib/BLI_utildefines.h | |
parent | cc03689962612afa808dc0b8ede338b9d6b70b2d (diff) |
BLI_utildefines: add SQUARE macro
also minor cleanup
Diffstat (limited to 'source/blender/blenlib/BLI_utildefines.h')
-rw-r--r-- | source/blender/blenlib/BLI_utildefines.h | 4 |
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 |