Re: [PATCH] util/cutils: Expand do_strtosz parsing precision to 64 bits

2019-12-19 Thread Markus Armbruster
Tao Xu writes: > On 12/19/2019 2:26 AM, Markus Armbruster wrote: >> Tao Xu writes: >> >>> On 12/18/2019 9:33 AM, Tao Xu wrote: On 12/17/2019 6:25 PM, Markus Armbruster wrote: >> [...] > Also fun: for "0123", we use uint64_t 83, not double 123.0.  But for > "0123.", we use 123.0,

Re: [PATCH] util/cutils: Expand do_strtosz parsing precision to 64 bits

2019-12-18 Thread Tao Xu
On 12/19/2019 2:26 AM, Markus Armbruster wrote: Tao Xu writes: On 12/18/2019 9:33 AM, Tao Xu wrote: On 12/17/2019 6:25 PM, Markus Armbruster wrote: [...] Also fun: for "0123", we use uint64_t 83, not double 123.0.  But for "0123.", we use 123.0, not 83. Do we really want to accept octal

Re: [PATCH] util/cutils: Expand do_strtosz parsing precision to 64 bits

2019-12-18 Thread Eric Blake
On 12/17/19 7:33 PM, Tao Xu wrote: Also fun: for "0123", we use uint64_t 83, not double 123.0.  But for "0123.", we use 123.0, not 83. Do we really want to accept octal and hexadecimal integers? Thank you for reminding me. Octal and hexadecimal may bring more confusion. I will use

Re: [PATCH] util/cutils: Expand do_strtosz parsing precision to 64 bits

2019-12-18 Thread Markus Armbruster
Tao Xu writes: > On 12/18/2019 9:33 AM, Tao Xu wrote: >> On 12/17/2019 6:25 PM, Markus Armbruster wrote: [...] >>> Also fun: for "0123", we use uint64_t 83, not double 123.0.  But for >>> "0123.", we use 123.0, not 83. >>> >>> Do we really want to accept octal and hexadecimal integers? >>> >> >>

Re: [PATCH] util/cutils: Expand do_strtosz parsing precision to 64 bits

2019-12-17 Thread Tao Xu
On 12/18/2019 9:33 AM, Tao Xu wrote: On 12/17/2019 6:25 PM, Markus Armbruster wrote: Tao Xu writes: On 12/5/19 11:29 PM, Markus Armbruster wrote: Tao Xu writes: Parse input string both as a double and as a uint64_t, then use the method which consumes more characters. Update the related

Re: [PATCH] util/cutils: Expand do_strtosz parsing precision to 64 bits

2019-12-17 Thread Tao Xu
On 12/17/2019 11:01 PM, Markus Armbruster wrote: Christophe de Dinechin writes: On 17 Dec 2019, at 15:08, Markus Armbruster wrote: Christophe de Dinechin writes: On 5 Dec 2019, at 16:29, Markus Armbruster wrote: Tao Xu writes: Parse input string both as a double and as a uint64_t,

Re: [PATCH] util/cutils: Expand do_strtosz parsing precision to 64 bits

2019-12-17 Thread Tao Xu
On 12/17/2019 6:25 PM, Markus Armbruster wrote: Tao Xu writes: On 12/5/19 11:29 PM, Markus Armbruster wrote: Tao Xu writes: Parse input string both as a double and as a uint64_t, then use the method which consumes more characters. Update the related test cases. Signed-off-by: Tao Xu ---

Re: [PATCH] util/cutils: Expand do_strtosz parsing precision to 64 bits

2019-12-17 Thread Markus Armbruster
Christophe de Dinechin writes: >> On 17 Dec 2019, at 15:08, Markus Armbruster wrote: >> >> Christophe de Dinechin writes: >> On 5 Dec 2019, at 16:29, Markus Armbruster wrote: Tao Xu writes: > Parse input string both as a double and as a uint64_t, then use the

Re: [PATCH] util/cutils: Expand do_strtosz parsing precision to 64 bits

2019-12-17 Thread Christophe de Dinechin
> On 17 Dec 2019, at 15:08, Markus Armbruster wrote: > > Christophe de Dinechin writes: > >>> On 5 Dec 2019, at 16:29, Markus Armbruster wrote: >>> >>> Tao Xu writes: >>> Parse input string both as a double and as a uint64_t, then use the method which consumes more characters.

Re: [PATCH] util/cutils: Expand do_strtosz parsing precision to 64 bits

2019-12-17 Thread Markus Armbruster
Christophe de Dinechin writes: >> On 5 Dec 2019, at 16:29, Markus Armbruster wrote: >> >> Tao Xu writes: >> >>> Parse input string both as a double and as a uint64_t, then use the >>> method which consumes more characters. Update the related test cases. >>> >>> Signed-off-by: Tao Xu >>>

Re: [PATCH] util/cutils: Expand do_strtosz parsing precision to 64 bits

2019-12-17 Thread Christophe de Dinechin
> On 5 Dec 2019, at 16:29, Markus Armbruster wrote: > > Tao Xu writes: > >> Parse input string both as a double and as a uint64_t, then use the >> method which consumes more characters. Update the related test cases. >> >> Signed-off-by: Tao Xu >> --- > [...] >> diff --git a/util/cutils.c

Re: [PATCH] util/cutils: Expand do_strtosz parsing precision to 64 bits

2019-12-17 Thread Markus Armbruster
Tao Xu writes: > On 12/5/19 11:29 PM, Markus Armbruster wrote: >> Tao Xu writes: >> >>> Parse input string both as a double and as a uint64_t, then use the >>> method which consumes more characters. Update the related test cases. >>> >>> Signed-off-by: Tao Xu >>> --- >> [...] >>> diff --git

Re: [PATCH] util/cutils: Expand do_strtosz parsing precision to 64 bits

2019-12-08 Thread Tao Xu
On 12/5/19 11:29 PM, Markus Armbruster wrote: Tao Xu writes: Parse input string both as a double and as a uint64_t, then use the method which consumes more characters. Update the related test cases. Signed-off-by: Tao Xu --- [...] diff --git a/util/cutils.c b/util/cutils.c index

Re: [PATCH] util/cutils: Expand do_strtosz parsing precision to 64 bits

2019-12-05 Thread Markus Armbruster
Tao Xu writes: > Parse input string both as a double and as a uint64_t, then use the > method which consumes more characters. Update the related test cases. > > Signed-off-by: Tao Xu > --- [...] > diff --git a/util/cutils.c b/util/cutils.c > index 77acadc70a..b08058c57c 100644 > ---

[PATCH] util/cutils: Expand do_strtosz parsing precision to 64 bits

2019-12-04 Thread Tao Xu
Parse input string both as a double and as a uint64_t, then use the method which consumes more characters. Update the related test cases. Signed-off-by: Tao Xu --- tests/test-cutils.c| 37 - tests/test-keyval.c| 47 --- tests/test-qemu-opts.c