| 1 | --- src/lev/ScoreManager.cc.orig 2009-12-28 02:36:23.000000000 +0100 |
| 2 | +++ src/lev/ScoreManager.cc 2009-12-28 02:44:18.000000000 +0100 |
| 3 | @@ -65,14 +65,14 @@ |
| 4 | class ScoreDomSerFilter : public DOMWriterFilter { |
| 5 | #endif |
| 6 | public: |
| 7 | - virtual short acceptNode(const DOMNode *node) const; |
| 8 | + virtual DOMNodeFilter::FilterAction acceptNode(const DOMNode *node) const; |
| 9 | virtual unsigned long getWhatToShow () const { |
| 10 | return DOMNodeFilter::SHOW_ALL; |
| 11 | } |
| 12 | virtual void setWhatToShow (unsigned long toShow) {} |
| 13 | }; |
| 14 | |
| 15 | - short ScoreDomSerFilter::acceptNode(const DOMNode *node) const { |
| 16 | + DOMNodeFilter::FilterAction ScoreDomSerFilter::acceptNode(const DOMNode *node) const { |
| 17 | if (node->getNodeType () == DOMNode::ELEMENT_NODE && |
| 18 | std::string(XMLtoUtf8(node->getNodeName()).c_str()) == "level") { |
| 19 | const DOMElement *e = dynamic_cast<const DOMElement *>(node); |
| 20 | @@ -119,7 +119,7 @@ |
| 21 | |
| 22 | if (stateUserId.length() == 16 && |
| 23 | stateUserId.find_first_not_of("0123456789ABCDEF") == std::string::npos) { |
| 24 | - unsigned i1, i2, i3, i4; |
| 25 | + unsigned long i1, i2, i3, i4; |
| 26 | std::istringstream s1(stateUserId.substr(0, 4)); |
| 27 | std::istringstream s2(stateUserId.substr(4, 4)); |
| 28 | std::istringstream s3(stateUserId.substr(8, 4)); |
| 29 | @@ -233,7 +233,7 @@ |
| 30 | hasValidUserId = true; |
| 31 | } else { |
| 32 | // create first part of user id based on time stamp |
| 33 | - unsigned id; |
| 34 | + unsigned long id; |
| 35 | if (RAND_MAX > 0x10000) { |
| 36 | id = std::rand() & 0xFFFFFFFF; |
| 37 | } else { |
| 38 | @@ -319,7 +319,7 @@ |
| 39 | } |
| 40 | |
| 41 | void ScoreManager::finishUserId(unsigned id3) { |
| 42 | - unsigned i1, i2, i3, i4; |
| 43 | + unsigned long i1, i2, i3, i4; |
| 44 | std::istringstream s1(userId.substr(0, 4)); |
| 45 | std::istringstream s2(userId.substr(4, 4)); |
| 46 | s1 >> std::hex >> i1; |
| 47 | @@ -334,7 +334,7 @@ |
| 48 | |
| 49 | std::string ScoreManager::sec(std::string target) { |
| 50 | int len = target.size(); |
| 51 | - unsigned r = 0; |
| 52 | + unsigned long r = 0; |
| 53 | const char *p = target.c_str(); |
| 54 | |
| 55 | while (len--) |
| 56 | @@ -362,9 +362,9 @@ |
| 57 | Log << "ReId Windows 1.00 User Id: " << userId << "\n"; |
| 58 | setProperty("UserId1.00", userId); |
| 59 | app.state->setProperty("UserId1.00", userId); |
| 60 | - unsigned id1 = std::rand() & 0xFFFF; |
| 61 | + unsigned long id1 = std::rand() & 0xFFFF; |
| 62 | userId.replace(0, 4, ecl::strf("%.4lX",id1)); |
| 63 | - unsigned id2, id3, id4; |
| 64 | + unsigned long id2, id3, id4; |
| 65 | std::istringstream s2(userId.substr(4, 4)); |
| 66 | std::istringstream s3(userId.substr(8, 4)); |
| 67 | s2 >> std::hex >> id2; |