You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Andrew Schwartzmeyer <an...@schwartzmeyer.com> on 2017/06/06 22:48:55 UTC

Review Request 59865: Fixed conversion warning in `duration.hpp`.

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59865/
-----------------------------------------------------------

Review request for mesos, Jeff Coffler, John Kordich, Joseph Wu, and Li Li.


Bugs: MESOS-7459
    https://issues.apache.org/jira/browse/MESOS-7459


Repository: mesos


Description
-------

While `ns()` and our other types are `int64_t`, the variable to which
we're assigning is (by definition of `struct timeval`) a `long`. We cast
it because there is no alternative, and we otherwise generate hundreds
of warnings.


Diffs
-----

  3rdparty/stout/include/stout/duration.hpp 138993e25c51efc82d447fe82037bf3a5fe7fd91 


Diff: https://reviews.apache.org/r/59865/diff/1/


Testing
-------

Built `stout-tests` on Windows and Linux, no more `duration.hpp` warnings.


Thanks,

Andrew Schwartzmeyer


Re: Review Request 59865: Fixed conversion warning in `duration.hpp`.

Posted by Mesos Reviewbot Windows <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59865/#review177123
-----------------------------------------------------------



Patch looks great!

Reviews applied: [59865]

Passed command: support\windows-build.bat

- Mesos Reviewbot Windows


On June 6, 2017, 10:48 p.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59865/
> -----------------------------------------------------------
> 
> (Updated June 6, 2017, 10:48 p.m.)
> 
> 
> Review request for mesos, Jeff Coffler, John Kordich, Joseph Wu, and Li Li.
> 
> 
> Bugs: MESOS-7459
>     https://issues.apache.org/jira/browse/MESOS-7459
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> While `ns()` and our other types are `int64_t`, the variable to which
> we're assigning is (by definition of `struct timeval`) a `long`. We cast
> it because there is no alternative, and we otherwise generate hundreds
> of warnings.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/duration.hpp 138993e25c51efc82d447fe82037bf3a5fe7fd91 
> 
> 
> Diff: https://reviews.apache.org/r/59865/diff/1/
> 
> 
> Testing
> -------
> 
> Built `stout-tests` on Windows and Linux, no more `duration.hpp` warnings.
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>


Re: Review Request 59865: Fixed conversion warning in `duration.hpp`.

Posted by Andrew Schwartzmeyer <an...@schwartzmeyer.com>.

> On June 7, 2017, 7:41 p.m., Michael Park wrote:
> > 3rdparty/stout/include/stout/duration.hpp
> > Lines 105-109 (patched)
> > <https://reviews.apache.org/r/59865/diff/1/?file=1743377#file1743377line105>
> >
> >     Maybe just do `t.tv_sec = static_cast<decltype(t.tv_sec)>(ns() / SECONDS);`?

Oh thank you, I was trying to find a way to get that type. I had found `typeid` but it wasn't what I needed. I should have just bugged you!


- Andrew


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59865/#review177211
-----------------------------------------------------------


On June 6, 2017, 10:48 p.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59865/
> -----------------------------------------------------------
> 
> (Updated June 6, 2017, 10:48 p.m.)
> 
> 
> Review request for mesos, Jeff Coffler, John Kordich, Joseph Wu, and Li Li.
> 
> 
> Bugs: MESOS-7459
>     https://issues.apache.org/jira/browse/MESOS-7459
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> While `ns()` and our other types are `int64_t`, the variable to which
> we're assigning is (by definition of `struct timeval`) a `long`. We cast
> it because there is no alternative, and we otherwise generate hundreds
> of warnings.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/duration.hpp 138993e25c51efc82d447fe82037bf3a5fe7fd91 
> 
> 
> Diff: https://reviews.apache.org/r/59865/diff/1/
> 
> 
> Testing
> -------
> 
> Built `stout-tests` on Windows and Linux, no more `duration.hpp` warnings.
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>


Re: Review Request 59865: Fixed conversion warning in `duration.hpp`.

Posted by Michael Park <mp...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59865/#review177211
-----------------------------------------------------------




3rdparty/stout/include/stout/duration.hpp
Lines 105-109 (patched)
<https://reviews.apache.org/r/59865/#comment250759>

    Maybe just do `t.tv_sec = static_cast<decltype(t.tv_sec)>(ns() / SECONDS);`?


- Michael Park


