Changeset 2588


Ignore:
Timestamp:
Oct 25, 2011, 11:38:55 PM (10 years ago)
Author:
Peter
Message:

prefer using standard functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/random/random.cc

    r2587 r2588  
    2626
    2727#include <cassert>
     28#include <cstring>
    2829#include <fstream>
    2930#include <sstream>
     
    9899    is.close();
    99100    unsigned long s=0;
    100     for (unsigned int i=0; i<ulongsize; i++) {
    101       unsigned char ch=buffer[i];
    102       s+=ch<<((ulongsize-1-i)*8);
    103     }
     101    memcpy(s, buffer, ulongsize);
    104102    delete[] buffer;
    105103    seed(s);
Note: See TracChangeset for help on using the changeset viewer.