On Mon, May 22, 2017 at 03:51:39PM -0700, Joe Stringer wrote:
> Many standard library functions are wrapped in OVS, so check for usage
> of the original versions and suggest that authors replace them with the
> OVS versions.
>
> Signed-off-by: Joe Stringer <[email protected]>
Thanks for working to improve the patch checks!
> +def regex_function_factory(func_name):
> + regex = re.compile('[^x]%s\([^)]*\)' % func_name)
> + return lambda x: regex.search(x) is not None
> +
> +
> +std_functions = [
> + ('malloc', 'Use xmalloc() in place of malloc()'),
> + ('calloc', 'Use xcmalloc() in place of calloc()'),
xcalloc, not xcmalloc
> + ('zalloc', 'Use xzmalloc() in place of zalloc()'),
I don't think there's a zalloc function.
> + ('realloc', 'Use xrealloc() in place of realloc()'),
> + ('memdup', 'Use xmemdup() in place of memdup()'),
> + ('memdup0', 'Use xmemdup0() in place of memdup0()'),
I don't think there's a memdup0 function.
> + ('strdup', 'Use xstrdup() in place of strdup()'),
> + ('asprintf', 'Use xasprintf() in place of asprintf()'),
> + ('vasprintf', 'Use xvasprintf() in place of vasprintf()'),
> + ('2nrealloc', 'Use x2nrealloc() in place of 2nrealloc()'),
I don't think there's a 2nrealloc function.
> + ('strlcpy', 'Use ovs_strlcpy() in place of strlcpy()'),
> + ('strzcpy', 'Use ovs_strzcpy() in place of strzcpy()'),
I don't think there's a strzcpy function, but ovs_strzcpy() might be a
substitute for strncpy.
It can often be a good idea to use ovs_strlcpy() in place of plain
strcpy().
> + ('strerror', 'Use ovs_strerror() in place of strerror()'),
> + ('sleep', 'Use xsleep() in place of sleep()'),
> + ('abort', 'Use xabort() in place of abort()'),
I don't think we have an xabort function.
> + ('error', 'Use xerror() in place of error()'),
I don't know of either error *or* xerror functions.
Thanks,
Ben.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev