Re: [PATCH v2] wayland-util: added wl_strtol/wl_strtoul utility functions

2014-10-22 Thread Bill Spitzak
On 10/22/2014 02:13 AM, Marek Chalupa wrote: What I'm wondering is what should be the behavior of wl_strtoul for negative numbers? strtoul silently converts them, but I don't think this is what we always want... or is it? -1 is a handy shortcut for strtoul to get all the bits turned on and get

Re: [PATCH v2] wayland-util: added wl_strtol/wl_strtoul utility functions

2014-10-22 Thread Imran Zaman
I pushed an updated patch v3. Added test cases for overflow and also check for negative numbers for wl_strtoul.. please review BR imran On Wed, Oct 22, 2014 at 12:13 PM, Marek Chalupa wrote: > Hi, > > Personally, I'd rather see these functions private (somebody has already > mentioned that), > b

Re: [PATCH v2] wayland-util: added wl_strtol/wl_strtoul utility functions

2014-10-22 Thread Marek Chalupa
Hi, Personally, I'd rather see these functions private (somebody has already mentioned that), but I understand there are reasons for them to be public and maybe in the end it will have more pros.. Anyway, I have few nitpicks and a questions - see below. On 16 October 2014 18:11, Imran Zaman wrot

[PATCH v2] wayland-util: added wl_strtol/wl_strtoul utility functions

2014-10-16 Thread Imran Zaman
strtol/strtoul utility functions are used extensively in weston/wayland, and are not bug-free in their current form. To avoid definition in weston and wayland, its wrapped in functions with appropriate input and output checks. Test cases are also updated. Signed-off-by: Imran Zaman --- src/scann