Ticket #7007: bcp.patch

File bcp.patch, 2.8 KB (added by Luke Elliott <lukester_null@…>, 10 years ago)
  • licence_info.cpp

     
    702702         ,
    703703         "<P>The code has no license terms, it has been explicity placed in the\n"
    704704         "public domain by it's author(s).</P>"
    705705       )
    706706      ,
    707707   };
    708    return std::pair<const license_info*, int>(licenses, sizeof(licenses)/sizeof(licenses[0]));
     708   return std::pair<const license_info*, int>(licenses, static_cast<int>(sizeof(licenses)/sizeof(licenses[0])));
    709709}
    710710
    711711std::string format_authors_name(const std::string& name)
    712712{
    713713   // put name into a consistent format, so that we don't get too much
    714714   // of a proliferation of names (lots of versions of the same basic form).
  • scan_cvs_path.cpp

     
    2828   //
    2929   static const char* file_list[] = { "CVS/Entries", "CVS/Entries.Log" };
    3030   static const boost::regex file_expression("^(?:A\\s+)?/([^/\\n]+)/[^/\\n]*/[^/\\n]*/[^k/\\n]*(kb[^/\\n]*)?/[^/\\n]*");
    3131   static const boost::regex dir_expression("^(?:A\\s+)?D/([^/\\n]+)/");
    3232   static const int file_subs[] = {1,2,};
    3333
    34    for(int entry = 0; entry < sizeof(file_list)/sizeof(file_list[0]); ++entry)
     34   for(size_t entry = 0; entry < sizeof(file_list)/sizeof(file_list[0]); ++entry)
    3535   {
    3636      fs::path entries(m_boost_path / p / file_list[entry]);
    3737      if(fs::exists(entries))
    3838      {
    3939         fileview view(entries);
    4040         boost::regex_token_iterator<const char*> i(view.begin(), view.end(), dir_expression, 1);
  • scan_licence.cpp

     
    2424fileview::const_iterator
    2525context_before_license(const fileview& v, fileview::const_iterator start,
    2626                       int context_lines = 3)
    2727{
    2828  char last_char = '\0';
    2929  while (start != v.begin() && context_lines >= 0) {
    30     if (*start == '\r' || *start == '\n'
    31         && (last_char == *start || (last_char != '\r' && last_char != '\n')))
     30    if (((*start == '\r') || (*start == '\n'))
     31        && ((last_char == *start) || ((last_char != '\r') && (last_char != '\n'))))
    3232        --context_lines;
    3333
    3434    last_char = *start;
    3535    --start;
    3636  }
    3737
     
    4545fileview::const_iterator
    4646context_after_license(const fileview& v, fileview::const_iterator end,
    4747                      int context_lines = 3)
    4848{
    4949  char last_char = '\0';
    5050  while (end != v.end() && context_lines >= 0) {
    51     if (*end == '\r' || *end == '\n'
    52         && (last_char == *end || (last_char != '\r' && last_char != '\n')))
     51    if (((*end == '\r') || (*end == '\n'))
     52        && ((last_char == *end) || ((last_char != '\r') && (last_char != '\n'))))
    5353        --context_lines;
    5454
    5555    last_char = *end;
    5656    ++end;
    5757  }
    5858