瀏覽代碼

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

legacy
Sam Hocevar sam 11 年之前
父節點
當前提交
56f093817d
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      src/lol/math/rand.h

+ 1
- 1
src/lol/math/rand.h 查看文件

@@ -94,7 +94,7 @@ template<typename T> static inline T 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:
ASSERT(false, "rand() doesn’t support types of size %d\n",


Loading…
取消
儲存