# # # patch "ChangeLog" # from [4ceb643339b1b0db8a56e4210e24c2f2e6d9b11f] # to [bbdaedc69865c817348af47072b09b2ffffe165e] # # patch "roster.cc" # from [a24f36294033178c526b4428a3075365b570d716] # to [1acba1de262836a9504f6823133335e1f937dfdf] # ============================================================ --- ChangeLog 4ceb643339b1b0db8a56e4210e24c2f2e6d9b11f +++ ChangeLog bbdaedc69865c817348af47072b09b2ffffe165e @@ -1,3 +1,8 @@ +2006-05-11 Patrick Mauritz + + * roster.cc: include proper header for srand, rand and prefix + srand, rand, search with std:: for sunpro + 2006-05-11 Graydon Hoare * xdelta.cc (read_num): New function. ============================================================ --- roster.cc a24f36294033178c526b4428a3075365b570d716 +++ roster.cc 1acba1de262836a9504f6823133335e1f937dfdf @@ -2594,6 +2594,7 @@ #include "constants.hh" #include +#include #include using std::string; @@ -2784,7 +2785,7 @@ bool flip(unsigned n = 2) { - return (rand() % n) == 0; + return (std::rand() % n) == 0; } string new_word() @@ -2794,7 +2795,7 @@ string tmp; do { - tmp += wordchars[rand() % wordchars.size()]; + tmp += wordchars[std::rand() % wordchars.size()]; } while (tmp.size() < 10 && !flip(10)); return tmp + lexical_cast(tick++); @@ -2806,7 +2807,7 @@ string tmp; tmp.reserve(constants::idlen); for (unsigned i = 0; i < constants::idlen; ++i) - tmp += tab[rand() % tab.size()]; + tmp += tab[std::rand() % tab.size()]; return file_id(tmp); } @@ -2836,7 +2837,7 @@ if (p.size() <= c.size()) { split_path::const_iterator c_anchor = - search(c.begin(), c.end(), + std::search(c.begin(), c.end(), p.begin(), p.end()); is_parent = (c_anchor == c.begin()); @@ -2856,7 +2857,7 @@ change_automaton() { - srand(0x12345678); + std::srand(0x12345678); } void perform_random_action(roster_t & r, node_id_source & nis) @@ -2878,7 +2879,7 @@ r.get_name(n->self, pth); // L(FL("considering acting on '%s'\n") % file_path(pth)); - switch (rand() % 7) + switch (std::rand() % 7) { default: case 0: @@ -4619,7 +4620,7 @@ roster_t & right_ros, set & right_new_nodes) { - size_t n_nodes = 10 + (rand() % 30); + size_t n_nodes = 10 + (std::rand() % 30); editable_roster_base left_er(left_ros, nis); editable_roster_base right_er(right_ros, nis);