> On Sept. 9, 2015, 3:24 p.m., Joris Van Remoortere wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp, lines 103-110
> > <https://reviews.apache.org/r/38031/diff/3/?file=1066423#file1066423line103>
> >
> >     Let's make this overlapped storage private and add accessors. We can 
> > postfix `_` to distinguish the variable names of the storage so that we can 
> > write the functions like this:
> >     
> >     ```
> >     double value() const 
> >     {
> >       CHECK(type == FLOATING) << error_msg;
> >       return value_;
> >     }
> >     ```
> >     
> >     This has the advantage of forcing us to change all the usage sites and 
> > make sure we make the right decision at each point.

I thought we didn't want to change all the tests (which is where we find usages 
of `.value`).  That's why the double printing was changed instead.

Also, can you take another look at the accessor?


- Joseph


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


On Sept. 9, 2015, 3:20 p.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/38031/
> -----------------------------------------------------------
> 
> (Updated Sept. 9, 2015, 3:20 p.m.)
> 
> 
> Review request for mesos, Ben Mahler, Artem Harutyunyan, Joris Van 
> Remoortere, Michael Park, and Vinod Kone.
> 
> 
> Bugs: MESOS-3345
>     https://issues.apache.org/jira/browse/MESOS-3345
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> * Changes JSON::Number to keep track of whether it is floating, signed 
> integral, or unsigned integral.
> * Changes how JSON::Number is stringified, to ensure that stringified doubles 
> are parsed as JSON doubles.
> * Added one test for integer precision between String <-> JSON <-> Protobuf 
> conversions.
> * Added one test for JSON::Number comparisons.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp 
> f28138c4682c41e94ab6c7641a78d66b2f9daa5f 
>   3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp 
> 57d5fdf45273c620655b44b5f5572290cffa4bf6 
>   3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp 
> 850650c269e9be24c0f1ae81b8aa8725f8a0c151 
>   3rdparty/libprocess/3rdparty/stout/tests/protobuf_tests.cpp 
> c56d6a3098293eb3659b3066f10e875927ec3ac3 
> 
> Diff: https://reviews.apache.org/r/38031/diff/
> 
> 
> Testing
> -------
> 
> No testing done until the last patch in the chain.
> 
> However, this patch does breaks some libprocess and mesos tests (because 
> JSON::Number is stored differently), which are fixed in the following two 
> reviews.
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>

Reply via email to