Changeset 190

Show
Ignore:
Timestamp:
09/30/06 13:52:21 (2 years ago)
Author:
ug
Message:

Fixed compiler warnings.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 06/libkombilo/search.cc

    r189 r190  
    477477 
    478478    vector<MoveNC> newContList; 
    479     for(int i=0; i<pattern.contList.size(); i++) { 
     479    for(unsigned int i=0; i<pattern.contList.size(); i++) { 
    480480      newContList.push_back(MoveNC(Pattern::flipsX(f, pattern.contList[i].x, pattern.contList[i].y,  
    481481                                                      pattern.sizeX-1,pattern.sizeY-1), 
     
    514514      } 
    515515      vector<MoveNC> newContList; 
    516       for(int i=0; i<pattern.contList.size(); i++) { 
     516      for(unsigned int i=0; i<pattern.contList.size(); i++) { 
    517517        newContList.push_back(MoveNC(Pattern::flipsX(f, pattern.contList[i].x, pattern.contList[i].y,  
    518518                                                        pattern.sizeX-1,pattern.sizeY-1), 
     
    689689  } 
    690690  string labelList = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; 
    691   int labelIndex = 0; 
     691  unsigned int labelIndex = 0; 
    692692 
    693693  // FIXME assign labels which are already in the SGF file 
     
    697697   
    698698  int max_hits = 0; 
    699   int max_hits_index
     699  int max_hits_index = 0
    700700  while (max_hits != -1 && labelIndex < labelList.size()) { 
    701701    for(int i=0; i<pattern.sizeX*pattern.sizeY; i++) { 
     
    10391039 
    10401040  int index = gl.start(); 
    1041   int counter = 0; // to keep track of progress bar 
     1041  // int counter = 0; // to keep track of progress bar 
    10421042  // printf("%d patterns\n", plS); 
    10431043  char start; 
     
    13891389    cands->reserve(currentMatchList->size()); 
    13901390 
    1391     for(int mCounter=0; mCounter<currentMatchList->size(); mCounter++) { 
     1391    for(int mCounter=0; mCounter<(int)currentMatchList->size(); mCounter++) { 
    13921392      Candidate* m = (*currentMatchList)[mCounter]; 
    13931393      int dNO = 0; 
     
    14631463      char y = movel[movelistIndex+1] & 31; 
    14641464 
    1465       char co
    1466       char invco
    1467       char lower_invco
     1465      char co = 'O'
     1466      char invco = 'X'
     1467      char lower_invco = 'x'
    14681468 
    14691469      if (!(movel[movelistIndex+1] & REMOVE) && (movel[movelistIndex+1] & (BLACK | WHITE))) { 
     
    14731473          invco = 'O'; 
    14741474          lower_invco = 'o'; 
    1475         } else { 
    1476           co = 'O'; 
    1477           invco = 'X'; 
    1478           lower_invco = 'x'; 
    14791475        } 
    14801476 
     
    15031499              if (MoveNC(x, y, co) == ((*it)->contList)[(*it)->contListIndex]) { 
    15041500                (*it)->contListIndex++; 
    1505                 if ((*it)->contListIndex == (*it)->contList.size()) { 
     1501                if ((*it)->contListIndex == (int)(*it)->contList.size()) { 
    15061502                  (*it)->dictsF = counter; 
    15071503                  (*it)->dictsFound = true; 
     
    15651561              if ((*it)->dictsFoundInitial) { // foundInitial 
    15661562                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 == '-' && 
    15681564                    (x != (*it)->contList[ii].x || y != (*it)->contList[ii].y)) 
    15691565                  ii++; 
    1570                 if (ii < (*it)->contList.size() && (*it)->contList[ii].color == '-') { 
     1566                if (ii < (int)(*it)->contList.size() && (*it)->contList[ii].color == '-') { 
    15711567                  MoveNC help = (*it)->contList[ii]; 
    15721568                  (*it)->contList[ii] = (*it)->contList[(*it)->contListIndex]; 
     
    24922488//    else raise Exception; // FIXME 
    24932489//                          
    2494 //    hit, label, contLabelsIndex, switched =\ 
     2490//    hit, label, contLabelsIndex, switched = 
    24952491//      patternList.updateContinuations(m[0], x+a0, y+a1, co, Xint, Yint, 
    24962492//              currentUInterv.first(), counter-1, 
     
    26042600    char strpip1[20]; 
    26052601    sprintf(strpip1, "[[%d[[F", i); 
    2606     int p = gameInfoStr.find(strpip1); 
     2602    unsigned int p = gameInfoStr.find(strpip1); 
    26072603    if (p != string::npos) { 
    26082604      if (argv[i]) { 
     
    26222618    } 
    26232619  } 
    2624   int p = gameInfoStr.find("[[W"); 
     2620  unsigned int p = gameInfoStr.find("[[W"); 
    26252621  if (p != string::npos) gameInfoStr.replace(p, 3, 1, winner); 
    26262622 
     
    26432639    format1 = "id,re"; 
    26442640    format2 = FORMAT; 
    2645     int p = 0; 
    2646     int q = 0; 
     2641    unsigned int p = 0; 
     2642    unsigned int q = 0; 
    26472643    while (p != string::npos) { 
    26482644      p = format2.find("[[",p); 
     
    27602756int GameList::next() { 
    27612757  current++; 
    2762   if (current < oldList->size()) return (*oldList)[current].first; 
     2758  if (current < (int)oldList->size()) return (*oldList)[current].first; 
    27632759  else { 
    27642760    if (oldList) delete oldList; 
     
    29542950  if (end==0) end = currentList->size(); 
    29552951  vector<string> result; 
    2956   if (start>end || end > currentList->size()) return result; 
     2952  if (start>end || end > (int)currentList->size()) return result; 
    29572953  for(int i=start; i<end; i++) { 
    29582954    result.push_back((*all)[(*currentList)[i].second]->gameInfoStr + ", " + resultsStr((*all)[(*currentList)[i].second])); 
     
    30943090    bool year_found = false; 
    30953091    int p = 0; 
    3096     while (!year_found && p < dt.size()) { 
     3092    while (!year_found && p < (int)dt.size()) { 
    30973093      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; 
    30993095      else { 
    31003096        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 row 
     3097        if (year_found && (int)dt.find_first_of("0123456789", p+4) != p+4) { // success: found 4 digits in a row 
    31023098          date += dt.substr(p,4); 
    31033099          date += '-'; 
     
    31143110      bool month_found = false; 
    31153111      p = 0; 
    3116       while (!month_found && p < dt.size()) { 
     3112      while (!month_found && p < (int)dt.size()) { 
    31173113        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; 
    31193115        else { 
    31203116          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) { 
    31223118            date += dt.substr(p,2); 
    31233119            date += '-'; 
     
    31343130        bool day_found = false; 
    31353131        p = 0; 
    3136         while (!day_found && p < dt.size()) { 
     3132        while (!day_found && p < (int)dt.size()) { 
    31373133          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; 
    31393135          else { 
    31403136            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) { 
    31423138              date += dt.substr(p,2); 
    31433139            } else { 
  • 06/libkombilo/sgfparser.cc

    r188 r190  
    103103  char* t = new char[2*strlen(s)+1]; 
    104104  int j = 0; 
    105   for(int i = 0; i<strlen(s); i++) { 
     105  for(unsigned int i = 0; i<strlen(s); i++) { 
    106106    if (s[i] == '\\' || s[i] == ']') t[j++]='\\'; 
    107107    t[j++] = s[i]; 
     
    955955  result[0] = 0; 
    956956 
    957   if (node->SGFstring.size() + strlen(result) >= s-5) { 
     957  if ((int)(node->SGFstring.size() + strlen(result)) >= s-5) { 
    958958    s += 1000 + node->SGFstring.size(); 
    959959    char* res = new char[s]; 
     
    973973      char* r = outputVar(node); 
    974974 
    975       if (strlen(r) + strlen(result) >= s-5) { 
     975      if ((int)(strlen(r) + strlen(result)) >= s-5) { 
    976976        s += 1000 + strlen(r); 
    977977        char* res = new char[s]; 
     
    990990        char* r = outputVar(node); 
    991991 
    992         if (strlen(r) + strlen(result) >= s-5) { 
     992        if ((int)(strlen(r) + strlen(result)) >= s-5) { 
    993993          s += 1000 + strlen(r); 
    994994          char* res = new char[s]; 
     
    10051005    } 
    10061006    else { 
    1007       if (node->SGFstring.size() + strlen(result) >= s) { 
     1007      if ((int)(node->SGFstring.size() + strlen(result)) >= s) { 
    10081008        s += 1000 + node->SGFstring.size(); 
    10091009        char* res = new char[s]; 
     
    10381038    char* t = outputVar(n); 
    10391039 
    1040     if (strlen(t) + strlen(result) >= s-5) { 
     1040    if ((int)(strlen(t) + strlen(result)) >= s-5) { 
    10411041      s += 2000 + strlen(t); 
    10421042      char* res = new char[s];