diff options
author | mano-wii <germano.costa@ig.com.br> | 2020-01-27 20:17:51 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2020-01-27 20:17:51 +0300 |
commit | 67f3941dd592d8a02d86450e303b6b7e50857c9c (patch) | |
tree | 1b363ee981eee06d065db6176f6c1b8369bcd2c0 /intern | |
parent | 20e803ac6bc655d4d7ffbf02e797b4ab1f3ba0ed (diff) | |
parent | c8103efbe3bfa2487a2866a7cf22e3b7681338ef (diff) |
Merge branch 'blender-v2.82-release'
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCocoa.mm | 1 | ||||
-rw-r--r-- | intern/mikktspace/mikktspace.c | 14 |
2 files changed, 14 insertions, 1 deletions
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 340beef9609..6470bb22fef 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -799,6 +799,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setOrder(GHOST_TWindowOrder order) GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::setOrder(): window invalid"); if (order == GHOST_kWindowOrderTop) { + [NSApp activateIgnoringOtherApps:YES]; [m_window makeKeyAndOrderFront:nil]; } else { diff --git a/intern/mikktspace/mikktspace.c b/intern/mikktspace/mikktspace.c index 4f120b7d83c..285529298eb 100644 --- a/intern/mikktspace/mikktspace.c +++ b/intern/mikktspace/mikktspace.c @@ -27,6 +27,7 @@ #include <string.h> #include <float.h> #include <stdlib.h> +#include <limits.h> #include "mikktspace.h" @@ -135,6 +136,17 @@ MIKK_INLINE tbool VNotZero(const SVec3 v) } #endif +// Shift operations in C are only defined for shift values which are +// not negative and smaller than sizeof(value) * CHAR_BIT. +// The mask, used with bitwise-and (&), prevents undefined behaviour +// when the shift count is 0 or >= the width of unsigned int. +MIKK_INLINE unsigned int rotl(unsigned int value, unsigned int count) +{ + const unsigned int mask = CHAR_BIT * sizeof(value) - 1; + count &= mask; + return (value << count) | (value >> (-count & mask)); +} + typedef struct { int iNrFaces; int *pTriMembers; @@ -1605,7 +1617,7 @@ static void QuickSortEdges( // Random t = uSeed & 31; - t = (uSeed << t) | (uSeed >> (32 - t)); + t = rotl(uSeed, t); uSeed = uSeed + t + 3; // Random end |