Re: [PATCH wayland] wl_strtol and wl_strtoul utility functions are added (inlined patch)

2014-10-16 Thread Imran Zaman
Here are my comments: Giulio Camuffo: if we copy-paste the same code to weston as well, means we have to write tests etc for two functions in weston as well; and it will come with maintenance overhead without any benefit of hiding the APIs in wayland (I can take the responsibility of maintaining

[PATCH wayland] wl_strtol and wl_strtoul utility functions are added (inlined patch)

2014-10-15 Thread Imran Zaman
Hi The patch is used to replace strtol and strtoul with wl_strtol and wl_strtoul with inputs and result checks. The utility functions are used extensively in wayland and weston so added appropriate input and output checks; test cases are also updated; will push the patch for weston as well.

Re: [PATCH wayland] wl_strtol and wl_strtoul utility functions are added (inlined patch)

2014-10-15 Thread Jasper St. Pierre
Why? What's the rationale for this? On Wed, Oct 15, 2014 at 6:18 AM, Imran Zaman imran.za...@gmail.com wrote: Hi The patch is used to replace strtol and strtoul with wl_strtol and wl_strtoul with inputs and result checks. The utility functions are used extensively in wayland and weston so

Re: [PATCH wayland] wl_strtol and wl_strtoul utility functions are added (inlined patch)

2014-10-15 Thread Imran Zaman
The reason is that strtol is used at many places in weston/wayland.. and its not covering all the error cases everywhere.. so its better to encapsulate it in a function which i did.. On Wed, Oct 15, 2014 at 9:31 PM, Jasper St. Pierre jstpie...@mecheye.net wrote: Why? What's the rationale for

Re: [PATCH wayland] wl_strtol and wl_strtoul utility functions are added (inlined patch)

2014-10-15 Thread Bill Spitzak
You might be able to remove the base argument, is anybody using that? That would remove confusion over which is the base and return argument Also it seems like calling code would be easier to read with a version that returns the value but puts the error into errno. Something like this:

Re: [PATCH wayland] wl_strtol and wl_strtoul utility functions are added (inlined patch)

2014-10-15 Thread Giulio Camuffo
2014-10-15 22:01 GMT+03:00 Imran Zaman imran.za...@gmail.com: The reason is that strtol is used at many places in weston/wayland.. and its not covering all the error cases everywhere.. so its better to encapsulate it in a function which i did.. You may have a point here, but imho it must not

Re: [PATCH wayland] wl_strtol and wl_strtoul utility functions are added (inlined patch)

2014-10-15 Thread Bryce Harrington
On Wed, Oct 15, 2014 at 04:18:59PM +0300, Imran Zaman wrote: Hi The patch is used to replace strtol and strtoul with wl_strtol and wl_strtoul with inputs and result checks. The utility functions are used extensively in wayland and weston so added These utility... appropriate input and