Browse Source

math: don't use the LLU suffix for 64-bit numbers and don't use floorf().

legacy
Sam Hocevar sam 11 years ago
parent
commit
56f093817d
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/lol/math/rand.h

+ 1
- 1
src/lol/math/rand.h View File

@@ -94,7 +94,7 @@ template<typename T> static inline T rand()
ret = (ret << 8) ^ std::rand(); ret = (ret << 8) ^ std::rand();
ret = (ret << 8) ^ std::rand(); ret = (ret << 8) ^ std::rand();
} }
return static_cast<T>(ret & 0x7fffffffffffffffllu);
return static_cast<T>(ret & (~(uint64_t)0 >> 1));
} }
default: default:
ASSERT(false, "rand() doesn’t support types of size %d\n", ASSERT(false, "rand() doesn’t support types of size %d\n",


Loading…
Cancel
Save