Re: Review Request 52062: Fixed warnings in `numify.hpp`.

2016-09-27 Thread Michael Park

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


Ship it!




Ship It!

- Michael Park


On Sept. 26, 2016, 9:37 p.m., Daniel Pravat wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52062/
> ---
> 
> (Updated Sept. 26, 2016, 9:37 p.m.)
> 
> 
> Review request for mesos, Alex Naparu, Artem Harutyunyan, Alex Clemmer, 
> Joseph Wu, and Michael Park.
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> When the template is instatiated for unsigned scalars
> the unary negation generates warnings.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/numify.hpp 
> c174fcb8cb9d809f443e44058f07b58751bed9dd 
> 
> Diff: https://reviews.apache.org/r/52062/diff/
> 
> 
> Testing
> ---
> 
> Windows: build
> 
> 
> Thanks,
> 
> Daniel Pravat
> 
>



Re: Review Request 52062: Fixed warnings in `numify.hpp`.

2016-09-26 Thread Daniel Pravat

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

(Updated Sept. 26, 2016, 9:37 p.m.)


Review request for mesos, Alex Naparu, Artem Harutyunyan, Alex Clemmer, Joseph 
Wu, and Michael Park.


Repository: mesos


Description
---

When the template is instatiated for unsigned scalars
the unary negation generates warnings.


Diffs (updated)
-

  3rdparty/stout/include/stout/numify.hpp 
c174fcb8cb9d809f443e44058f07b58751bed9dd 

Diff: https://reviews.apache.org/r/52062/diff/


Testing
---

Windows: build


Thanks,

Daniel Pravat



Re: Review Request 52062: Fixed warnings in `numify.hpp`.

2016-09-23 Thread Michael Park

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



(1) Is it possible to narrow the warning disabling statements like this?
```
#ifdef __WINDOWS__
  #pragma warning(disable:4146)
#endif
result = -result;
#ifdef __WINDOWS__
  #pragma warning(default:4146)
#endif
```

(2) Could just leave a short comment around the reason for turning off this 
warning at this specific spot?

- Michael Park


On Sept. 23, 2016, 4:46 a.m., Daniel Pravat wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52062/
> ---
> 
> (Updated Sept. 23, 2016, 4:46 a.m.)
> 
> 
> Review request for mesos, Alex Naparu, Artem Harutyunyan, Alex Clemmer, 
> Joseph Wu, and Michael Park.
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> When the template is instatiated for unsigned scalars
> the unary negation generates warnings.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/numify.hpp 
> c174fcb8cb9d809f443e44058f07b58751bed9dd 
> 
> Diff: https://reviews.apache.org/r/52062/diff/
> 
> 
> Testing
> ---
> 
> Windows: build
> 
> 
> Thanks,
> 
> Daniel Pravat
> 
>



Re: Review Request 52062: Fixed warnings in `numify.hpp`.

2016-09-22 Thread Daniel Pravat

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

(Updated Sept. 23, 2016, 4:46 a.m.)


Review request for mesos, Alex Naparu, Artem Harutyunyan, Alex Clemmer, Joseph 
Wu, and Michael Park.


Repository: mesos


Description
---

When the template is instatiated for unsigned scalars
the unary negation generates warnings.


Diffs (updated)
-

  3rdparty/stout/include/stout/numify.hpp 
c174fcb8cb9d809f443e44058f07b58751bed9dd 

Diff: https://reviews.apache.org/r/52062/diff/


Testing
---

Windows: build


Thanks,

Daniel Pravat



Re: Review Request 52062: Fixed warnings in `numify.hpp`.

2016-09-20 Thread Michael Park

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



We currently simply inherit the negation of unsigned int behavior from 
`boost::lexical_cast`.
i.e., `numify("-1") == std::numeric_limits::max()`

The current code for hexadecimals maintains this behavior whereas this patch 
does not.
i.e., `numify("-0x1") == 0x1`.

I think that we should either:
  - maintain the original behavior by simply silencing the MSVC warning, or
  - return an `Error` in the case where `T` is unsigned and 
