Changeset 190
- Timestamp:
- 09/30/06 13:52:21 (2 years ago)
- Files:
-
- 06/libkombilo/search.cc (modified) (19 diffs)
- 06/libkombilo/sgfparser.cc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
06/libkombilo/search.cc
r189 r190 477 477 478 478 vector<MoveNC> newContList; 479 for( int i=0; i<pattern.contList.size(); i++) {479 for(unsigned int i=0; i<pattern.contList.size(); i++) { 480 480 newContList.push_back(MoveNC(Pattern::flipsX(f, pattern.contList[i].x, pattern.contList[i].y, 481 481 pattern.sizeX-1,pattern.sizeY-1), … … 514 514 } 515 515 vector<MoveNC> newContList; 516 for( int i=0; i<pattern.contList.size(); i++) {516 for(unsigned int i=0; i<pattern.contList.size(); i++) { 517 517 newContList.push_back(MoveNC(Pattern::flipsX(f, pattern.contList[i].x, pattern.contList[i].y, 518 518 pattern.sizeX-1,pattern.sizeY-1), … … 689 689 } 690 690 string labelList = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; 691 int labelIndex = 0;691 unsigned int labelIndex = 0; 692 692 693 693 // FIXME assign labels which are already in the SGF file … … 697 697 698 698 int max_hits = 0; 699 int max_hits_index ;699 int max_hits_index = 0; 700 700 while (max_hits != -1 && labelIndex < labelList.size()) { 701 701 for(int i=0; i<pattern.sizeX*pattern.sizeY; i++) { … … 1039 1039 1040 1040 int index = gl.start(); 1041 int counter = 0; // to keep track of progress bar1041 // int counter = 0; // to keep track of progress bar 1042 1042 // printf("%d patterns\n", plS); 1043 1043 char start; … … 1389 1389 cands->reserve(currentMatchList->size()); 1390 1390 1391 for(int mCounter=0; mCounter< currentMatchList->size(); mCounter++) {1391 for(int mCounter=0; mCounter<(int)currentMatchList->size(); mCounter++) { 1392 1392 Candidate* m = (*currentMatchList)[mCounter]; 1393 1393 int dNO = 0; … … 1463 1463 char y = movel[movelistIndex+1] & 31; 1464 1464 1465 char co ;1466 char invco ;1467 char lower_invco ;1465 char co = 'O'; 1466 char invco = 'X'; 1467 char lower_invco = 'x'; 1468 1468 1469 1469 if (!(movel[movelistIndex+1] & REMOVE) && (movel[movelistIndex+1] & (BLACK | WHITE))) { … … 1473 1473 invco = 'O'; 1474 1474 lower_invco = 'o'; 1475 } else {1476 co = 'O';1477 invco = 'X';1478 lower_invco = 'x';1479 1475 } 1480 1476 … … 1503 1499 if (MoveNC(x, y, co) == ((*it)->contList)[(*it)->contListIndex]) { 1504 1500 (*it)->contListIndex++; 1505 if ((*it)->contListIndex == ( *it)->contList.size()) {1501 if ((*it)->contListIndex == (int)(*it)->contList.size()) { 1506 1502 (*it)->dictsF = counter; 1507 1503 (*it)->dictsFound = true; … … 1565 1561 if ((*it)->dictsFoundInitial) { // foundInitial 1566 1562 int ii = (*it)->contListIndex; 1567 while (ii < ( *it)->contList.size() && (*it)->contList[ii].color == '-' &&1563 while (ii < (int)(*it)->contList.size() && (*it)->contList[ii].color == '-' && 1568 1564 (x != (*it)->contList[ii].x || y != (*it)->contList[ii].y)) 1569 1565 ii++; 1570 if (ii < ( *it)->contList.size() && (*it)->contList[ii].color == '-') {1566 if (ii < (int)(*it)->contList.size() && (*it)->contList[ii].color == '-') { 1571 1567 MoveNC help = (*it)->contList[ii]; 1572 1568 (*it)->contList[ii] = (*it)->contList[(*it)->contListIndex]; … … 2492 2488 // else raise Exception; // FIXME 2493 2489 // 2494 // hit, label, contLabelsIndex, switched = \2490 // hit, label, contLabelsIndex, switched = 2495 2491 // patternList.updateContinuations(m[0], x+a0, y+a1, co, Xint, Yint, 2496 2492 // currentUInterv.first(), counter-1, … … 2604 2600 char strpip1[20]; 2605 2601 sprintf(strpip1, "[[%d[[F", i); 2606 int p = gameInfoStr.find(strpip1);2602 unsigned int p = gameInfoStr.find(strpip1); 2607 2603 if (p != string::npos) { 2608 2604 if (argv[i]) { … … 2622 2618 } 2623 2619 } 2624 int p = gameInfoStr.find("[[W");2620 unsigned int p = gameInfoStr.find("[[W"); 2625 2621 if (p != string::npos) gameInfoStr.replace(p, 3, 1, winner); 2626 2622 … … 2643 2639 format1 = "id,re"; 2644 2640 format2 = FORMAT; 2645 int p = 0;2646 int q = 0;2641 unsigned int p = 0; 2642 unsigned int q = 0; 2647 2643 while (p != string::npos) { 2648 2644 p = format2.find("[[",p); … … 2760 2756 int GameList::next() { 2761 2757 current++; 2762 if (current < oldList->size()) return (*oldList)[current].first;2758 if (current < (int)oldList->size()) return (*oldList)[current].first; 2763 2759 else { 2764 2760 if (oldList) delete oldList; … … 2954 2950 if (end==0) end = currentList->size(); 2955 2951 vector<string> result; 2956 if (start>end || end > currentList->size()) return result;2952 if (start>end || end > (int)currentList->size()) return result; 2957 2953 for(int i=start; i<end; i++) { 2958 2954 result.push_back((*all)[(*currentList)[i].second]->gameInfoStr + ", " + resultsStr((*all)[(*currentList)[i].second])); … … 3094 3090 bool year_found = false; 3095 3091 int p = 0; 3096 while (!year_found && p < dt.size()) {3092 while (!year_found && p < (int)dt.size()) { 3097 3093 p = dt.find_first_of("0123456789", p); 3098 if (p == string::npos || p+4 >dt.size() ) break;3094 if (p == (int)string::npos || p+4 > (int)dt.size() ) break; 3099 3095 else { 3100 3096 year_found = (('0' <= dt[p] && dt[p] <= '9') && ('0' <= dt[p+1] && dt[p+1] <= '9') && ('0' <= dt[p+2] && dt[p+2] <= '9') && ('0' <= dt[p+3] && dt[p+3] <= '9')); 3101 if (year_found && dt.find_first_of("0123456789", p+4) != p+4) { // success: found 4 digits in a row3097 if (year_found && (int)dt.find_first_of("0123456789", p+4) != p+4) { // success: found 4 digits in a row 3102 3098 date += dt.substr(p,4); 3103 3099 date += '-'; … … 3114 3110 bool month_found = false; 3115 3111 p = 0; 3116 while (!month_found && p < dt.size()) {3112 while (!month_found && p < (int)dt.size()) { 3117 3113 p = dt.find_first_of("0123456789", p); 3118 if (p == string::npos || p+2 >dt.size() ) break;3114 if (p == (int)string::npos || p+2 > (int)dt.size() ) break; 3119 3115 else { 3120 3116 month_found = ('0' <= dt[p] && dt[p] <= '9' && '0' <= dt[p+1] && dt[p+1] <= '9'); 3121 if (month_found && dt.find_first_of("0123456789", p+2) != p+2) {3117 if (month_found && (int)dt.find_first_of("0123456789", p+2) != p+2) { 3122 3118 date += dt.substr(p,2); 3123 3119 date += '-'; … … 3134 3130 bool day_found = false; 3135 3131 p = 0; 3136 while (!day_found && p < dt.size()) {3132 while (!day_found && p < (int)dt.size()) { 3137 3133 p = dt.find_first_of("0123456789", p); 3138 if (p == string::npos || p+2 >dt.size() ) break;3134 if (p == (int)string::npos || p+2 > (int)dt.size() ) break; 3139 3135 else { 3140 3136 day_found = ('0' <= dt[p] && dt[p] <= '9' && '0' <= dt[p+1] && dt[p+1] <= '9'); 3141 if (day_found && dt.find_first_of("0123456789", p+2) != p+2) {3137 if (day_found && (int)dt.find_first_of("0123456789", p+2) != p+2) { 3142 3138 date += dt.substr(p,2); 3143 3139 } else { 06/libkombilo/sgfparser.cc
r188 r190 103 103 char* t = new char[2*strlen(s)+1]; 104 104 int j = 0; 105 for( int i = 0; i<strlen(s); i++) {105 for(unsigned int i = 0; i<strlen(s); i++) { 106 106 if (s[i] == '\\' || s[i] == ']') t[j++]='\\'; 107 107 t[j++] = s[i]; … … 955 955 result[0] = 0; 956 956 957 if ( node->SGFstring.size() + strlen(result) >= s-5) {957 if ((int)(node->SGFstring.size() + strlen(result)) >= s-5) { 958 958 s += 1000 + node->SGFstring.size(); 959 959 char* res = new char[s]; … … 973 973 char* r = outputVar(node); 974 974 975 if ( strlen(r) + strlen(result) >= s-5) {975 if ((int)(strlen(r) + strlen(result)) >= s-5) { 976 976 s += 1000 + strlen(r); 977 977 char* res = new char[s]; … … 990 990 char* r = outputVar(node); 991 991 992 if ( strlen(r) + strlen(result) >= s-5) {992 if ((int)(strlen(r) + strlen(result)) >= s-5) { 993 993 s += 1000 + strlen(r); 994 994 char* res = new char[s]; … … 1005 1005 } 1006 1006 else { 1007 if ( node->SGFstring.size() + strlen(result) >= s) {1007 if ((int)(node->SGFstring.size() + strlen(result)) >= s) { 1008 1008 s += 1000 + node->SGFstring.size(); 1009 1009 char* res = new char[s]; … … 1038 1038 char* t = outputVar(n); 1039 1039 1040 if ( strlen(t) + strlen(result) >= s-5) {1040 if ((int)(strlen(t) + strlen(result)) >= s-5) { 1041 1041 s += 2000 + strlen(t); 1042 1042 char* res = new char[s];