On June 6, 2017, 3:48 p.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59865/
> -----------------------------------------------------------
> 
> (Updated June 6, 2017, 3:48 p.m.)
> 
> 
> Review request for mesos, Jeff Coffler, John Kordich, Joseph Wu, and Li Li.
> 
> 
> Bugs: MESOS-7459
>     https://issues.apache.org/jira/browse/MESOS-7459
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> While `ns()` and our other types are `int64_t`, the variable to which
> we're assigning is (by definition of `struct timeval`) a `long`. We cast
> it because there is no alternative, and we otherwise generate hundreds
> of warnings.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/duration.hpp 138993e25c51efc82d447fe82037bf3a5fe7fd91 
> 
> 
> Diff: https://reviews.apache.org/r/59865/diff/1/
> 
> 
> Testing
> -------
> 
> Built `stout-tests` on Windows and Linux, no more `duration.hpp` warnings.
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>


Re: Review Request 59865: Fixed conversion warning in `duration.hpp`.

Posted by Joseph Wu <jo...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59865/#review178553
-----------------------------------------------------------


Ship it!




Ship It!

- Joseph Wu


On June 7, 2017, 1 p.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59865/
> -----------------------------------------------------------
> 
> (Updated June 7, 2017, 1 p.m.)
> 
> 
> Review request for mesos, Jeff Coffler, John Kordich, Joseph Wu, and Li Li.
> 
> 
> Bugs: MESOS-7459
>     https://issues.apache.org/jira/browse/MESOS-7459
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> While `ns()` and our other types are `int64_t`, the variables to which
> we're assigning are (by definition of `struct timeval`) a `time_t` or a
> `long` (depending on platform). We cast it because there is no
> alternative, and we otherwise generate hundreds of warnings. We cast to
> `decltype(...)` because the type is different depending on platform.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/duration.hpp 138993e25c51efc82d447fe82037bf3a5fe7fd91 
> 
> 
> Diff: https://reviews.apache.org/r/59865/diff/2/
> 
> 
> Testing
> -------
> 
> Built `stout-tests` on Windows and Linux, no more `duration.hpp` warnings.
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>


Re: Review Request 59865: Fixed conversion warning in `duration.hpp`.

Posted by Mesos Reviewbot Windows <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59865/#review177225
-----------------------------------------------------------



Patch looks great!

Reviews applied: [59865]

Passed command: support\windows-build.bat

- Mesos Reviewbot Windows


On June 7, 2017, 8 p.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59865/
> -----------------------------------------------------------
> 
> (Updated June 7, 2017, 8 p.m.)
> 
> 
> Review request for mesos, Jeff Coffler, John Kordich, Joseph Wu, and Li Li.
> 
> 
> Bugs: MESOS-7459
>     https://issues.apache.org/jira/browse/MESOS-7459
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> While `ns()` and our other types are `int64_t`, the variables to which
> we're assigning are (by definition of `struct timeval`) a `time_t` or a
> `long` (depending on platform). We cast it because there is no
> alternative, and we otherwise generate hundreds of warnings. We cast to
> `decltype(...)` because the type is different depending on platform.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/duration.hpp 138993e25c51efc82d447fe82037bf3a5fe7fd91 
> 
> 
> Diff: https://reviews.apache.org/r/59865/diff/2/
> 
> 
> Testing
> -------
> 
> Built `stout-tests` on Windows and Linux, no more `duration.hpp` warnings.
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>


Re: Review Request 59865: Fixed conversion warning in `duration.hpp`.

Posted by Andrew Schwartzmeyer <an...@schwartzmeyer.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59865/
-----------------------------------------------------------

(Updated June 7, 2017, 8 p.m.)


Review request for mesos, Jeff Coffler, John Kordich, Joseph Wu, and Li Li.


Changes
-------

Fixed to use `decltype`.


Bugs: MESOS-7459
    https://issues.apache.org/jira/browse/MESOS-7459


Repository: mesos


Description (updated)
-------

While `ns()` and our other types are `int64_t`, the variables to which
we're assigning are (by definition of `struct timeval`) a `time_t` or a
`long` (depending on platform). We cast it because there is no
alternative, and we otherwise generate hundreds of warnings. We cast to
`decltype(...)` because the type is different depending on platform.


Diffs (updated)
-----

  3rdparty/stout/include/stout/duration.hpp 138993e25c51efc82d447fe82037bf3a5fe7fd91 


Diff: https://reviews.apache.org/r/59865/diff/2/

Changes: https://reviews.apache.org/r/59865/diff/1-2/


Testing
-------

Built `stout-tests` on Windows and Linux, no more `duration.hpp` warnings.


Thanks,

Andrew Schwartzmeyer