Re: [PATCH v1] Added string conversion utility functions

2014-12-02 Thread Imran Zaman
Interesting read.. have some arguments about the raised points.. but lets not go in that direction.. Can you guys suggest to do some changes or shall i drop the patch altogether? if you are happy with current implementation lets live with it.. I noticed bug when weston was not working properly due

Re: [PATCH v1] Added string conversion utility functions

2014-12-02 Thread Pekka Paalanen
On Tue, 2 Dec 2014 15:45:40 +0200 Imran Zaman imran.za...@gmail.com wrote: Interesting read.. have some arguments about the raised points.. but lets not go in that direction.. Can you guys suggest to do some changes or shall i drop the patch altogether? if you are happy with current

Re: [PATCH v1] Added string conversion utility functions

2014-12-02 Thread Bill Spitzak
I think the desired function was to fail if there was text after the number, fail on blank strings, and fail on overflow. All of these are somewhat cryptic with strtol. However, writing a helper function whose benefit over a direct call to strto*() is only the handling of errno, it might not

Re: [PATCH v1] Added string conversion utility functions

2014-12-01 Thread Pekka Paalanen
On Tue, 25 Nov 2014 22:17:24 +0200 Imran Zaman imran.za...@gmail.com wrote: Thanks Bill for your comments. Plz see my comments inline. On Tue, Nov 25, 2014 at 9:26 PM, Bill Spitzak spit...@gmail.com wrote: On 11/24/2014 11:12 PM, Imran Zaman wrote: On Tue, Nov 25, 2014 at 1:15 AM,

Re: [PATCH v1] Added string conversion utility functions

2014-12-01 Thread Bill Spitzak
On 12/01/2014 04:10 AM, Pekka Paalanen wrote: other = strtol(pid, end, 0); if (end != pid + 10) { weston_log(can't parse lock file %s\n, lockfile); close(fd);

Re: [PATCH v1] Added string conversion utility functions

2014-11-25 Thread Bill Spitzak
On 11/24/2014 11:12 PM, Imran Zaman wrote: On Tue, Nov 25, 2014 at 1:15 AM, Bill Spitzak spit...@gmail.com wrote: On 11/24/2014 11:32 AM, Imran Zaman wrote: [IZ2] This is the case where endptr is used in patch. I can remove endptr but it seems its used so i have to keep the existing

Re: [PATCH v1] Added string conversion utility functions

2014-11-24 Thread Imran Zaman
Thanks Bill for your comments. Please see my comments inline. On Fri, Nov 21, 2014 at 9:31 PM, Bill Spitzak spit...@gmail.com wrote: There is no need to pass endptr, because your functions will always fail if it is not set to point to the terminating null. [IZ] endptr is passed other than

Re: [PATCH v1] Added string conversion utility functions

2014-11-24 Thread Bill Spitzak
On 11/24/2014 05:08 AM, Imran Zaman wrote: Thanks Bill for your comments. Please see my comments inline. On Fri, Nov 21, 2014 at 9:31 PM, Bill Spitzak spit...@gmail.com wrote: There is no need to pass endptr, because your functions will always fail if it is not set to point to the

Re: [PATCH v1] Added string conversion utility functions

2014-11-24 Thread Imran Zaman
On Tue, Nov 25, 2014 at 1:15 AM, Bill Spitzak spit...@gmail.com wrote: On 11/24/2014 11:32 AM, Imran Zaman wrote: [IZ2] This is the case where endptr is used in patch. I can remove endptr but it seems its used so i have to keep the existing functionality in place. + if (!weston_strtoi(pid,

[PATCH v1] Added string conversion utility functions

2014-11-21 Thread Imran Zaman
Change-Id: I50900852311604a8c31313bbfb1d137c495d2269 Signed-off-by: Imran Zaman imran.za...@gmail.com --- Makefile.am | 14 +- clients/multi-resource.c| 8 +- clients/terminal.c | 8 +- clients/wscreensaver-glue.c | 6 +- shared/config-parser.c | 10 +-

Re: [PATCH v1] Added string conversion utility functions

2014-11-21 Thread Bill Spitzak
There is no need to pass endptr, because your functions will always fail if it is not set to point to the terminating null. I also suspect that the base is never used. In addition a possible future fix would be to accept 0x for hex but a leading zero is decimal, not octal, which means this

Re: [PATCH v1] Added string conversion utility functions

2014-11-21 Thread Daniel Stone
On 21 November 2014 19:31, Bill Spitzak spit...@gmail.com wrote: It is useful to pass -1 for strtoul and this should continue to work. It is the only easily-recognized value for largest number possible. Other than ~0UL, ~0ULL, ULONG_MAX, etc ... ___

Re: [PATCH v1] Added string conversion utility functions

2014-11-21 Thread Bill Spitzak
On 11/21/2014 11:48 AM, Daniel Stone wrote: On 21 November 2014 19:31, Bill Spitzak spit...@gmail.com mailto:spit...@gmail.com wrote: It is useful to pass -1 for strtoul and this should continue to work. It is the only easily-recognized value for largest number possible. Other