Ignore:
Timestamp:
May 2, 2019 10:54:02 PM (19 months ago)
Author:
meeh <meeh@…>
Branches:
master
Children:
803447b4
Parents:
6a418eb
Message:

Mac OSX Launcher: Reduce amount of compiler warnings under build.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • launchers/macosx/include/subprocess.hpp

    r6a418eb re93fb5c  
    251251    size_t nwritten = 0;
    252252    while (nwritten < length) {
    253       int written = write(fd, buf + nwritten, length - nwritten);
     253      int written = write(fd, buf + nwritten, (int)length - nwritten);
    254254      if (written == -1) return -1;
    255255      nwritten += written;
    256256    }
    257     return nwritten;
     257    return (int)nwritten;
    258258  }
    259259
     
    280280
    281281    while (1) {
    282       int read_bytes = read(fd, buf + rbytes, read_upto - rbytes);
     282      int read_bytes = read(fd, buf + rbytes, (int)read_upto - rbytes);
    283283      if (read_bytes == -1) {
    284284        if (errno == EINTR) {
     
    314314  {
    315315    size_t orig_size = buf.size();
    316     int increment = orig_size;
     316    int increment = (int)orig_size;
    317317    auto buffer = buf.data();
    318318    int total_bytes_read = 0;
     
    323323        // Resize the buffer to accomodate more
    324324        orig_size = orig_size * 1.5;
    325         increment = orig_size - buf.size();
     325        increment = (int)orig_size - (int)buf.size();
    326326        buf.resize(orig_size);
    327327        //update the buffer pointer
     
    13181318      // Close all the inherited fd's except the error write pipe
    13191319      if (parent_->close_fds_) {
    1320         int max_fd = sysconf(_SC_OPEN_MAX);
     1320        long max_fd = sysconf(_SC_OPEN_MAX);
    13211321        if (max_fd == -1) throw OSError("sysconf failed", errno);
    13221322
     
    13951395  {
    13961396    if (stream_->input() == nullptr) return -1;
    1397     return std::fwrite(msg, sizeof(char), length, stream_->input());
     1397    return std::fwrite(msg, sizeof(char), (int)length, stream_->input());
    13981398  }
    13991399
     
    14111411    auto hndls = {stream_->input(), stream_->output(), stream_->error()};
    14121412    int count = std::count(std::begin(hndls), std::end(hndls), nullptr);
    1413     const int len_conv = length;
     1413    const int len_conv = (int)length;
    14141414
    14151415    if (count >= 2) {
     
    14181418      if (stream_->input()) {
    14191419        if (msg) {
    1420           int wbytes = std::fwrite(msg, sizeof(char), length, stream_->input());
     1420          int wbytes = std::fwrite(msg, sizeof(char), (int)length, stream_->input());
    14211421          if (wbytes < len_conv) {
    14221422            if (errno != EPIPE && errno != EINVAL) {
     
    14751475    ErrBuffer ebuf;
    14761476    std::future<int> out_fut, err_fut;
    1477     const int length_conv = length;
     1477    const int length_conv = (int)length;
    14781478
    14791479    if (stream_->output()) {
     
    14951495    if (stream_->input()) {
    14961496      if (msg) {
    1497         int wbytes = std::fwrite(msg, sizeof(char), length, stream_->input());
     1497        int wbytes = std::fwrite(msg, sizeof(char), (int)length, stream_->input());
    14981498        if (wbytes < length_conv) {
    14991499          if (errno != EPIPE && errno != EINVAL) {
Note: See TracChangeset for help on using the changeset viewer.