Hash :
b3584fb4
Author :
Date :
2015-04-09T17:34:21
Revert "Fix and enable warning C4244 (Conversion from 'type1' to 'type2', possible loss of data)" Causing a build failure on Mac/Clang: ./Tokenizer.cpp:551:7: error: extra tokens at end of #else directive [-Werror,-Wextra-tokens] #else if defined(_MSC_VER) http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Mac%20Builder/builds/29136 This reverts commit 3b26e231d99154814eb428f75a67bbe7a21adadc. Change-Id: I2d11ddcc18130d908fd2ec3d6f5ab890cfccd5e7 Reviewed-on: https://chromium-review.googlesource.com/264983 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
//
// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "random_utils.h"
#include <time.h>
#include <cstdlib>
float RandomBetween(float min, float max)
{
static bool randInitialized = false;
if (!randInitialized)
{
srand(time(NULL));
randInitialized = true;
}
const size_t divisor = 10000;
return min + ((rand() % divisor) / static_cast<float>(divisor)) * (max - min);
}