Ticket #7076: fs.patch

File fs.patch, 2.4 KB (added by Luke Elliott <lukester_null@…>, 10 years ago)
  • libs\filesystem\src\operations.cpp

     
    17581758      return p;
    17591759
    17601760#   else  // Windows
    17611761
    17621762      std::vector<path::value_type> buf(GetTempPathW(0, NULL));
    17631763
    1764       if (buf.empty() || GetTempPathW(buf.size(), &buf[0])==0)
     1764      if (buf.empty() || GetTempPathW(static_cast<DWORD>(buf.size()), &buf[0])==0)
    17651765      {
    17661766        if(!buf.empty()) ::SetLastError(ENOTDIR);
    17671767        error(true, ec, "boost::filesystem::temp_directory_path");
    17681768        return path();
    17691769      }
    17701770
  • libs\filesystem\src\unique_path.cpp

     
    8888      else errval = 0;
    8989    }
    9090  }
    9191
    9292  if (!errval)
    9393  {
    94     BOOL gen_ok = ::CryptGenRandom(handle, len, static_cast<unsigned char*>(buf));
     94    BOOL gen_ok = ::CryptGenRandom(handle, static_cast<DWORD>(len), static_cast<unsigned char*>(buf));
    9595    if (!gen_ok)
    9696      errval = ::GetLastError();
    9797    ::CryptReleaseContext(handle, 0);
    9898  }
    9999
    100100  if (!errval) return;
  • libs\filesystem\src\windows_file_codecvt.cpp

     
    3737    wchar_t* to, wchar_t* to_end, wchar_t*& to_next) const
    3838  {
    3939    UINT codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;
    4040
    4141    int count;
    4242    if ((count = ::MultiByteToWideChar(codepage, MB_PRECOMPOSED, from,
    43       from_end - from, to, to_end - to)) == 0)
     43      static_cast<int>(from_end - from), to, static_cast<int>(to_end - to))) == 0)
    4444    {
    4545      return error;  // conversion failed
    4646    }
    4747
    4848    from_next = from_end;
    4949    to_next = to + count;
     
    5757    char* to, char* to_end, char* & to_next) const
    5858  {
    5959    UINT codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;
    6060
    6161    int count;
    6262    if ((count = ::WideCharToMultiByte(codepage, WC_NO_BEST_FIT_CHARS, from,
    63       from_end - from, to, to_end - to, 0, 0)) == 0)
     63      static_cast<int>(from_end - from), to, static_cast<int>(to_end - to), 0, 0)) == 0)
    6464    {
    6565      return error;  // conversion failed
    6666    }
    6767
    6868    from_next = from_end;
    6969    to_next = to + count;
    7070    *to_next = '\0';
    7171    return ok;
    7272  }
    7373
    7474  # endif  // BOOST_WINDOWS_API
    7575