`strings::startsWith(s, '-')` is `true`.
NOTE: this should be done at the top of the function, so that we have 
consistent behavior for non-hexadecimals as well.

- Michael Park


On Sept. 19, 2016, 8:05 p.m., Daniel Pravat wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52062/
> ---
> 
> (Updated Sept. 19, 2016, 8:05 p.m.)
> 
> 
> Review request for mesos, Alex Naparu, Artem Harutyunyan, Alex Clemmer, 
> Joseph Wu, and Michael Park.
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> When the template is instatiated for unsigned scalars
> the unary negation generates warnings.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/numify.hpp 
> c174fcb8cb9d809f443e44058f07b58751bed9dd 
> 
> Diff: https://reviews.apache.org/r/52062/diff/
> 
> 
> Testing
> ---
> 
> Windows: build
> 
> 
> Thanks,
> 
> Daniel Pravat
> 
>



Re: Review Request 52062: Fixed warnings in `numify.hpp`.

2016-09-20 Thread Michael Park


> On Sept. 19, 2016, 9:24 p.m., Joseph Wu wrote:
> > 3rdparty/stout/include/stout/numify.hpp, lines 29-32
> > 
> >
> > Couldn't this be a static assert (failure) instead?  
> > 
> > It doesn't make sense to negate an unsigned value.

No, if we were to put a `static_assert` here, it would cause an error when 
`numify` is used with any unsigned types.
That is, `numify` will always fail to compile. It's due to the 
fact that we obviously can't know whether `std::string` will start with a `-` 
or not at compile-time.


- Michael


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


On Sept. 19, 2016, 8:05 p.m., Daniel Pravat wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52062/
> ---
> 
> (Updated Sept. 19, 2016, 8:05 p.m.)
> 
> 
> Review request for mesos, Alex Naparu, Artem Harutyunyan, Alex Clemmer, 
> Joseph Wu, and Michael Park.
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> When the template is instatiated for unsigned scalars
> the unary negation generates warnings.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/numify.hpp 
> c174fcb8cb9d809f443e44058f07b58751bed9dd 
> 
> Diff: https://reviews.apache.org/r/52062/diff/
> 
> 
> Testing
> ---
> 
> Windows: build
> 
> 
> Thanks,
> 
> Daniel Pravat
> 
>



Re: Review Request 52062: Fixed warnings in `numify.hpp`.

2016-09-19 Thread Joseph Wu

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




3rdparty/stout/include/stout/numify.hpp (lines 29 - 32)


Couldn't this be a static assert (failure) instead?  

It doesn't make sense to negate an unsigned value.


- Joseph Wu


On Sept. 19, 2016, 1:05 p.m., Daniel Pravat wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52062/
> ---
> 
> (Updated Sept. 19, 2016, 1:05 p.m.)
> 
> 
> Review request for mesos, Alex Naparu, Artem Harutyunyan, Alex Clemmer, 
> Joseph Wu, and Michael Park.
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> When the template is instatiated for unsigned scalars
> the unary negation generates warnings.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/numify.hpp 
> c174fcb8cb9d809f443e44058f07b58751bed9dd 
> 
> Diff: https://reviews.apache.org/r/52062/diff/
> 
> 
> Testing
> ---
> 
> Windows: build
> 
> 
> Thanks,
> 
> Daniel Pravat
> 
>



Review Request 52062: Fixed warnings in `numify.hpp`.

2016-09-19 Thread Daniel Pravat

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

Review request for mesos, Alex Naparu, Artem Harutyunyan, Alex Clemmer, Joseph 
Wu, and Michael Park.


Repository: mesos


Description
---

When the template is instatiated for unsigned scalars
the unary negation generates warnings.


Diffs
-

  3rdparty/stout/include/stout/numify.hpp 
c174fcb8cb9d809f443e44058f07b58751bed9dd 

Diff: https://reviews.apache.org/r/52062/diff/


Testing
---

Windows: build


Thanks,

Daniel Pravat