Commit 9ed151f0 authored by Lynn Garren's avatar Lynn Garren
Browse files

bug fix for CLHEP-147

parent 80031e3a
...@@ -48,10 +48,10 @@ int main() { ...@@ -48,10 +48,10 @@ int main() {
std::ifstream in("/dev/urandom", std::ios::in | std::ios::binary); std::ifstream in("/dev/urandom", std::ios::in | std::ios::binary);
if(in.is_open()) { if(in.is_open()) {
in.read((char *)(&rvals), 2*sizeof(long)); in.read((char *)(&rvals), 2*sizeof(long));
in.close();
if(in.fail()) { if(in.fail()) {
throw std::runtime_error("File read error"); throw std::runtime_error("File read error");
} }
in.close();
} else throw std::runtime_error("File open error"); } else throw std::runtime_error("File open error");
} catch(std::runtime_error e) { } catch(std::runtime_error e) {
std::ostringstream dStr; std::ostringstream dStr;
...@@ -201,7 +201,7 @@ int main() { ...@@ -201,7 +201,7 @@ int main() {
// Loop as long as the values are bad. // Loop as long as the values are bad.
double r; double r;
unsigned int low = ~0; unsigned int low = ~0;
unsigned long mask = (~0) << 31; unsigned long mask = (~0u) << 31;
unsigned long skipcount = 0; unsigned long skipcount = 0;
output << "low = " << low << " mask = " << mask << std::endl; output << "low = " << low << " mask = " << mask << std::endl;
do { do {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment